Is it possible to Enter editmode to a list box in Grid without double click on the cell?
I开发者_StackOverflow was following the example in the following link to try out listbox in the grid http://forums.silverlight.net/forums/t/53435.aspx it works except that, I need to double click on the cell to enter to edit mode which then switch to listbox. Is there any other way I can enable list box on getting focus? Thanks,
The is a very simple way to enter a cell in edit mode without using your mouse. First, you need to get the row in which you have the cell. Then you get the cell, then you change the edit mode to True. If you don't have the row, you can find it by using ItemContainerGenerator on the grid with the business object used in that row (from your ItemSource collection). Here is an example of code :
GridViewRow myRow = MyGrid.ItemContainerGenerator.ContainerFromItem(YourBusinessObject);
GridViewCell myCell = myRow.Cells(YourCellIndex);
myCell.IsInEditMode = True;
Hope this help !
精彩评论