views:

313

answers:

1

I need to allow users on mouse click in DataGrid to edit whole row? Right now users must double click on cell to enter it in edit mode and I want to make all cells of a selected row to be in edit mode. I need to do this in code.

I was trying to call BeginEdit on Grid's MouseLeftButtonUp but it didn't work.

A: 

I don't know of any way to put the entire row into edit mode with the DataGrid that comes with Silverlight.

When you have a cell that is NOT marked readonly, you can double click the cell to enter edit mode, then press tab to get to the next cell and it too will be in edit mode. You can then continue pressing tab to go to the next row and the cells will remain in edit mode. Pressing F2 when your focus is in a cell will put the cell into edit mode. The cursor keys allow you to navigate cells and rows. This is pretty close to what you are asking.

Perhaps one of the 3rd party grids may support this functionality.

EDIT

Here is another discussion on How can I put a Silverlight 3 DataGridCell into edit mode in code? maybe it's conclusion will be of some help or the answer to How do I Immediately Validate a Newly Inserted Row in a Silverlight 3 Datagrid? might work for you.

DaveB
maybe I didn't state it too clear - I need do this in code
sha1dy
and this is not for me, but for my users - they expect to put the whole row in edit mode, and not clicking cells and pressing keys
sha1dy
I am sorry that my answer wasn't what you were looking for. How do your users expect to navigate from cell to cell and row to row without pressing any keys? I have found that the default Silverlight DataGrid to have OK navigation. Reminds me of a spreadsheet app. Good luck in your quest to find your desired behavior.
DaveB
I have added a couple of links on SO to my answer.
DaveB