Hi, there
We are using Infragistics WPF4 version 10.3. And I'm running into this issue that I desparately need some help. Here's the requirement:
this.gridWantListItems.ActiveRecord = gridWantListItems.RecordManager.CurrentAddRecord;
this.gridWantListItems.ActiveCell = gridWantListItems.RecordManager.CurrentAddRecord.Cells[0];
//CellValuePresenter cvp = CellValuePresenter.FromCell(gridWantListItems.ActiveCell);
//cvp.Editor.StartEditMode();
// enter edit mode
this.gridWantListItems.ExecuteCommand(DataPresenterCommands.StartEditMode);
The problem is that the cell does not go into edit mode. The same code executes in grid Loaded event, and the cell was put in edit mode. But here it does't. Notice the commented out line of CellValuePresenter code. If I uncomment that code, I can see cvp is null. Could this be the reason that StartEditMode does not put my cell into edit mode?
Any suggestion on how I can get the cell into edit mode?
Thanks.
Hello rzhu,
I was looking into you requirements and I can suggest you add the following code to the RecordUpdated event of the XamDataGrid:
private void xdg_RecordUpdated(object sender, Infragistics.Windows.DataPresenter.Events.RecordUpdatedEventArgs e)
{
//// enter edit mode
this.xdg.ActiveCell = (xdg.ActiveRecord as DataRecord).Cells[0];
this.xdg.ExecuteCommand(DataPresenterCommands.StartEditMode);
}
This will force the first cell of the new added row automatically to get in edit mode right after the new row is being added. After this initial editing you can use the same event to restrict the cells to became read only, once this user navigates outside the row.
If this doesn’t suit your scenario, could you please provide me with a small sample where the issue you are describing is reproducible, so I can continue investigating this.
I am just checking have you been able to resolve your issue? If you still need any assistance on the matter do not hesitate to ask.
Hello,
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into your post, but it seems like that I am missing something in your scenario, so if this is still an issue for you, could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.
Feel free to write me if you have further questions.
Hello Elena,
your suggestion is very good.
but we are upgrading our whole project 2009.2 to 2012.2 now.
so, since so many existing codes are using the CellValuePresenter.FromRecordAndField method,
we can not apply your workaround now, Is there any different way to solve this issue without fix my code?