Click here to Skip to main content
15,884,388 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: how to controll cells inside Table1DataGridView Pin
JohnPayton13-May-12 15:34
JohnPayton13-May-12 15:34 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2213-May-12 16:47
romo2213-May-12 16:47 
AnswerRe: how to controll cells inside Table1DataGridView Pin
Luc Pattyn13-May-12 16:05
sitebuilderLuc Pattyn13-May-12 16:05 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2213-May-12 16:49
romo2213-May-12 16:49 
AnswerRe: how to controll cells inside Table1DataGridView Pin
Luc Pattyn13-May-12 17:00
sitebuilderLuc Pattyn13-May-12 17:00 
GeneralRe: how to controll cells inside Table1DataGridView Pin
JohnPayton13-May-12 18:51
JohnPayton13-May-12 18:51 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2213-May-12 20:35
romo2213-May-12 20:35 
GeneralRe: how to controll cells inside Table1DataGridView Pin
JohnPayton13-May-12 20:53
JohnPayton13-May-12 20:53 
Hi romo22,

An event handler is just an event that is called when a user clicks on or otherwise actions a control, such as your DataGridView.

Clicking on the DataGridView, will trigger the On_Click event. The first line of code after the declaration gets the ROW number of the grid, which in turn is used to access the data from the cells. For example......

Private Sub DataGridView_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView.Click

'Declare a couple of variables to hold the row number and contents of the third cell
Dim pRowNo as Integer
Dim pstrContents as String

'Get the ROW number
pRowNo = Val(DataGridView.SelectedCells(0).RowIndex.ToString())

'It's here where you test if Cell 0 is checked, then if so the remainder (below) is actioned.

'Store contents of cell three
pstrContents = DataGridView.Rows(pRowNo ).Cells(2).Value

'Insert contents into cell two
DataGridView.Rows(gintROWNO).Cells(1).Value = pstrContents

End Sub

This should get you started, you will find some great examples using Google.

Remember, this will place the data in the cell but will not save ot to your data source.
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2213-May-12 21:19
romo2213-May-12 21:19 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2213-May-12 22:16
romo2213-May-12 22:16 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2214-May-12 9:44
romo2214-May-12 9:44 
GeneralRe: how to controll cells inside Table1DataGridView Pin
JohnPayton14-May-12 12:29
JohnPayton14-May-12 12:29 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2214-May-12 22:27
romo2214-May-12 22:27 
GeneralRe: how to controll cells inside Table1DataGridView Pin
JohnPayton15-May-12 12:46
JohnPayton15-May-12 12:46 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2215-May-12 13:47
romo2215-May-12 13:47 
GeneralRe: how to controll cells inside Table1DataGridView Pin
JohnPayton15-May-12 15:47
JohnPayton15-May-12 15:47 
Questionconvert c# to vb Pin
radinabedi12-May-12 20:20
radinabedi12-May-12 20:20 
AnswerRe: convert c# to vb Pin
Duc Huy Nguyen12-May-12 22:09
Duc Huy Nguyen12-May-12 22:09 
QuestionText box problem Pin
rusydan.khir11-May-12 10:39
rusydan.khir11-May-12 10:39 
AnswerRe: Text box problem Pin
Dave Kreskowiak11-May-12 10:54
mveDave Kreskowiak11-May-12 10:54 
GeneralRe: Text box problem Pin
rusydan.khir11-May-12 16:24
rusydan.khir11-May-12 16:24 
GeneralRe: Text box problem Pin
Dave Kreskowiak12-May-12 4:19
mveDave Kreskowiak12-May-12 4:19 
AnswerRe: Text box problem Pin
Richard MacCutchan11-May-12 22:49
mveRichard MacCutchan11-May-12 22:49 
GeneralRe: Text box problem Pin
rusydan.khir13-May-12 0:55
rusydan.khir13-May-12 0:55 
GeneralRe: Text box problem Pin
Richard MacCutchan13-May-12 1:20
mveRichard MacCutchan13-May-12 1:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.