Hi
I tried to hide and unhide columns with different option but nothing looks working with RadGrid.
1. I have a dropdown- checkbox with Column names,whose values I am storing in hashtable on button click.
Now after the BindGrid() method executed it is going to ColumnCreated event and executing as expected.
But column hide and unhide is not happening.
Thanks in Advance
RamC
I tried to hide and unhide columns with different option but nothing looks working with RadGrid.
1. I have a dropdown- checkbox with Column names,whose values I am storing in hashtable on button click.
protected void btnChooseColumns_Clicked(object sender, EventArgs e)
{
ht = new Hashtable();
foreach (RadComboBoxItem item in rcColumnChooser.Items)
{
CheckBox checkBox = (CheckBox)item.FindControl("CheckBox");
ht.Add(item.Text, checkBox.Checked);
}
BindGrid();
}
Now after the BindGrid() method executed it is going to ColumnCreated event and executing as expected.
protected void rgCatalogs_ColumnCreated(object sender, Telerik.Web.UI.GridColumnCreatedEventArgs e)
{
if (ht != null)
{
if (ht.Contains(e.Column.HeaderText.ToUpper()))
{
GridBoundColumn boundColumn = e.Column as GridBoundColumn;
e.Column.Visible = (bool)ht[e.Column.HeaderText];
}
}
}
But column hide and unhide is not happening.
Thanks in Advance
RamC