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

How can I get the colWidth of a hidden column in GDBG?

Thread ID:





8067 Oct 18,2003 11:17 AM UTC Oct 18,2003 01:10 PM UTC WinForms 1
Tags: GridControl
Asked On October 18, 2003 11:17 AM UTC

Model.ColWidths[hiddenFieldName] seems return 0.

Administrator [Syncfusion]
Replied On October 18, 2003 01:10 PM UTC

This is by design. If you want to be able to access the widths of hidden columns, then you will have to do some work. You could catch the ColsHiding event and cache the colwidths there before the columns get hidden. And then use these cached values when you want to retrieve the hidden column width. Or, you could flip the hidden flag (while the grid's drawing is locked), and retrieve the widths in this manner.
private int GetHiddenColWidth(int col)
	bool hidden = this.gridDataBoundGrid1.Model.HideCols[col];
	int width = -1;
		this.gridDataBoundGrid1.Model.HideCols[col] = false;
		width = this.gridDataBoundGrid1.Model.ColWidths[col];
		this.gridDataBoundGrid1.Model.HideCols[col] = true;
	return width;


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon