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

GridListControl width when hidding columns

Hi: I''m trying to hide several columns in a GridListControl cell using the TableControlCurrentCellShowingDropDown event, but first time I dropdown the cell the grid has the width of the original grid without hiding columns. Second time the gridlistcontrol has resized and appears fine. How can I adjust the gridlistcontrol width first time I display it in the cell? Thanks in advance

3 Replies

AD Administrator Syncfusion Team December 3, 2004 11:06 AM UTC

Are you adjusting e.Inner.Size to reflect the columns you have hidden. Maybe //cr is the cell renderer int height = cr.ListControlPart.Grid.ColWidths.GetTotal(0,cr.ListControlPart.Grid.ColCount); e.Inner.Size = new Size(e.Inner.Width, height);


PL Paul Laudeman December 7, 2004 10:27 AM UTC

Jose, With some help from Clay in a previous post, I''ve used the "CurrentCellShowingDropDown" event and wrote the following code to set the visibility of a column: Private Sub Grid_CurrentCellShowingDropDown(ByVal sender As Object, ByVal e As GridCurrentCellShowingDropDownEventArgs) Handles _grid.CurrentCellShowingDropDown if (someCondtion = True) then grid.Model.Cols.Hidden(1) = True end if end sub Hope that helps, -Paul


PL Paul Laudeman December 7, 2004 10:29 AM UTC

I abbreviated my code example for you and forgot to include the "grid" object variable declaration (add inside the "if" condition check): Dim grid As GridControl = CType(cc.Renderer, GridDropDownGridListControlCellRenderer).ListControlPart.Grid

Loader.
Live Chat Icon For mobile
Up arrow icon