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

Populating with Data through a Bindinglist

3 Answers 41 Views
GridView
This is a migrated thread and some comments may be shown as answers.
tom
Top achievements
Rank 1
tom asked on 15 Jul 2011, 03:40 PM
My Problem is that I have to programatically fillup a GridView or Listview which has a Bindlist as datasource.
For now it works, but the GUI object is refreshing and scrolling to the last added row and selecting it.
How can I  stay in place for example the first row? Does this work also if the cell is edited?

3 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 20 Jul 2011, 05:08 PM
Hello Webdev,

You can use the SelectLastAddedRow property of the MasterTemplate to support this functionality in RadGridView control:

this.radGridView1.MasterTemplate.SelectLastAddedRow = false;

The RadListView control does not have this property. The other solution for both controls is to set the current row/item manually after the new item is added. Do not hesitate to contact us if you have further questions or issues.

Greetings,
Julian Benkov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
tom
Top achievements
Rank 1
answered on 21 Jul 2011, 10:20 AM
Hello Julian,

thank you for you answer. I have forgotten looking for the properties of the MasterTemplate. So this works fine for the RadGridView.

Do you have a solution for the RadListView? Would it work to encapsulate the adding of the row in an beginupdate and endupdate?

Greetings,
Tom
0
Ivan Todorov
Telerik team
answered on 26 Jul 2011, 12:52 PM
Hello Tom,

Yes, encapsulating the Add operation with begin/end update should work. Please try the following code snippet:
this.radListView1.ListViewElement.ListSource.BeginUpdate();
dataSource.Add("item");
this.radListView1.ListViewElement.ListSource.EndUpdate();

Hope this helps. Feel free to ask if you have additional questions.

Kind regards,
Ivan Todorov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
GridView
Asked by
tom
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
tom
Top achievements
Rank 1
Ivan Todorov
Telerik team
Share this question
or