Hi,
I have a dynamic pivot SQL query in a stored procedure, which returns a table. I used auto-generated columns, because that's the only way forward (number of columns and even column names changes). The first 2 columns are always the same, so i have the column name fixed. The rest are dynamic. Every cell has this format aaa|123. I need to split the string, put the first value in the cell and create an event on mouse click with the second value as parameter.
I saw i can get the value with ItemDataBound event, but it requires column name, not index. For example:
If TypeOf e.Item Is GridDataItem Then
Dim dataItem As GridDataItem = DirectCast(e.Item, GridDataItem)
dataItem.Item("ColumnX").Text = "Custom text"
End If
What i need is something like
If TypeOf e.Item Is GridDataItem Then
Dim dataItem As GridDataItem = DirectCast(e.Item, GridDataItem)
dataItem.Item(3).Text = "Custom text"
End If
And also i need to add a mouse click event in every cell
Please help!
Thank you!
I have a dynamic pivot SQL query in a stored procedure, which returns a table. I used auto-generated columns, because that's the only way forward (number of columns and even column names changes). The first 2 columns are always the same, so i have the column name fixed. The rest are dynamic. Every cell has this format aaa|123. I need to split the string, put the first value in the cell and create an event on mouse click with the second value as parameter.
I saw i can get the value with ItemDataBound event, but it requires column name, not index. For example:
If TypeOf e.Item Is GridDataItem Then
Dim dataItem As GridDataItem = DirectCast(e.Item, GridDataItem)
dataItem.Item("ColumnX").Text = "Custom text"
End If
What i need is something like
If TypeOf e.Item Is GridDataItem Then
Dim dataItem As GridDataItem = DirectCast(e.Item, GridDataItem)
dataItem.Item(3).Text = "Custom text"
End If
And also i need to add a mouse click event in every cell
Please help!
Thank you!