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

Visual Basic

 
AnswerRe: Devshock.Net Pin
Dave Kreskowiak14-May-12 3:13
mveDave Kreskowiak14-May-12 3:13 
Questionhow to controll cells inside Table1DataGridView Pin
romo2213-May-12 13:58
romo2213-May-12 13:58 
AnswerRe: how to controll cells inside Table1DataGridView Pin
JohnPayton13-May-12 16:34
JohnPayton13-May-12 16:34 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2213-May-12 17:47
romo2213-May-12 17:47 
AnswerRe: how to controll cells inside Table1DataGridView Pin
Luc Pattyn13-May-12 17:05
sitebuilderLuc Pattyn13-May-12 17:05 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2213-May-12 17:49
romo2213-May-12 17:49 
AnswerRe: how to controll cells inside Table1DataGridView Pin
Luc Pattyn13-May-12 18:00
sitebuilderLuc Pattyn13-May-12 18:00 
GeneralRe: how to controll cells inside Table1DataGridView Pin
JohnPayton13-May-12 19:51
JohnPayton13-May-12 19:51 
What Luc is suggesting is correct, use an event handler for the DataGridView to trigger the action you want to occur.
Is the DataGridView populated by a data table or array? Do you wish to save the changes back to the database?

But to just populate the second cell with the third cell's contents just use something like this.

'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

(The above can be shortened, but I did it this way so you can step through to check the value being copied to "pstrContents" prior to the insert into the second cell)

It would be here you save any changes back to the data source and refresh the grid.

Does this help?
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2213-May-12 21:35
romo2213-May-12 21:35 
GeneralRe: how to controll cells inside Table1DataGridView Pin
JohnPayton13-May-12 21:53
JohnPayton13-May-12 21:53 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2213-May-12 22:19
romo2213-May-12 22:19 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2213-May-12 23:16
romo2213-May-12 23:16 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2214-May-12 10:44
romo2214-May-12 10:44 
GeneralRe: how to controll cells inside Table1DataGridView Pin
JohnPayton14-May-12 13:29
JohnPayton14-May-12 13:29 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2214-May-12 23:27
romo2214-May-12 23:27 
GeneralRe: how to controll cells inside Table1DataGridView Pin
JohnPayton15-May-12 13:46
JohnPayton15-May-12 13:46 
GeneralRe: how to controll cells inside Table1DataGridView Pin
romo2215-May-12 14:47
romo2215-May-12 14:47 
GeneralRe: how to controll cells inside Table1DataGridView Pin
JohnPayton15-May-12 16:47
JohnPayton15-May-12 16:47 
Questionconvert c# to vb Pin
radinabedi12-May-12 21:20
radinabedi12-May-12 21:20 
AnswerRe: convert c# to vb Pin
Duc Huy Nguyen12-May-12 23:09
Duc Huy Nguyen12-May-12 23:09 
QuestionText box problem Pin
rusydan.khir11-May-12 11:39
rusydan.khir11-May-12 11:39 
AnswerRe: Text box problem Pin
Dave Kreskowiak11-May-12 11:54
mveDave Kreskowiak11-May-12 11:54 
GeneralRe: Text box problem Pin
rusydan.khir11-May-12 17:24
rusydan.khir11-May-12 17:24 
GeneralRe: Text box problem Pin
Dave Kreskowiak12-May-12 5:19
mveDave Kreskowiak12-May-12 5:19 
AnswerRe: Text box problem Pin
Richard MacCutchan11-May-12 23:49
mveRichard MacCutchan11-May-12 23:49 

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.