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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ColorEdit RGB

Thread ID:

Created:

Updated:

Platform:

Replies:

32067 Jul 21,2005 08:44 AM UTC Jul 21,2005 12:01 PM UTC WinForms 4
loading
Tags: GridControl
Andrea vignando
Asked On July 21, 2005 08:44 AM UTC

Hi, I have this problem: I have a ColorEdit cell in a GridControl (Not a GridGroupingControl). After a selection of a color, I want to get the RGB of the color but the BackColor property of the ColorEdit cell give R=255,G=255,B=255 with any color selected. How can I do? Thanks. Andrea

Administrator [Syncfusion]
Replied On July 21, 2005 09:46 AM UTC

If you set the CellValueType to be typeof(Color), then you can get a Color object as the cell value. gridControl1[rowIndex, colIndex].CellType = "ColorEdit"; gridControl1[rowIndex, colIndex].CellValue = Color.Aqua; gridControl1[rowIndex, colIndex].CellValueType = typeof(Color) //..... Color c = (Color)this.gridControl1[26,1].CellValue; Console.WriteLine(c); Console.WriteLine(c.R); Console.WriteLine(c.G); Console.WriteLine(c.B);

Andrea vignando
Replied On July 21, 2005 11:42 AM UTC

I tried but I still have the problem. In fact I''m developing under VB.Net (ad not C#) I try with gridControl1(4, 4).CellValueType = Color also gridControl1(4, 4).CellValueType = typeof(color) also gridControl1(4, 4).CellValueType = ctype(color) and so on... but does''t Work ("Color" is a type and cannot be used as expression...this is the error) Please, What I have to do? Andrea >If you set the CellValueType to be typeof(Color), then you can get a Color object as the cell value. > > >gridControl1[rowIndex, colIndex].CellType = "ColorEdit"; >gridControl1[rowIndex, colIndex].CellValue = Color.Aqua; >gridControl1[rowIndex, colIndex].CellValueType = typeof(Color) > >//..... > >Color c = (Color)this.gridControl1[26,1].CellValue; > >Console.WriteLine(c); >Console.WriteLine(c.R); >Console.WriteLine(c.G); >Console.WriteLine(c.B); >

Administrator [Syncfusion]
Replied On July 21, 2005 11:51 AM UTC

In VB, the code is: gridControl1(4, 4).CellValueType = GetType(Color) Just FYI, there is a C# to VB code coverter on this website that does a pretty good job on coverting snippets from C# to VB. http://authors.aspalliance.com/aldotnet/examples/translate.aspx

Andrea vignando
Replied On July 21, 2005 12:01 PM UTC

Thanks a lot!! It works!! I have also see the code converter, very very interesting!! By, Andrea >In VB, the code is: > >gridControl1(4, 4).CellValueType = GetType(Color) > > >Just FYI, there is a C# to VB code coverter on this website that does a pretty good job on coverting snippets from C# to VB. >http://authors.aspalliance.com/aldotnet/examples/translate.aspx >

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

;