hi,
I have create a rad panel as below and for the RadPanelBar with the ID "rpbIncludeSections" items are added dynamically.
The components added dynimacally is as follows
This part works fine the issue comes when the button "btnSavePublish" OnClick method i need to find out whether the check box is checked or not.
For this id some thing like
Through the Items attribute i am able to find the added panels. I.e since i have added 2 panels i would be able to access them
But, there is no way for me to access the added checkbox. I tried with the "Controls" attribute as well but it gave no luck.
Thanks Regards,
Savidu
I have create a rad panel as below and for the RadPanelBar with the ID "rpbIncludeSections" items are added dynamically.
<telerik:RadPanelBar runat="server" ID="rpbResumeSections" Width="300px" GridLines="Horizontal" > <Items> <telerik:RadPanelItem ID="rpiResumeSections" runat="server" PreventCollapse="false" Expanded="true" > <Items> <telerik:RadPanelItem ID="rpbResumeSectionInfo" runat="server" > <HeaderTemplate> <div style="margin: 10px;"> <telerik:RadComboBox runat="server" ID="rcbTemplates" Width="250px" AutoPostBack="true" OnSelectedIndexChanged="rcbTemplates_OnSelectedIndexChanged"></telerik:RadComboBox> </div> </HeaderTemplate> <ItemTemplate> <!--Dynamically generate a rad panel bar --> <div style="margin: 10px;max-height: 200px; overflow:auto;"> <telerik:RadPanelBar runat="server" ID="rpbIncludeSections" GridLines="Horizontal" ExpandMode="MultipleExpandedItems" > </telerik:RadPanelBar> </div> <div style="margin:10px;margin-top: 30px; text-align:right;"> <telerik:RadButton ID="btnPreview" runat="server" OnClick="btnPreview_OnClick"></telerik:RadButton> <telerik:RadButton ID="btnSavePublish" runat="server" OnClick="btnSavePublish_OnClick"></telerik:RadButton> <telerik:RadButton ID="btnPrintCV" runat="server" OnClick="btnPrintCV_OnClick"></telerik:RadButton> </div> </ItemTemplate> </telerik:RadPanelItem> </Items> </telerik:RadPanelItem> </Items> </telerik:RadPanelBar>The components added dynimacally is as follows
RadPanelBar _rpbIncludeSections = (RadPanelBar)rpbResumeSectionInfo.FindControl("rpbIncludeSections"); if (_personID != 0) { DataSet _Sections = _cvController.GetSectionsFromCVTemplateIDPersonID(int.Parse(e.Value), _personID); _rpbIncludeSections.Items.Clear(); foreach (DataRow _drSection in _Sections.Tables[0].Rows) { bool _checked = false; if ((_drSection["Include"].ToString() != "" && bool.Parse(_drSection["Include"].ToString()) == true) || _drSection["Persons_PersonID"].ToString() == "") _checked = true; RadPanelItem _panelItemLvl1 = new RadPanelItem(); _panelItemLvl1.Text = _drSection["CV_Section"].ToString(); _panelItemLvl1.Selected = true; RadPanelItem _panelItemLvl2 = new RadPanelItem(); CheckBox _checkBox = new CheckBox(); _checkBox.ID = "Savidu"; _checkBox.Checked = _checked; _checkBox.Text = Localization.GetString("Include.Text", this.LocalResourceFile); _checkBox.ToolTip = "Check to Include in ude in CV"; _checkBox.CssClass = "MarginLeft"; _panelItemLvl2.Controls.Add(_checkBox); _panelItemLvl1.Items.Add(_panelItemLvl2); _rpbIncludeSections.Items.Add(_panelItemLvl1); } }This part works fine the issue comes when the button "btnSavePublish" OnClick method i need to find out whether the check box is checked or not.
For this id some thing like
RadPanelBar _rpbIncludeSections = (RadPanelBar)rpbResumeSectionInfo.FindControl("rpbIncludeSections");Through the Items attribute i am able to find the added panels. I.e since i have added 2 panels i would be able to access them
_rpbIncludeSections.Items[0].Items[0]But, there is no way for me to access the added checkbox. I tried with the "Controls" attribute as well but it gave no luck.
Thanks Regards,
Savidu