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

Exception quering CellType of GridBoundColumn

Thread ID:





7637 Oct 3,2003 04:06 PM UTC Oct 3,2003 06:04 PM UTC Windows Forms 3
Tags: GridControl
Gene Gorokhovsky
Asked On October 3, 2003 04:06 PM UTC

I have a fairly complex class hierarchy preparing column styles for my grid, and essentially end-up doing following (across multiple classes) //parent class prepares an array of gridcolumns GridBoundColumn gbc = new GridBoundColumn(); gbc.CellType = "ComboBox"; .... //a child class wants to make this column read-only if (gbc.CellType != "CheckBox") { gbc.CellType = "Static"; //and other style changes } This all happens before gbc ever gets assigned to any grid. Unfortunately reading CellType (inside that if statement) results in an exception, apparently trying to inherit style settings from a non-existent model. Could this behavior perhaps be changed so when no model is yet know, style just returns its own value? Gene Gorokhovsky GridDataBoundGrid

Administrator [Syncfusion]
Replied On October 3, 2003 05:39 PM UTC

I will look into this. That's how it should normally be implemented that it won't try to locate a model if the style is not assigned to a model yet. You say that happens with any GridBoundColumn as long as it is not assigned to a GridBoundColumns Collection. Correct? If that is the issue a workaround in the meantime would be to check style.HasCellType before accessing style.CellType. Stefan

Gene Gorokhovsky
Replied On October 3, 2003 05:46 PM UTC

>You say that happens with any GridBoundColumn as long as it is not assigned to a GridBoundColumns Collection. Correct? > Yes. The suggested workaround does not help -- HasCellType returns true, and the damn thing still bombs.

Administrator [Syncfusion]
Replied On October 3, 2003 06:04 PM UTC

Ok, just tell me how to modify one of our samples to reproduce the problem. This helps me be sure I didn't misunderstand your setup. Stefan


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