Hi Every one,
I am trying to expand the list of the rows on click of the checkbox which is in the TreelistTempelatecolumn.I am not able to maintain the state of the variables.Can anyone help me please.
This is what I am doing
<telerik:RadPanelItem Value="CandidateInformation" runat="server">
<ItemTemplate>
<telerik:RadTreeList ID="rtlSpecsGroup" Width="40%" runat="server" DataSourceID="sdsTreeView"
ParentDataKeyNames="PARENTID" AllowSorting="true" DataKeyNames="CATGROUPID" AllowMultiItemSelection="false"
AutoGenerateColumns="false" OnItemDataBound="OnItemDataBound_rtlSpecsGroup" >
<Columns>
<telerik:TreeListTemplateColumn UniqueName="chkTempelatecolumn" DataField="CATGROUPID" ItemStyle-Width="30px" HeaderStyle-Width="30px">
<ItemTemplate>
<asp:CheckBox ID="chkGroups" runat="server" AutoPostBack="True" OnCheckedChanged="OnCheckedChanged_chkGroups"/>
</ItemTemplate>
</telerik:TreeListTemplateColumn>
<telerik:TreeListBoundColumn UniqueName="NAME" HeaderText="Experience" DataField="NAME" ReadOnly="true"></telerik:TreeListBoundColumn>
<telerik:TreeListTemplateColumn UniqueName="rblTempelatecolumn" HeaderText="YearsOfExperience">
<ItemTemplate>
<asp:RadioButtonList ID="rblYearsOfExp" runat="server" Enabled="false" RepeatDirection="Horizontal" RepeatLayout="Flow">
<asp:ListItem Text="0-5" Value="1"></asp:ListItem>
<asp:ListItem Text="6-10" Value="2"></asp:ListItem>
<asp:ListItem Text="11-15" Value="3"></asp:ListItem>
<asp:ListItem Text="16-20" Value="4"></asp:ListItem>
<asp:ListItem Text="20+" Value="5"></asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</telerik:TreeListTemplateColumn>
<telerik:TreeListBoundColumn UniqueName="CATGROUPID" DataField="CATGROUPID" Visible="false" ReadOnly="true"></telerik:TreeListBoundColumn>
</Columns>
</telerik:RadTreeList>
<telerik:RadButton ID="rbtnCINext" runat="server" Text="Next>>" OnClick="rbtnCINext_OnClick">
</telerik:RadButton>
</ItemTemplate>
</telerik:RadPanelItem>
on the code side this is what i am doing
protected void OnCheckedChanged_chkGroups(object sender, EventArgs e)
{
RadPanelItem CandidateInformation = rpbMainInfo.FindItemByValue("CandidateInformation");
RadTreeList rtlSpecsGroup = (RadTreeList)CandidateInformation.FindControl("rtlSpecsGroup");
((sender as CheckBox).NamingContainer as TreeListDataItem).Selected = (sender as CheckBox).Checked;
foreach (TreeListDataItem tlTreeName in rtlSpecsGroup.Items)
{
string ParentId = tlTreeName["CATGROUPID"].Text;
RadioButtonList rbtnlist = (RadioButtonList)tlTreeName.FindControl("rblYearsOfExp");
if ((sender as CheckBox).Checked == true)
{
if (tlTreeName.Selected == true)
{
if (ParentId == "1" || ParentId == "2" || ParentId == "3" || ParentId == "4")
{
tlTreeName.Expanded = true;
}
}
}
}
}
what I am doing is On click of the check box I am trying to expand the parent item and also make the row selected.this part is working but the checkbox which I checked doesn't maintain.It returns the selected column with unchecked check box column.Itried with different styles but did not work out for me .Please let me know the best solution for the above problem
Thanks InAdvance,
Sravz
I am trying to expand the list of the rows on click of the checkbox which is in the TreelistTempelatecolumn.I am not able to maintain the state of the variables.Can anyone help me please.
This is what I am doing
<telerik:RadPanelItem Value="CandidateInformation" runat="server">
<ItemTemplate>
<telerik:RadTreeList ID="rtlSpecsGroup" Width="40%" runat="server" DataSourceID="sdsTreeView"
ParentDataKeyNames="PARENTID" AllowSorting="true" DataKeyNames="CATGROUPID" AllowMultiItemSelection="false"
AutoGenerateColumns="false" OnItemDataBound="OnItemDataBound_rtlSpecsGroup" >
<Columns>
<telerik:TreeListTemplateColumn UniqueName="chkTempelatecolumn" DataField="CATGROUPID" ItemStyle-Width="30px" HeaderStyle-Width="30px">
<ItemTemplate>
<asp:CheckBox ID="chkGroups" runat="server" AutoPostBack="True" OnCheckedChanged="OnCheckedChanged_chkGroups"/>
</ItemTemplate>
</telerik:TreeListTemplateColumn>
<telerik:TreeListBoundColumn UniqueName="NAME" HeaderText="Experience" DataField="NAME" ReadOnly="true"></telerik:TreeListBoundColumn>
<telerik:TreeListTemplateColumn UniqueName="rblTempelatecolumn" HeaderText="YearsOfExperience">
<ItemTemplate>
<asp:RadioButtonList ID="rblYearsOfExp" runat="server" Enabled="false" RepeatDirection="Horizontal" RepeatLayout="Flow">
<asp:ListItem Text="0-5" Value="1"></asp:ListItem>
<asp:ListItem Text="6-10" Value="2"></asp:ListItem>
<asp:ListItem Text="11-15" Value="3"></asp:ListItem>
<asp:ListItem Text="16-20" Value="4"></asp:ListItem>
<asp:ListItem Text="20+" Value="5"></asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</telerik:TreeListTemplateColumn>
<telerik:TreeListBoundColumn UniqueName="CATGROUPID" DataField="CATGROUPID" Visible="false" ReadOnly="true"></telerik:TreeListBoundColumn>
</Columns>
</telerik:RadTreeList>
<telerik:RadButton ID="rbtnCINext" runat="server" Text="Next>>" OnClick="rbtnCINext_OnClick">
</telerik:RadButton>
</ItemTemplate>
</telerik:RadPanelItem>
on the code side this is what i am doing
protected void OnCheckedChanged_chkGroups(object sender, EventArgs e)
{
RadPanelItem CandidateInformation = rpbMainInfo.FindItemByValue("CandidateInformation");
RadTreeList rtlSpecsGroup = (RadTreeList)CandidateInformation.FindControl("rtlSpecsGroup");
((sender as CheckBox).NamingContainer as TreeListDataItem).Selected = (sender as CheckBox).Checked;
foreach (TreeListDataItem tlTreeName in rtlSpecsGroup.Items)
{
string ParentId = tlTreeName["CATGROUPID"].Text;
RadioButtonList rbtnlist = (RadioButtonList)tlTreeName.FindControl("rblYearsOfExp");
if ((sender as CheckBox).Checked == true)
{
if (tlTreeName.Selected == true)
{
if (ParentId == "1" || ParentId == "2" || ParentId == "3" || ParentId == "4")
{
tlTreeName.Expanded = true;
}
}
}
}
}
what I am doing is On click of the check box I am trying to expand the parent item and also make the row selected.this part is working but the checkbox which I checked doesn't maintain.It returns the selected column with unchecked check box column.Itried with different styles but did not work out for me .Please let me know the best solution for the above problem
Thanks InAdvance,
Sravz