Hi
I would like my Xamgrid to behave like excel when my xamgrid is in edit mode.
1. Clicking on a cell should immediately allow users to edit - This is doable using IsOnCellActiveEditingEnabled
2. I also want to be able to edit some value in a cell and then when user clicks on down arrow or enter the focus should move on to the same column in the next row (Like excel)
Thanks,
Ranjith
Hello Ranjith,
Thank you for your post.
Regarding your first point, I would recommend using IsOnCellActiveEditingEnabled = "true." You can also use the IsMouseActionEditingEnabled property by setting it to "Single."
For your second point, you can achieve this by handling the PreviewKeyDown event on the XamGrid. Using the event arguments of the handler, you can check if e.Key is Key.Enter or Key.Down. If it is, call myXamGrid.ExitEditMode() to end edit mode on the current cell. Then, you can get that cell using myXamGrid.ActiveCell. From the cell, you can get the column and row that it is contained in using the Column and Row properties. From the row, you can get the index of the row that the cell sits in.
Once you have the index of the row, you can get the cell in the next row of the same column using grid.Rows[index + 1].Cells[column]. Then, you can call grid.EnterEditMode, using that cell as the parameters for that method. Then, mark the event as handled.
I have attached a sample application to demonstrate the above.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Just checking in, did you have any other questions or concerns on this matter?
Hi Andrew,
Do you have a XamGrid sample application that shows how we can implement fill down of a cell value just like excel ?
Koshy