How to set DataGrid Cell Value

Im trying to set the DataGrid CurrentRow Cell value to what is contained in a text box txtMyValue.Text on my form
I have tried the code below but it wont work
Can anyone set me on the right path

DataGrid1.CurrentCell.RowNumber, 0).value = txtMyValue.Text

[265 byte] By [bigshop] at [2007-12-16]
# 1
Here are 5 ways I found to do it -- not sure which is best but they all work

'

'Set a value into the current Grid cell with a spesified column number

'DataGrid1(DataGrid1.CurrentCell.RowNumber, 5) = txtMessage.Text

'

'

'works

DataGrid1(DataGrid1.CurrentRowIndex, 5) = txtMessage.Text

'

'

'works

DataGrid1.Item(DataGrid1.CurrentRowIndex, 5) = txtMessage.Text

'

'

Dim CurrentCell As DataGridCell

CurrentCell = DataGrid1.CurrentCell

'These 2 methods work

DataGrid1(CurrentCell.RowNumber, CurrentCell.ColumnNumber) = txtMessage.Text

'DataGrid1(CurrentCell.RowNumber, 5) = txtMessage.Text

'

bigshop at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...
# 2
All three of these ways are correct.

-mark
Program Manager
microsoft
This post is provided "as-is"

MarkRideout at 2007-9-9 > top of Msdn Tech,Windows Forms,Windows Forms General...