Adding column into datagrid by code

S

simon

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.
 
S

simonlawsh

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)
{.....}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top