473,508 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid and Arrows

Hi,

I have DataGrid and i want to use the arrows to navigate up and down between
the lines. i also want that each row i'm in, will be marked (as in
DataGrid.Select(row_number)). When my form is loaded, my focus is on a
textbox i have, and what i want to do is that if i press the arrows keys the
focus will be on the dataGrid (on the next row) and while i'll navigate with
arrows, the row i will be in will be totaly marked.

how can i do that?

Thanks,
Gidi
Nov 18 '05 #1
1 1673
raj
On the form turn on the KeyPreview under the properties window

then add evenhandler for keypress to the form, compare the keycode to see if
it was an arrow (KeyChar) if so then move focus to the datagrid.
datagrid already handles arrow keys so you don t have to worry about that.
To select the row: use datagrid.RowIndex to get the current row in the
keypress event for the datagrid.
then use datagrid.Selectrow(datagrid.RowIndex)

u didn t think i was gonna code it for you did u? :)

have fun.... BTW MSDN is your friend


"Gidi" <sh*****@hotmail.com.dontspam> wrote in message
news:B7**********************************@microsof t.com...
Hi,

I have DataGrid and i want to use the arrows to navigate up and down
between
the lines. i also want that each row i'm in, will be marked (as in
DataGrid.Select(row_number)). When my form is loaded, my focus is on a
textbox i have, and what i want to do is that if i press the arrows keys
the
focus will be on the dataGrid (on the next row) and while i'll navigate
with
arrows, the row i will be in will be totaly marked.

how can i do that?

Thanks,
Gidi

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1138
by: Supa Hoopsa | last post by:
Can anyone tell me how to capture the Key-up & Key-down in the selection part (left hand 'margin') of a datagrid, i.e. when navigating up and down the datagrid using the up and down arrows. I...
1
1880
by: Gidi | last post by:
hello i have a DataGrid table and by the help of Adnan, here in the forum, i have the Mouse_up Event that by Clicking a row on the dataGrid it's selectes the whole ro the problem is when i'm...
1
1763
by: Gidi | last post by:
Hi All, i have a datagrid table that contains customers names, and a textbox which the user enters the customer name and the datagrid's dataset is updated so the customer name will be first....
0
1284
by: Gidi | last post by:
Hi, I have DataGrid table and TextBox in my form. the table contains names and i use the textBox to enter letters to search specific customer. i want that the user will be able to navigate the...
1
3968
by: Gidi | last post by:
Hi, I have DataGrid table and TextBox in my form. the table contains names and i use the textBox to enter letters to search specific customer. i want that the user will be able to navigate the...
1
1978
by: Maziar Aflatoun | last post by:
Hi, I have a Datagrid with AllowPaing property set so that the two arrows for the next and previous set of rows are showing. This is working fine. Now is there a way to instead of the 2...
5
1365
by: Manny Chohan | last post by:
i have the following situatin: In datagrid i click on hyperlink button to navigate to the detail.aspx page which displays detailed information regarding item id passed from datagrid. Can i put...
4
4796
by: chreo | last post by:
I assume that it is not hard problem. I would like user to only click in datagrid to select whole row - DONE I would like user to select whole row using UP and DOWN arrows. - DONE. And I would...
3
7180
by: chreo | last post by:
Hello. I have datagrid. I found code to select all row in data grid (by mouse or arrow keys). This works great - user can select row and... ....and I want to go to next control. For...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7323
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.