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

Prevent unhiding of columns

Thread ID:

Created:

Updated:

Platform:

Replies:

26966 Apr 4,2005 06:35 PM UTC Apr 5,2005 03:00 PM UTC Windows Forms 4
loading
Tags: GridControl
Michael Prince
Asked On April 4, 2005 06:35 PM UTC

I have a grid that I provide QueryCellInfo, QueryColCount and QueryRowCount event handlers to populate with. I also programmitically configure columns at runtime like so: gridControl1.ColStyles[1].ReadOnly = true; gridControl1.Cols.Hidden[1] = true; gridControl1.ColStyles[2].ReadOnly = true; gridControl1.Cols.Hidden[2] = true; gridControl1.ColStyles[3].ReadOnly = true; gridControl1.ColWidths[3] = 100; gridControl1[0,3].Text = "Instrument"; I need to ensure that columns that I specify as being hidden, stay hidden. I don''t want to allow the user to unhide columns (or hide them for that matter). Thank you, Mike

Michael Prince
Replied On April 4, 2005 07:24 PM UTC

I solved my problem by setting the grid''s AllowSelectoin value = Cell only. >I have a grid that I provide QueryCellInfo, QueryColCount and QueryRowCount event handlers to populate with. I also programmitically configure columns at runtime like so: > >gridControl1.ColStyles[1].ReadOnly = true; >gridControl1.Cols.Hidden[1] = true; >gridControl1.ColStyles[2].ReadOnly = true; >gridControl1.Cols.Hidden[2] = true; >gridControl1.ColStyles[3].ReadOnly = true; >gridControl1.ColWidths[3] = 100; >gridControl1[0,3].Text = "Instrument"; > >I need to ensure that columns that I specify as being hidden, stay hidden. I don''t want to allow the user to unhide columns (or hide them for that matter). > >Thank you, >Mike

Michael Prince
Replied On April 4, 2005 07:32 PM UTC

This did not solve my problem. I still need to be able to prevent the "unhiding" of columns. Thanks >I solved my problem by setting the grid''s AllowSelectoin value = Cell only. > >>I have a grid that I provide QueryCellInfo, QueryColCount and QueryRowCount event handlers to populate with. I also programmitically configure columns at runtime like so: >> >>gridControl1.ColStyles[1].ReadOnly = true; >>gridControl1.Cols.Hidden[1] = true; >>gridControl1.ColStyles[2].ReadOnly = true; >>gridControl1.Cols.Hidden[2] = true; >>gridControl1.ColStyles[3].ReadOnly = true; >>gridControl1.ColWidths[3] = 100; >>gridControl1[0,3].Text = "Instrument"; >> >>I need to ensure that columns that I specify as being hidden, stay hidden. I don''t want to allow the user to unhide columns (or hide them for that matter). >> >>Thank you, >>Mike

Administrator [Syncfusion]
Replied On April 4, 2005 08:26 PM UTC

If you do not want your suer to double click and un hide a column, then try handling ResizingColumns.
private void gridControl1_ResizingColumns(object sender, GridResizingColumnsEventArgs e)
{
	if(e.Reason == GridResizeCellsReason.DoubleClick || e.Reason == GridResizeCellsReason.ResetHide)
		e.Cancel = true;
}

Michael Prince
Replied On April 5, 2005 03:00 PM UTC

Thanks Clay, that did the trick.

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

;