Hi all,
I'm coding for an event in a DataGrid. I started with OnPreRender, but at
this point I don't really care which event I use, as long as my code executes
before the DataGrid displays on the Web page (grrr!). My problem is that all
the DataGrid events seem to require System.EventArgs be passed to the
function I'm writing, instead of DataGridCommandEvenArgs. But if I use
System.EventArgs, how do I assign the text of a particular datagrid cell to a
variable? For example, I'm constructing a hashtable and want to do the
following:
Dim htbAddlInfo As New Hashtable
htbAddlInfo.Add("Title", e.Item.Cells(2).Text)
That works if I pass DataGridColumnEventArgs to my function, but the
compiler complains that my function doesn't have the same signature as
Delegate Sub EventHandler, which requires System.EventArgs. If I change my
function to take e as Sytem.EventArgs, e.Item.Cells(2).Text is no longer
valid. How do I get around this? And WHY does the DataGrid have events that
don't support its eventargs? Second question is just rhetorical, but I'd
really love an answer on the first question.
Thanks!