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

DataBinding inside of the radGrid control

2 Answers 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Han
Top achievements
Rank 1
Han asked on 15 Sep 2008, 06:40 PM
Currently, I have checkbox column inside of a radgrid control, and I bind the "Bool", which does not exist to the database. I am wondering does it auto-bind to the batabase and if so, how can I access to it?

<

EditItemTemplate>

<asp:CheckBox ID="chk1" runat="server" Checked='<%# Bind("Bool") %>'>

</asp:CheckBox>

</EditItemTemplate>

<ItemTemplate>

<asp:CheckBox ID="chk2" runat="server"></asp:CheckBox>

</ItemTemplate>

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Sep 2008, 04:51 AM
Hi Han,

In order to bind the controls inside the template, you must use a data binding expression on the appropriate control property. Bind method is used for two way databinding (using a datasource in which you want to perform update,insert etc). CheckBox residing inside the ItemTemplate/EditItemTemplate of a GridTemplateColumn must be bound to a boolean field existing in the DataBase. You can also consider using a GridCheckBox column instead of GridTemplateColumn

Go through the following help article to get more details about the column types in RadGrid.
Column types


Regards
Shinu.
0
Han
Top achievements
Rank 1
answered on 17 Sep 2008, 09:00 PM
Hi Shinu, it is solved.

Thanks
Tags
Grid
Asked by
Han
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Han
Top achievements
Rank 1
Share this question
or