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

Hidging a column in a grid list control

So I can''t find the property to hide a column in my grid list control. I try Me.gridFavoris.Cols.Hidden() or Me.gridFavoris.ColStyles(COL_PROJET)... I wish that you''ll be able to help me !! thanks

6 Replies

MA Marie-Eve July 8, 2005 01:00 PM UTC

I forgot to specify that my grid list control is into a grid control same like the comboboxCells exemple in the Essential Grid Samples. So I want to acess to my grid list control who are in a cell !!!


AD Administrator Syncfusion Team July 8, 2005 01:58 PM UTC

Try code like this to see if it does what you need. GridDropDownGridListControlCellRenderer cr = (GridDropDownGridListControlCellRenderer) this.gridControl1.CellRenderers["GridListControl"]; cr.ListControlPart.Grid.Cols.Hidden[2] = true; //hide column 2....


MA Marie-Eve July 11, 2005 04:10 PM UTC

I tried that code and it''s work very well. But, I can''t find the right event to set this code. I tried CurrentCellShowingDropDown and it''s too late. The drop down list is correctly setting only the second time that I use it. I tried gridFavoris_CurrentCellActivating too and it''s seem to didn''t work. thanks.


AD Administrator Syncfusion Team July 11, 2005 04:37 PM UTC

This code works OK for me in CurrentCellShowingDropdown using version 3.2.1.0. What version are you using using? private void gridControl1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e) { GridCurrentCell cc = this.gridControl1.CurrentCell; GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer; if(cr != null) { cr.ListControlPart.Grid.Cols.Hidden[2] = true; //hide column 2.... } }


AD Administrator Syncfusion Team August 7, 2005 07:44 PM UTC

I just found this and it hides the column but the space allocated for the dropdown is not adjusted so when I hide several wide columns the display seems really ugly.


AD Administrator Syncfusion Team August 7, 2005 08:25 PM UTC

This thread shows how to adjust teh width of teh dropdown in CurrentCellShowingDropDown. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=19403

Loader.
Live Chat Icon For mobile
Up arrow icon