<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
<telerik:RadWindow
ID="rwManageCategories"
runat="server"
Title="Manage Categories"
Height="400px"
Width="600px"
Left="150px"
ReloadOnShow="true"
ShowContentDuringLoad="false"
Modal="true"
Behaviors="None"
KeepInScreenBounds="True"
VisibleStatusbar="False"
>
<ContentTemplate>
<asp:Label ID="lblRulesetCategories" runat="server"></asp:Label><br /><br />
<asp:Label ID="lblErrorRulesetCategories" ForeColor="Red" runat="server"></asp:Label>
<asp:Repeater ID="rptrRulesetCategories" runat="server">
<ItemTemplate>
<asp:CheckBox id="cbRulesetCategorySelected" Checked='<%# Eval("IsSelected") %>' runat="server"></asp:CheckBox>
<asp:HiddenField ID="hdnCategoryId" Value='<%# Eval("CategoryId") %>' runat="server" />
<asp:Label ID="lblRulesetCategoryName" Text='<%# Eval("Name") %>' runat="server"></asp:Label>
<asp:TextBox ID="tbRulesetCategorySequence" Text='<%# Eval("Sequence") %>' runat="server"></asp:TextBox>
<asp:CompareValidator ID="cvRulesetCategorySequence" ControlToValidate="tbRulesetCategorySequence" Operator="DataTypeCheck" Type="Integer" Text="* Invalid" Display="Dynamic" runat="server"></asp:CompareValidator>
<br />
</ItemTemplate>
</asp:Repeater>
<br />
<br />
<asp:Button ID="btnManageCategoriesSave" Text="Save" OnClick="btnManageCategoriesSave_Click" runat="server" />
<asp:Button ID="btnManageCategoriesCancel" Text="Cancel" OnClick="btnManageCategoriesCancel_Click" runat="server" />
</ContentTemplate>
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
protected void btnManageCategoriesSave_Click(object sender, EventArgs e)
{
// Get collection of checked ruleset categories in repeater
var checkedCategoryIDs = from ri in this.rptrRulesetCategories.Items.Cast<RepeaterItem>()
let hdnCategoryId = (HiddenField)ri.FindControl("hdnCategoryId")
let cbRulesetCategorySelected = (CheckBox) ri.FindControl("cbRulesetCategorySelected")
let tbRulesetCategorySequence = (TextBox)ri.FindControl("tbRulesetCategorySequence")
select new
{
CategoryId = Convert.ToInt32(hdnCategoryId.Value),
Checked = cbRulesetCategorySelected.Checked,
Sequence = tbRulesetCategorySequence.Text == "" ? null : tbRulesetCategorySequence.Text
};