Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Adding column into datagrid by code

Reply
Thread Tools

Adding column into datagrid by code

 
 
simon
Guest
Posts: n/a
 
      03-17-2005
Hi,

I tried to insert a column into datagrid by back-end code, and I have
implemented a event handler for sorting. When I try to sort the column in
browser, it does not fired the sorting event handlers. Do anyone know how to
solve it?? Thx.
 
Reply With Quote
 
 
 
 
Jason Bentley
Guest
Posts: n/a
 
      03-17-2005
Simon, can we have some code to look at? It will be nearly impossible
to solve a problem like this without it.

Jason Bentley
http://geekswithblogs.net/jbentley

 
Reply With Quote
 
 
 
 
simonlawsh@gmail.com
Guest
Posts: n/a
 
      03-18-2005
I add columns to datagrid by:

grid.Columns.Add(new BoundColumn());

Then I implement a event handler to handle the events:

grid.SortCommand += new DataGridSortCommandEventHandler(Sort_Grid);

void Sort_Grid(Object sender, DataGridSortCommandEventArgs e)
{.....}

 
Reply With Quote
 
Jason Bentley
Guest
Posts: n/a
 
      03-21-2005
Simon, it seems a bit strange. I suppose you are setting the columns
sort expression. Can you walk through this code? This seems a bit
strange.

Jason Bentley
http://geekswithblogs.net/jbentley

 
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
bind a dropdown in a column in a datagrid based on the dropdown value selected in another column of the datagrid. vishnu ASP .Net 1 03-25-2006 01:24 PM
Adding column in datagrid by code simonlawsh@gmail.com ASP .Net Web Controls 0 03-17-2005 01:08 AM
Template column problem when adding datagrid via code RN ASP .Net 1 02-18-2005 02:03 AM
how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column Dave M ASP .Net Datagrid Control 0 12-14-2004 11:53 AM
How to bind a db image column (byte array) to a datagrid column? Jim Hammond ASP .Net 1 11-26-2003 12:55 AM



Advertisments