Oct 18, 2012, 8:33 PM
[CLOSED] how to save GridPanel configuration to db after user changed it during runtime
More simply: I need to know (i have no idea) how to get in code behind the grid panel's width when it is resized by user or the same for the hidden value.
just want to save gridpanel columns width and hidden value changed by the user during runtime and send them to database linked to the username who dit the job to reload them later.
in behind code i call the function in example in a directevent of a button for saving data.
There I access the values i need in the way you see ( g.ColumnModel.Columns[i]..... ) and I don't get the changed by user values but the original values.
for instance, user changed the width of the first column from original 50 to 145 but in the codebehind i get still 50.
What structure should i access or what should i do?
Thanks in advance
just want to save gridpanel columns width and hidden value changed by the user during runtime and send them to database linked to the username who dit the job to reload them later.
in behind code i call the function in example in a directevent of a button for saving data.
There I access the values i need in the way you see ( g.ColumnModel.Columns[i]..... ) and I don't get the changed by user values but the original values.
for instance, user changed the width of the first column from original 50 to 145 but in the codebehind i get still 50.
What structure should i access or what should i do?
Thanks in advance
public static void saveConfigurationGridToDB (GridPanel g, string savegridname )
{
for (int i = 0; i < g.ColumnModel.Columns.Count(); i++)
{
string sql = "insert into myDbGridConfig (language, user, object, id_progr, text, width, fhidden) values (";
sql += "'French','myUser','" + savegridname + "'," + i.ToString() + "'";
sql += g.ColumnModel.Columns[i].Text + "',";
sql += g.ColumnModel.Columns[i].Width.Value.ToString() + ",";
sql += g.ColumnModel.Columns[i].Hidden.Value.ToString()+")";
}
}
Last edited by Daniil; Oct 19, 2012 at 3:58 PM.
Reason: [CLOSED]