Selected in DataGrid

G

Guest

Hi,
I have a read-only DataGrid (just for viewing).
The user can not choose a cell, just a row.
When the user click a cell or type up/down arrow key, the row is selected.
So, how to code this ?

Thanks in advance.
Joachim
 
L

Lars Netzel

Try this, in the Position Changed of the Datasource in the Bindingcontext,
or On CurretnCellChange in the Grid

DataGrid1.Select(DataGrid1.CurrentRowIndex)

/Lars
 
G

Guest

Thanks Lars,

I use CurrentCellChange. It works, but no 100% what I need.
When I click a cell (somewhere in the Grid) or type up/down keyl , the row is selected.
But the cell still active even the row is selected.
Because when I type left/rigth arrow key, the active cell "move" from one to other cell according to the key I typed (left/rigth arrow key).

What I want is : There should no action if I click a cell in the same row, or I type left/rigth arrow key.

Can you tell me what to do ?

Thanks in advance,
Joachim
 

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