al445843
New member
Hi,
I want to be able to select a row on my datagrid, but I dont know what is happening.
First I get a key of the item that should be selected on my grid, and then I try to use that information to select the row, but I cant make it
I have this code in my ItemDataBound event of my datagrid
If dgChartMap.DataKeys(e.Item.ItemIndex) = MyKey Then
dgChartMap.SelectedIndex = e.Item.ItemIndex
End If
So, I debugged it, and in fact I get the SelectedIndex value right, but when I see the datagrid, no row is selected.
Does anybode know what am I doing wrong, or how should I set this in order to run?
Thanks in advance
I want to be able to select a row on my datagrid, but I dont know what is happening.
First I get a key of the item that should be selected on my grid, and then I try to use that information to select the row, but I cant make it
I have this code in my ItemDataBound event of my datagrid
If dgChartMap.DataKeys(e.Item.ItemIndex) = MyKey Then
dgChartMap.SelectedIndex = e.Item.ItemIndex
End If
So, I debugged it, and in fact I get the SelectedIndex value right, but when I see the datagrid, no row is selected.
Does anybode know what am I doing wrong, or how should I set this in order to run?
Thanks in advance