We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Hiding columns dynamically, depending on row bieng clicked.

Hi,

I am using DGBG Tree Lines Grid.

Is it possible to hide specific columns in the grid, depending, which row has been clicked or selected.

Could you please append any sample code if exist.


1 Reply

AD Administrator Syncfusion Team April 17, 2008 03:15 PM UTC

Hi Raul,

Thanks for the interest in Syncfusion prodcuts.

You can handle CellClick Event and check for a particular RowIndex and Hide the Column using HideCols properties. Please refer the following code snippet that shows how you can hide columns when a Row is clicked.



private void gridDataBoundGrid1_CellClick(object sender, GridCellClickEventArgs e)
{
if (e.RowIndex == 9)
{
this.gridDataBoundGrid1.Model.HideCols[1] = true;
this.gridDataBoundGrid1.Model.HideCols[4] = true;
}
}



Please refer the sample in the below link that illustrates the above.

http://websamples.syncfusion.com/samples/Grid.Windows/F72971/main.htm


Please let me know if you have any questions.

Regards,
Asem.



Loader.
Live Chat Icon For mobile
Up arrow icon