DataGridView + Edit

B

Bharathi Kumar

Hi,

Iam working on a window application using vb.net 2005.

There is a control "DataGridView" in vs 2005 instead of data
grid control.

After binding the datagridview, When we click on any cell to
modify the data (or anything) the entire
cell will be selected.

When user want to modify the data in any cell he has to click
there thrice:

Click 1: Setting focus to the cell. (This selects the entire
cell. A blur bar will appear in the selected cell)
Click 2: This brings the cell into edit mode. (This selects
the text in the cell)
Click 3: To place the cursor in the cell so that data
modification can be done.

Instead of this way, I want the cursor to be in the cell when we press
the tab or just select it. How can I achieve this. Please.........

I have tried the following code :

Private Sub DataGridView1_CellBeginEdit(ByVal sender As Object,
ByVal e As System.Windows.Forms.DataGridViewCellCancelEventArgs)
Handles DataGridView1.CellBeginEdit
SendKeys.Send("{Right}")
End Sub

But it didnt help me. I didnt achieve the required functionality.
Please help.

Thanks and regards,
Bharathi.
 
G

Guest

Hi

Try to find out an event which does this. I mean try to find out all the
Events which fires when an Edit happens on a Cell. I think this is
achievable, I am pretty much sure on that.

I do not have VS 2005 hence I will try to give an Idea. Just try that on
Click Event. I suppose there will be Double Click and Single Click events on
the Cell. So, try to your code modification in "Click" event of the Grid.

Hope this idea might help you.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top