Link to home
Start Free TrialLog in
Avatar of tbailey922
tbailey922

asked on

C# dataGrid Help!!

I have a datagrid windows app in C#.  I want to click a button and highlight a specific cell.  Is there a way to do this?

 Or another alternative would be to set focus to the first row in the datagrid.  Not just select and highlight but actually set focus to it.

The problem I am having is when a user clicks on a cell in the grid(which hightlights the cell) and they click UPDATE. After it is finished updating, the cell they clicked in is grayed out and is always there.  Even if they scroll up and down, that particular cell follows them.  Very weird!  Any help would be appreciated.

Thanks
Tim
Avatar of YZlat
YZlat
Flag of United States of America image

you can use DataGrid.Select() method to select the whole row, but I'm not sure it's possible to select only one cell
Avatar of tbailey922
tbailey922

ASKER

That will hightlight the whole row.  Say if you are on row 5 and you use DataGrid.Select(0), that will highlight the 1 st row but the little arrow on the right of the grid still says it is at row 5.  I need to move the cursor to row 1.


ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial