How to set focus to a specific cell in a datagrid

O

Ofer B.

Hi

Is it possible, and how, to set focus to a specific cell in a datagrid?
I have to set the focus to specific cell in a row even if the user press
another cell in the same row

thanks
Ofer
 
J

John Kirk

You mean something like this (from the VS.Net Help)

[Visual Basic]
Private Sub SetCellWithFocus(ByVal myGrid As DataGrid)
' Set the current cell to cell 1, row 1.
myGrid.CurrentCell = New DataGridCell(1,1)
End Sub

[C#]
private void SetCellWithFocus(DataGrid myGrid)
{
// Set the current cell to cell1, row 1.
myGrid.CurrentCell = new DataGridCell(1,1);
}
 
O

Ofer B.

Oops,
Yes, Thanks.

Ofer

John Kirk said:
You mean something like this (from the VS.Net Help)

[Visual Basic]
Private Sub SetCellWithFocus(ByVal myGrid As DataGrid)
' Set the current cell to cell 1, row 1.
myGrid.CurrentCell = New DataGridCell(1,1)
End Sub

[C#]
private void SetCellWithFocus(DataGrid myGrid)
{
// Set the current cell to cell1, row 1.
myGrid.CurrentCell = new DataGridCell(1,1);
}



Ofer B. said:
Hi

Is it possible, and how, to set focus to a specific cell in a datagrid?
I have to set the focus to specific cell in a row even if the user press
another cell in the same row

thanks
Ofer
 

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