473,725 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send keystroke to a datagridview control

Hi everybody...
i need help with this issue: i have a textbox control with the focus. at
side, i have a datagridview control populated with some data. i need to
control behavior of dgv control from textbox. when i press pagedown/pageup
key (in textbox), i need to send that key to dgw, to move the data up/down,
but, without loss the focus in textbox. i already studied the sendkeys.send,
but i dont know how to send a key to control, the examples just explain how
to control a external app like calculator..

Thanks in advance.
Apr 28 '07 #1
3 2892
You might be better served to use the binding navigator for that purpose
(essentially what it is designed for). In any event, the easiest method to
do what you want with a textbox is probably to use the KeyUp or Keypress
events, parse out the pagedown/pageup keystrokes, then move thru up or down
through a bindingsource attached to the dgv.

"Bernardo Salazar newb" <Bernardo Salazar ne**@discussion s.microsoft.com>
wrote in message news:E8******** *************** ***********@mic rosoft.com...
Hi everybody...
i need help with this issue: i have a textbox control with the focus. at
side, i have a datagridview control populated with some data. i need to
control behavior of dgv control from textbox. when i press pagedown/pageup
key (in textbox), i need to send that key to dgw, to move the data
up/down,
but, without loss the focus in textbox. i already studied the
sendkeys.send,
but i dont know how to send a key to control, the examples just explain
how
to control a external app like calculator..

Thanks in advance.

Apr 29 '07 #2
Hi Earl, thanks for your time.
I can comment, the dgv are binding a datatable, and, when i add data to dgv,
i do this task adding the data to datatable directly. The desired effect is:
i catch pgdn/pgup trough keypress event in a textbox, and move the displayed
data in dvg up/down accordingly. My app have a "data post window", and all
typed data goes to the dgv. but sometimes, you may check what items typed,
and using pgdn/pgup, the user can visualize what are up or down in the
"ticket". i dont know if is possible to send "keystrokes " to a control (in
this case the dgv), or i have to do a different approach (using something
like dgv.firstdispla yedscrollingrow index). Thanks again for your advice.
--
Bernardo Salazar
"Earl" wrote:
You might be better served to use the binding navigator for that purpose
(essentially what it is designed for). In any event, the easiest method to
do what you want with a textbox is probably to use the KeyUp or Keypress
events, parse out the pagedown/pageup keystrokes, then move thru up or down
through a bindingsource attached to the dgv.

"Bernardo Salazar newb" <Bernardo Salazar ne**@discussion s.microsoft.com>
wrote in message news:E8******** *************** ***********@mic rosoft.com...
Hi everybody...
i need help with this issue: i have a textbox control with the focus. at
side, i have a datagridview control populated with some data. i need to
control behavior of dgv control from textbox. when i press pagedown/pageup
key (in textbox), i need to send that key to dgw, to move the data
up/down,
but, without loss the focus in textbox. i already studied the
sendkeys.send,
but i dont know how to send a key to control, the examples just explain
how
to control a external app like calculator..

Thanks in advance.


Apr 29 '07 #3
It would be easier to accomplish what you are trying to do if you bind the
datatable to a bindingsource, then use the bindingsource as datasource for
the dgv.

"Bernardo Salazar newb" <Be************ *****@discussio ns.microsoft.co m>
wrote in message news:42******** *************** ***********@mic rosoft.com...
Hi Earl, thanks for your time.
I can comment, the dgv are binding a datatable, and, when i add data to
dgv,
i do this task adding the data to datatable directly. The desired effect
is:
i catch pgdn/pgup trough keypress event in a textbox, and move the
displayed
data in dvg up/down accordingly. My app have a "data post window", and all
typed data goes to the dgv. but sometimes, you may check what items typed,
and using pgdn/pgup, the user can visualize what are up or down in the
"ticket". i dont know if is possible to send "keystrokes " to a control (in
this case the dgv), or i have to do a different approach (using something
like dgv.firstdispla yedscrollingrow index). Thanks again for your advice.
--
Bernardo Salazar
"Earl" wrote:
>You might be better served to use the binding navigator for that purpose
(essentially what it is designed for). In any event, the easiest method
to
do what you want with a textbox is probably to use the KeyUp or Keypress
events, parse out the pagedown/pageup keystrokes, then move thru up or
down
through a bindingsource attached to the dgv.

"Bernardo Salazar newb" <Bernardo Salazar ne**@discussion s.microsoft.com>
wrote in message
news:E8******* *************** ************@mi crosoft.com...
Hi everybody...
i need help with this issue: i have a textbox control with the focus.
at
side, i have a datagridview control populated with some data. i need to
control behavior of dgv control from textbox. when i press
pagedown/pageup
key (in textbox), i need to send that key to dgw, to move the data
up/down,
but, without loss the focus in textbox. i already studied the
sendkeys.send,
but i dont know how to send a key to control, the examples just explain
how
to control a external app like calculator..

Thanks in advance.



Apr 29 '07 #4

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

Similar topics

0
3619
by: DraguVaso | last post by:
Hi, I'm using the DataGridView in VB.NET 2.0. The DataSource is a Generic List of a custom class0: lstMyPersonnes = New List(Of clsPersonne). When I add a new clsPersonne to lstMyPersonnes, and rebind the lstMyPersonnes to my DataGridView.dataSource, it shows the new record in the DataGridView as it should be. But when I click on a cell of that row, I suddenly got this error: "Index -1
1
2309
by: Rich | last post by:
Hello, I am reading data from a sql server table that is under replication. This table has the replicatin GUID column that is generated with replicatin. I am reading the data from a dataAdapter/Dataset using a dataview which is the data source for a datagridview control. When I scroll horizontally in the datagridview control and reach this GUID column (which is not at the end of the table) it raises the datagridview dataError event. ...
7
12625
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's the background for my question... Before I switched my application over to the Fx 2.0, I used a DataGrid to display my data. I would store different DataGridTableStyles (each one with a custom set of columns) in the DataGrid.TableStyles property...
1
7781
by: Karl | last post by:
Hi all... This is a good one. You'll like this... I am working on a course management tool that allows certain Courses to be cross referenced with Job Roles and, when they are, whether the course is a priority course or not. Simple. Because there is alot of data stored for each course, I am using a tab control with several pages. The Job Role cross-referencing comes on
0
2502
by: jeastman - Hotmail | last post by:
Hello world Excuse, not to be written English and it helps me with a translator. I am new programming in C#. I made a control inheriting the DataGridView to be able to add controls done by my.
1
2475
by: Jeff | last post by:
Hey ..NET 2.0 I've created a User Control which contain a DataGridView. This User Control is displayed on a TabPage. This TabPage is added to the TabControl during runtime. The problem is this: Lets say if I set the size on the DataGridView to width=400px &
2
3993
by: TamusJRoyce | last post by:
I was curious if there is an easy way, besides making a new custom DataGridViewColumn, that on each keystroke validation is done (while the D.G.V.TextBoxCell is being edited), instead of when focus is lost off the cell. Or in a different senerio, if there is a way to restrict user keystrokes while a D.G.V.TextBoxCell is being edited, while not relying on making a new custom DataGridViewColumn. I would go through the work of implementing...
0
5654
by: priyamtheone | last post by:
I'm trying to make a datagridview column to act like a datetimepicker column (C#.Net 2005). These are the behaviours that the dgv should have: 1) Initially all the cells of the dtp column should be blank unless they are filled by the user. 2) As soon as the user enters a cell, the dtp control should appear as the editing control of that cell. If there's a value in the cell beforehand, that value is set as the value of the dtp editing control...
4
4879
by: alex21 | last post by:
Ok im getting this exception from a DataGridView control in my program. System.ArgumentOutOfRangeException was unhandled Message="Value of '132' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'.\r\nParameter name: Value" Source="System.Windows.Forms" ParamName="Value" StackTrace: at System.Windows.Forms.ScrollBar.set_Value(Int32 value) at System.Windows.Forms.DataGridView.ScrollRows(Int32...
0
8889
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9116
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8099
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3228
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 we have to send another system
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.