This is a migrated thread and some comments may be shown as answers.

Set CurrentCell

3 Answers 124 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Peter Gustafsson
Top achievements
Rank 1
Peter Gustafsson asked on 12 Mar 2010, 08:19 AM
Hi
I'm currently evaluating RadControls for Silverlight (version 2010.1.0309). When I have populated a RadGridView with data I want to immediately begin edit on the cell at then second column on last row. I have managed to automatically scroll the grid to the last row but I haven't been able to set the current cell. Are there any examples available, I haven't found any yet.

Regards
Peter

3 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 17 Mar 2010, 03:21 PM
Hi Peter Gustafsson,

Indeed with the current version of RadGridView, CurrentCell property is read only and cannot be set. We've planned to introduce some improvements related to it, which will make such task extremely easy. Meanwhile you can try code similar to this:

this.radGridView.ScrollIntoViewAsync(this.radGridView.Items[this.radGridView.Items.Count - 1]
                , this.radGridView.Columns[1]
                , (f) =>
                {
                    GridViewRow row = f as GridViewRow;
                    if (row != null)
                    {
                        ((GridViewCell) row.Cells[1]).BeginEdit();
                    }
                });

This code will scroll last item and second column into view and immediately after that will put second cell of the last row in edit mode.

Let me know if this does not help.

Regards,
Nedyalko Nikolov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Nedyalko Nikolov
Telerik team
answered on 17 Mar 2010, 03:28 PM
Hi Peter Gustafsson,

I forgot to mention that this sample code should be called after data is loaded (for example on RadGridView.DataLoaded event).

Kind regards,
Nedyalko Nikolov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Peter Gustafsson
Top achievements
Rank 1
answered on 17 Mar 2010, 03:30 PM
Hi Nedyalko

Thanks for your reply, it works great :-)
Tags
GridView
Asked by
Peter Gustafsson
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Peter Gustafsson
Top achievements
Rank 1
Share this question
or