Programatically click on datagridview row or header

mindserve

New member
Joined
Nov 8, 2010
Messages
3
Programming Experience
1-3
I have created a barcode scanning option for my users.
They can scan the barcode using a wedge USB scanner into a textbox and the
item scanned then finds the item in a datagridview and hides the other items that do not match. The user can then click on a button in the datagridview which is a bound control and the item then moves to another datagridview for checkout.

In the textbox key press that receives the scanned barcode I need it to pick the button in the datagridview so that the user does not have to manually click it. The column and row are both zero column(0) row(0). Any clues as to how to do this? I have searched everywhere but so far can't find any sample code and there is no datagridview.performclick option.
 
Adding click execution code

Remember that for every event at any object you can call the method with the parameters (nothing, nothing) in order for it to execute.

So you could simply send a gridx.rows(0).columns(0).button1_click(nothing, nothing) at it should work, given that it is the button1_click method the one that should run.

Hope it helps
 
performclick on cell or column

I get an error that columns is not a member of system.windows.forms.datagridview ?
It's not really a button, it's a cell that is viewed as a button. but it could be a checkbox etc. So how do you perform a click on a cell?
 
gridx.rows(0).columns(0).button1_click(nothing, nothing)

This throws an exception:
dgProducts.SelectedRows(i).Cells(0).Value.dgproducts_CellContentClick(Nothing, Nothing)
 
Back
Top