problem with DataGrid1.AllowSorting = true;
Hi,
I am observing a weird thing here !
I generate my datagrid columns programatically (the columns depend on some conditions) and for that, I have to do something like this :
DataGrid1.AutoGenerateColumns = false;
DataGrid1.AllowSorting = true;
BoundColumn col = new BoundColumn();
col.HeaderText="Date";
col.DataField="insert_date";
col.DataFormatString = "{0:d}";
col.ItemStyle.Wrap = false;
col.SortExpression = "Date";
DataGrid1.Columns.Add(col);
But, my sorting does not work if the line:
DataGrid1.AutoGenerateColumns = false;
is present. If I comment out this line of code, then the sorting works - that too for some of the columns and not all.
Also, I observed that by having this line in my code, the program execution (most probably) does not even enter the DataGrid1_SortCommand(...) method !
I am lost, if someone can shed some light, it would be great.
Waiting,
-Apurva.
MrsWhitlPosted May 8, 2005, 2:47 PM
valsumePosted Jun 7, 2004, 1:28 PM
tsuman_inPosted Apr 7, 2004, 12:08 AM
apurvaPosted Apr 5, 2004, 7:25 PM
tsuman_inPosted Apr 3, 2004, 1:50 PM
apurvaPosted Apr 3, 2004, 11:24 AM
tsuman_inPosted Apr 3, 2004, 11:06 AM