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.

Read Only Columns in GDBG

Thread ID:





37302 Nov 18,2005 02:04 PM Nov 20,2005 05:05 AM Windows Forms 4
Tags: GridControl
Administrator [Syncfusion]
Asked On November 18, 2005 02:04 PM

Hi, What would be the generic code to make all the columns of a GDBG read-only with these condions? It should not effect scroll bras. Grid may have gridboundcolumns or may not? Grid may be a flat grid or a hierarchical view? Thanks,

Administrator [Syncfusion]
Replied On November 18, 2005 02:05 PM

Code should notbe in grid event? because i am trying to write a generic code. Thansk,

Administrator [Syncfusion]
Replied On November 18, 2005 06:42 PM

Here is some code you can try. //for a flat grid GridBoundColumnsCollection gbcc = (grid.GridBoundColumns == null || grid.GridBoundColumns.Count == 0) ? grid.Binder.InternalColumns : grid.GridBoundColumns; gbcc["colname"].StyleInfo.ReadOnly = true; //for a hierarchical grid GridHierarchyLevel level = this.gridDataBoundGrid1.Binder.GetHierarchyLevel(someLevel); GridBoundColumnsCollection gbcc = (level.GridBoundColumns == null || level.GridBoundColumns.Count == 0) ? level.InternalColumns : level.GridBoundColumns; gbcc["colname"].StyleInfo.ReadOnly = true;

Administrator [Syncfusion]
Replied On November 20, 2005 01:25 AM

Clay, How do i know wether a grid is flat or a hierarchical grid? if it is a hierarchical grid, I want to ge the Max Columns count at any level, i mean i need to get the columns cout of a level which has max # of columns. Thanks,

Administrator [Syncfusion]
Replied On November 20, 2005 05:05 AM

Try: this.gridDataBoundGrid1.Binder.HierarchyLevelCount Loop through the hierarchylevels for the grid, and get the max of gbcc.Count for each level. (Here gbcc is from the code snippet in the last post.)


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.