Edit mode Programmaticaly.

Paul

I have a processs that will add a row to my RadTreeListView hierarchichal data source.
If I have a reference to the item I added, how do I scroll the item into view and force the first cell of its row into edit mode ?...

Vlad

You can use ScrollIntoView/ScrollIntoViewAsync methods to scroll into view particular item and if set this item as CurrentItem you can call BeginEdit() to achieve your goal with first cell editing.

Best wishes,
Vlad
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward!
We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Paul

This works... almost... We are adding the new row from a right-click context menu and everything works fine as per your suggestions...

however...

The final problem is this; if the user was previously editing another row and they were in column 6 when they right clicked and added a new item, the "BeginEdit" call on the new item causes them to go to column 6 of the new row.

The desired functionality is always to edit the specific column 0 of the newly added row and not to drop into the column they previosuly had in focus - can we do this - is there some kind of "CurrentColumn" value ?...

Many thanks - Paul.

Nedyalko Nikolov

Indeed there is such property, which you could use. Just set CurrentColumn before BeginEdit(). Another approach is to call BeginEdit() method on the desired GridViewCell object. I'm pasting a code snippet for a reference:

this.radGridView.ScrollIntoViewAsync(dataItem, (f) =>

{

GridViewRow row = f asGridViewRow;

if(f != null)

{

((GridViewCell) f.Cells[0]).BeginEdit();

}

});

Kind regards,
Nedyalko Nikolov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward!
We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.