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.

Losing BackColor in Styles

Thread ID:

Created:

Updated:

Platform:

Replies:

24145 Jan 28,2005 02:10 PM Jan 30,2005 02:56 PM Windows Forms 6
loading
Tags: GridControl
Michael Lenaghan
Asked On January 28, 2005 02:10 PM

From time to time I''m losing the BackColor in my grid styles when I run my application. That is, the BackColors are set, I run the app from VS.NET, and when I return to the designer all BackColors are reset to their defaults (and no longer appear in InitializeComponent). Any idea what''s happening? Note that none of my other grid style info (like TextColor) is lost, just the BackColor.

Administrator [Syncfusion]
Replied On January 28, 2005 04:32 PM

What version are you using? 3010 is the first release that does not save cell style information for a GridControl as a binary resource. Instead, it saves everything through collections in code. Is this the version you are seeing this problem with? If so, can you post the IniytializeComponent code when the backcolor is present so we can try to reproduce the problem.

Michael Lenaghan
Replied On January 28, 2005 09:20 PM

I can do that, but I just noticed this when I compiled: Code generation for property ''ColWidthEntries'' failed. Error was: ''Specified cast is not valid.'' Code generation for property ''Interior'' failed. Error was: ''value'' Code generation for property ''Interior'' failed. Error was: ''value'' Code generation for property ''Interior'' failed. Error was: ''value'' It just so happens that I''m losing three BackColors; could there be a relationship?

Administrator [Syncfusion]
Replied On January 29, 2005 01:37 AM

Was this form originally created with an 2.x version of Essential Grid? If so, did you run the Syncfusion\Essential Suite\3.0.1.0\Utilities\Migration\1.1\ConvertResx utility to convert this old resx? (Use 1.0\Convertresx if you are using .Net 1.0). If you have not done this, then you might get the old resx and try it. With 3.0.1.0 and a new form, I tried setting BackColor on individual cells and columns along with some other properties and things seems to work OK for me. Are you setting these BackColors on individual cells or columns or basestyles?

Michael Lenaghan
Replied On January 29, 2005 01:34 PM

This form was created with 3.0.1.0. The BackColors are set in BaseStyles. It looks like those BackColors are then used in the Interior property of the style--at least, when I inspect I see that they''ve been set to the same value--and it''s the Interior property that''s reporting the error. Btw, my current workaround is to reset the colors for those styles in FormLoad. Also: I''m having another style problem that I''ll post as a separate message.

Administrator [Syncfusion]
Replied On January 30, 2005 01:29 PM

Hi Michael, BackColor is just a shortcut to set interior. Internally it will create a BrushInfo and assign it to Interior. Interior will then be written out to InitializeComponent method. Regarding your problem: Are the syncfusion dlls in the GAC? If not can you try registering them? Normally InvalidCastException occur when dll are not in the GAC and CopyLocal = true for the assemblies because then the VS designer loads the same dll from multiple locations. If that''s not the case I don''t know what could be wrong. Can you try on another machine or can you send a sample project? Thanks, Stefan

Michael Lenaghan
Replied On January 30, 2005 02:56 PM

Yes, I have 9 Syncfusion dll''s in the gac: Syncfusion.Core, Syncfusion.Grid.Base, Syncfusion.Grid.Windows, Syncfusion.Scripting.Base, Syncfusion.Scripting.Windows, Syncfusion.Shared.Base, Syncfusion.Shared.Web, Syncfusion.Shared.Windows, Syncfusion.WebServer. All but WebServer are 3.0.1.0. I can''t really send the project; it''s very, very large. I could perhaps send you the one unit that uses the grid so that you could at least see the source. Where would I send it to...? Btw, a) I''m still occassionally seeing CurrentCell with the wrong style and b) if I don''t set "e.Cancel = true" in CurrentCellStartEditing, read-only fields allow a couple of keystrokes.

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.

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.

;