al445843 Posted March 7, 2003 Posted March 7, 2003 Hi, I want to be able to select a row on my datagrid, but I don't 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 can't 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 Quote
Cassio Posted March 8, 2003 Posted March 8, 2003 I´m not sure of what you mean by 'when I see the datagrid no row is selected', but if you want to display the selected row you´ve got to open the property builder select Format > Items > Selected Items and change the appearance (Back Color, Font,Fore Color...). Hope this will help. Quote Stream of Consciousness (My blog)
Moderators Robby Posted March 8, 2003 Moderators Posted March 8, 2003 If I understand correctly, you want to highlight a row in the datagrid as though the user clicked (selected) a row. Is this correct? If so try this.... DataGrid1.Select(yourIntValue) Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.