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

Re: Datagrid SortCommand does not work ??? by W

W
Wed Dec 01 18:02:40 CST 2004

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

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Stuart" <Stuart@discussions.microsoft.com> wrote in message
news:4A4E8159-D635-4966-AA6A-E4008AADBF26@microsoft.com...
> 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
>