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.
Unfortunately, activation email could not send to your email. Please try again.

GridListControl width when hidding columns

Thread ID:

Created:

Updated:

Platform:

Replies:

22114 Dec 3,2004 02:50 AM Dec 7,2004 05:29 AM Windows Forms 3
loading
Tags: GridControl
Jose Egea
Asked On December 3, 2004 02:50 AM

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

Administrator [Syncfusion]
Replied On December 3, 2004 06:06 AM

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);

Paul Laudeman
Replied On December 7, 2004 05:27 AM

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

Paul Laudeman
Replied On December 7, 2004 05:29 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;