Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > SortExpression makes SortCommand event not to trig

Reply
Thread Tools

SortExpression makes SortCommand event not to trig

 
 
=?Utf-8?B?UGF1bA==?=
Guest
Posts: n/a
 
      09-22-2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid SortCommand Event not fired on dynamically generated datagrid biru ASP .Net Web Controls 2 05-06-2005 01:38 PM
SortCommand and PageIndexChange event not firing sa siva via .NET 247 ASP .Net Datagrid Control 2 05-05-2005 03:07 PM
SortCommand event does not fire when ViewState is disabled ae ASP .Net Web Controls 2 04-08-2005 06:41 PM
Can't Call DataGrid SortCommand Event handler Mo ASP .Net 0 01-13-2004 06:58 PM
DataGrid SortCommand event not triggered John Sturgeon ASP .Net 2 12-02-2003 07:14 PM



Advertisments