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

RadGrid: Binding to fields in User Control

1 Answer 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
darenkov
Top achievements
Rank 1
darenkov asked on 01 Oct 2009, 02:41 PM
I have been looking at the example of the RadGrid editing with a UserControl. I am not sure how to bind the values to the UserControl fields. Is this done automatically some how? How are the values passed across to to do the initial bind when the row is selected in the grid?

I notice that there is some code like this but I don't understand how it is getting used to do the binding:

public object DataItem 
        { 
            get 
            { 
                return this._dataItem; 
            } 
            set 
            { 
                this._dataItem = value
            } 
        } 

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 05 Oct 2009, 03:17 PM
Hi darenkov,

using Eval() and Bind() expression on the ascx markup, you can specify that a control value binds to a specific data field from the binding container's data source. From the code-behind, you can use DataBinder.Eval()

For more info:

http://msdn.microsoft.com/en-us/library/bda9bbfx%28VS.71%29.aspx

http://support.microsoft.com/kb/307860

All the best,
Veli
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
Grid
Asked by
darenkov
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or