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.
Syncfusion Feedback

Hide columns in GridListControl

Thread ID:

Created:

Updated:

Platform:

Replies:

76229 Aug 28,2008 04:09 AM UTC Aug 29,2008 11:42 AM UTC Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 28, 2008 04:09 AM UTC

I have a GridDataboundgrid control, in which one cell has type gridlistcontrol.this GrirListcontrol is bound to a Datatable.this datatable has four columns. but i need to show only two of them in Gridlistcontrol. how can i hide the other columns. now its showing all the columns in Datatable.


Sri Rajan [Syncfusion]
Replied On August 29, 2008 11:42 AM UTC

Hi Leena,

Thank you for your interest in Syncfusion products.

You need to set QueryColWidth event, then set e.Size as 0 and e.Handled as true

to hide a column in GridListControl. Here is the sample code which explains this

task.

this.gridListControl1.Grid.QueryColWidth += new

Syncfusion.Windows.Forms.Grid.GridRowColSizeEventHandler(Grid_QueryColWidth);

void Grid_QueryColWidth(object sender,

Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs e)
{
if (e.Index > 2)
{
e.Size = 0;
e.Handled = true;
}
}


Please let me know if this helps.

Best Regards


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.

Warning Icon 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.Close Icon

;