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

[Solved] How to make my custom edit mechanism

1 Answer 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jocelyn
Top achievements
Rank 1
Jocelyn asked on 03 Apr 2014, 01:31 PM
Hi,

I have a RadGrid using the NeedDataSource event. The problem is that when I enter in EditMode, the entire grid is rebinded and I don't want to keep data in ViewState or Session variable, so on each edit/cancel edit the grid is rebinded.

I am keeping my primary key in the DataKeyValues, so is it possible to not rebind the grid on edit so I can create my own Object by passing the primary key.

I could use a NestedViewTemplate that have a UserControl that I can pass the primary key value and then I could manually bind this usercontrol with a custom object.
But the NestedViewTemplate also rebind the grid on ExpandColumn.

Any solutions?

Jocelyn

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 08 Apr 2014, 11:24 AM
Hello,

The grid requires to be rebinded when entering/canceling edit mode, in the NeedDataSource event you decide how to retrieve the data for the control, you can make a query to a database or store information in a session variable but you have to pass the data in the NeedDataSource event so the grid can properly create its data items. The information about the data items of the controls is not persisted in ViewState or anywhere else that's why the control requires rebind after postback to recreate its items as expected.

Regards,
Marin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Jocelyn
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or