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

Expand row in code after inserting

3 Answers 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
todor todor
Top achievements
Rank 1
todor todor asked on 28 Jan 2010, 10:11 AM
Hi ,

 I'm using Ajax RadGrid with NestedViewTamplates. So when I insert a row into master table, after inserting I would like to expand the inserted row,  and work with content in nestedview template
And second question is how I can put inserted row at top of table, right now it goes botoom

Thank you for your answer


3 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 29 Jan 2010, 12:54 PM
Hello Todor,

1. Concerning your first question - attach an event handler to the OnPreRender event of the page, iterate the grid's Items collection locating the newly inserted item by its data key value and set the item's Expanded property to true.

2. As for displaying the newly-inserted item at the top - you need to set InsertItemDisplay="Top" for the MasterTableView.

I hope this helps.

Regards,
Tsvetoslav
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
Parimal
Top achievements
Rank 1
answered on 28 Jul 2010, 11:18 PM
Hi

After adding row into master table how can expand the row ? so its easy for user to add child record rather than do one more click to expand?
As per your previous answer do you have any example to iterate the grid's items collection to locate newly inserted item by data key value?
0
Shinu
Top achievements
Rank 2
answered on 29 Jul 2010, 08:18 AM
Hello Parimal,


I hope the following code library will shed some light on how to accomplish this.
Select Last Inserted Row

Set the Expanded property of GridItem (instead of Selected), to get the item expanded.


-Shinu.
Tags
Grid
Asked by
todor todor
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Parimal
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or