Datagrid SortCommand does not work ???

G

Guest

Hi There

I have a datagrid with a Select(LinkButton) Column followed by several Bound
Columns.

I have enabled the columns to sort and created the correct event handler (I
think) - however the crux of my problem is that when I click on one of the
column headers to sort by it the ItemCommand fires rather than the
SortCommand.

in the .aspx file I have:
OnItemCommand="SalesGroupInitial_ItemCommand"
OnSortCommand="SalesGroupInitial_SortCommand"

which correlate to the .aspx.vb file (I also have an OnItemDatabound event
if that is of any significance)

I have not included the code at this juncture as it is a flat case of the
wrong event firing when I click the Column Header

Any ideas would be very much appreciated

Stuart
 
W

W.G. Ryan eMVP

You can just bind to the DataTable's DefaultView instead - and set the Sort
= the ColumnValue reflected in the index of the eventarg.
 

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

Top