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

[Solved] FormTemplate Databinding

1 Answer 145 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Liam
Top achievements
Rank 1
Liam asked on 19 May 2008, 05:48 AM

Hi,

I am currently using the ajax radgrid(2008.1.415.20) for displaying data on one of my usercontrols.
I use a light weight object for populating the grid as the full business object would take too long to load, however when I wish to view or edit the specific details of a grid item I need to load this “full” object from the database and then populate the FormTemplate within the grid.

I have the following problems:

1)It appears that this FormTemplate can only be populated using the object that was loaded for populating the grid(i.e. the “light weight” object), is there no method that can be used to intercept what the FormTempate is going to bind to, because I really only want to use some of the “light weight” objects properties to do a query on the database to get the full business object to populate the FormTemplate.

2) I also need to implement some logic while populating FormTemplate. In this case I want to have access to all controls, located on a FormTemplate from a one particular method rather then trying to spread this logic between databound events of these controls. I tried to use ItemDataBaund event of the grid, but it doesn’t allow to access  FormTemplate content (because it is obviously used for different purposes). Subscribing on OnItemCommand event also doesn’t give any effect due to the same reason (actually it occurs even before ItemDataBound). As an option I can subscribe to OnDataBound event for some control, located within a form view and then access other sibling controls using Control.Parent property, but it seems to me that it is not the best solution for such advanced and powerful grid control. Isn’t it? ?

3) Also is the FormTemplate only used for editing/inserting or can it be used for viewing objects? I would appreciate if somebody give me some good example of how to use FormTemplate  for Editing/Inserting/Viewing data.

Any help would be greatly appreciated.

Liam Brennan.

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 19 May 2008, 07:20 AM
Hi Liam,

Go through the following demo link.
Form template edit form

You can also go through the following help document links.

Updating values using UserControl/FormTemplate
Inserting values using UserControl/FormTemplate

Princy.
Tags
Grid
Asked by
Liam
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or