G
Guest
Hi!
When I add a bound column programatically, like:
BoundColumn bc = new BoundColumn();
bc.DataField = "myField";
bc.SortExpression = "myField";
myGrid.Columns.Add(bc);
the SortCommand event does not trig at all!
If I replace the code whith the markup syntax in the ascx file, it works
fine. I've google around but the only solution to the problem seemes to be
moving the code to Page_Init.
This is not possible because at that time I dont know the structure of the
table. Depending on a selection in a dropdown, i get diffrent datatables to
bind with the grid. The selectedindexchanged event on the dropdown will not
fire until much later in execution, so in Page_Init I wouldn't know what was
selected yet. Furthermore i cant understand what Page_Init has to do with all
of this.
I'm confused, any ideas?
Thanks,
Paul
When I add a bound column programatically, like:
BoundColumn bc = new BoundColumn();
bc.DataField = "myField";
bc.SortExpression = "myField";
myGrid.Columns.Add(bc);
the SortCommand event does not trig at all!
If I replace the code whith the markup syntax in the ascx file, it works
fine. I've google around but the only solution to the problem seemes to be
moving the code to Page_Init.
This is not possible because at that time I dont know the structure of the
table. Depending on a selection in a dropdown, i get diffrent datatables to
bind with the grid. The selectedindexchanged event on the dropdown will not
fire until much later in execution, so in Page_Init I wouldn't know what was
selected yet. Furthermore i cant understand what Page_Init has to do with all
of this.
I'm confused, any ideas?
Thanks,
Paul