datagrid Get "F3" function

A

Agnes

My purpose is When the user press "F3" in specified column, i need to put
specified data in that column
Now, I can get "F3" by using [Protected Overrides Function
ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As
System.Windows.Forms.Keys) As Boolean ]

BUT I don't know how to put the data in that textbox,
I try Dim xx As DataRow =
dtInvCharges.Rows(dgInvCharges.CurrentRowIndex)
xx.Item("remark") = "F3 Command process"

it returns error.
Anybody got some idea ? Thanks a lot
 
K

Ken Tucker [MVP]

Hi,

DataGrid1.Item(DataGrid1.CurrentCell) = "Test"



Ken

------------------------

My purpose is When the user press "F3" in specified column, i need to put
specified data in that column
Now, I can get "F3" by using [Protected Overrides Function
ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As
System.Windows.Forms.Keys) As Boolean ]

BUT I don't know how to put the data in that textbox,
I try Dim xx As DataRow =
dtInvCharges.Rows(dgInvCharges.CurrentRowIndex)
xx.Item("remark") = "F3 Command process"

it returns error.
Anybody got some idea ? Thanks a lot
 
A

Agnes

Ken, It doesn't work ar.
Do I need to declare something first ?
dim xx as datarow = ctype( DataGrid1.Item(DataGrid1.CurrentCell),datarow) ??
xx.item("remark") = "Test"
 
A

Agnes

I solve my stupid problem
dgInvCharges.Item(dgInvCharges.CurrentCell.RowNumber, 2) =
Me.objChgResult.pchgName

Agnes said:
Ken, It doesn't work ar.
Do I need to declare something first ?
dim xx as datarow = ctype( DataGrid1.Item(DataGrid1.CurrentCell),datarow) ??
xx.item("remark") = "Test"
Ken Tucker said:
Hi,

DataGrid1.Item(DataGrid1.CurrentCell) = "Test"



Ken

------------------------

My purpose is When the user press "F3" in specified column, i need to put
specified data in that column
Now, I can get "F3" by using [Protected Overrides Function
ProcessCmdKey(ByRef msg As System.Windows.Forms.Message, ByVal keyData As
System.Windows.Forms.Keys) As Boolean ]

BUT I don't know how to put the data in that textbox,
I try Dim xx As DataRow =
dtInvCharges.Rows(dgInvCharges.CurrentRowIndex)
xx.Item("remark") = "F3 Command process"

it returns error.
Anybody got some idea ? Thanks a lot
 

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