Hi,
I have a datagrid where I specify
OnItemCommand="GridCmdHandler"
AllowSorting="True" OnSortCommand="SortGrid"
I also have a button column on the grid
ButtonType="PushButton"
The problem is then when I click on a field to be
sorted the program dies because of
System.InvalidCastException: Exception of type
System.InvalidCastException was thrown.
It appears that even though I specify a OnSortCommand
function the program goes to the OnItemCommand
function where it gets caught up in this line of code
Button b = (Button) e.CommandSource;
(apparently the sort column headers are link buttons).
My questions are
1) why is the grid not going to the OnSortCommand
2) How do I get the button type from
DataGridCommandEventArgs at least this way I can
program around it. I can't change my button column to
link buttons because netscape won't support it.
Tanks for your help
Elissa Setareh
P.S. I know the problem is not in the sort function
because it worked fine when the button column was a
link buttons.
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1