PDA

View Full Version : Hide the grid coloum Based on Button Click



Dinesh.T
Nov 17, 2009, 4:03 AM
Hi All,

I want to hide the grid coloum Based on comboselection.


I can try these for combo selection event
<U>In aspx page
</U>




<ext:ComboBox ID="cmbArea" runat="server" Width="115" >


<Items >


<ext:ListItem Text="aa" Value="aa" />


</Items>


<AjaxEvents >


<Select OnEvent="cmbArea_Click" />


</AjaxEvents>


</ext:ComboBox>


<U>In Cs file:-


</U>


protected void cmbArea_Click(object sender, AjaxEventArgs e)


{


if (cmbArea.SelectedItem.Text == "aa")


{


ExitGateDetGrid.ColumnModel.Columns[2].Hidden = true;


}


}
<U>

</U> But it will not woork.(i.e column 3 will not be hidden)

So plz help me for hiding the grid column based on button or(Checkbox selection) click.

Thanks in Advance.

Vladimir
Nov 17, 2009, 4:55 AM
Hi,

Please use ColumnModel functions, for example, SetHidden