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

Select GridViewCell

7 Answers 100 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Christopher Pozza
Top achievements
Rank 1
Christopher Pozza asked on 02 Dec 2009, 06:55 PM
How do I select a new row, column[0] when I add it to my grid in code?

 

private void Button_Add_Items_Click(object sender, RoutedEventArgs e)

 

{

 

    Item item = new Item();

 

    i.ItemList.Add(item);

    rgvItems.SelectedItem = rgvItems.Items[rgvItems.Items.Count -1];

    rgvItems.ScrollIntoView(rgvItems.SelectedItem);

 


    //rgvItems.BeginEdit();

 

}



The BeginEdit takes me to the first row and column.

Thanks!

7 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 03 Dec 2009, 08:34 AM
Hi,

You can use BeginInsert() instead. I've attached an example to illustrate you this.

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Christopher Pozza
Top achievements
Rank 1
answered on 03 Dec 2009, 02:21 PM
This works great for the version that you attached: 2009.3.1120.35.  However I am trying to get it working with the current production release: 2009.3.1103.35.  When I change your attached project to this release, I can only add one item and the binding does not work properly (because of the empty get;set; you need a backing store).

Is there a way to do this in the current version: 2009.3.1103.35?

Thanks!
0
Vlad
Telerik team
answered on 03 Dec 2009, 03:31 PM
Hello Chris,

We had a bug in the official release which is fixed in the latest internal build and next week we will release our first service pack. If you do not want to use latest internal build you can wait for the official service pack.

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Scott Christian
Top achievements
Rank 1
answered on 05 Jan 2010, 05:47 PM
I ran the example and it set the new row as the current row but does not selected it. what would be the best way to selected the new row. I tried the example with 2009.3.1208.35 version
0
Vlad
Telerik team
answered on 06 Jan 2010, 08:27 AM
Hi Scott ,

I've attached an example to illustrate you how to achieve this.

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Scott Christian
Top achievements
Rank 1
answered on 06 Jan 2010, 05:54 PM
Will selecting the new item on an add will ever be a feature of the grid?

Thanks 
Scott
0
Milan
Telerik team
answered on 08 Jan 2010, 10:09 AM
Hello Scott Christian,

We will consider adding this feature to the grid. Thank you for your feedback.


Kind regards,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Christopher Pozza
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Christopher Pozza
Top achievements
Rank 1
Scott Christian
Top achievements
Rank 1
Milan
Telerik team
Share this question
or