Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
I have a toggle button in a grid and would like to set its initial setting dependant on a Boolean in the database. Is there a way to bind it or set it via code.
Thanks
<
telerik:GridTemplateColumn
UniqueName
=
"ToggleButton"
>
ItemTemplate
telerik:RadButton
ID
"btnToggle"
runat
"server"
ToggleType
"CheckBox"
ButtonType
</
protected
void
grdEmail_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
GridDataItem item = (GridDataItem)e.Item; RadButton rdBtn = (RadButton)item.FindControl(
);
DataRowView row = (DataRowView)e.Item.DataItem;
//accessing the value from data rowview
rdBtn.Checked =Convert.ToBoolean(row[
"bool"
]);
}