Connecting Tech Pros Worldwide Help | Site Map

How to select or highlight data grid row

sujathaeeshan's Avatar
Newbie
 
Join Date: Feb 2008
Posts: 19
#1: Nov 12 '08
Hello all,

I want to highlight or select data grid row based on first letter of first column in data grid with keyboard.

Just by pressing the key of first letter of the column ,it has to highlight the respective row.

For example,

RST 1000 FFF
FGH 2000 JJJ
KLP 3000 KKK
FST 4000 GGG

grid will be having 4 rows like this,if user prees F then it has to highlight 2nd row,if he press F continuosly then its has to highlight the 4th row..like it has to search and Highlight all Rows that's having first column name starting with F.

This feature is default for combo box list or list box .

But how i will be able to provide the same functionality for Data Grid.


Thanx,
Suji
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,149
#2: Nov 12 '08

re: How to select or highlight data grid row


I have been wondering if there was a nice way to do this myself.

So far all I have been able to find was that you manually watch the keypresses and loop through the the data looking for a matching row and then select it
sujathaeeshan's Avatar
Newbie
 
Join Date: Feb 2008
Posts: 19
#3: Nov 13 '08

re: How to select or highlight data grid row


Can you please give an example ...
for the selected alphabet it has to loop through the data for matching row
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,149
#4: Nov 13 '08

re: How to select or highlight data grid row


Yeah pretty much, you watch the key presses and if the user presses 'a' you loop through your rows until you find one that starts with an 'a'
Reply