Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
How to Get RGB Value from Ultragrid Cell
posted

Sir,

  I have set style of a UltraWinGrid column as Color.  How to get the selected Color's RGB value from that cell.

Kindly help me in this regard

  • 37774
    posted

    Is the underlying DataSource's type for that column also a color?  If that is the case, you could just access the cell's Value and cast it to a Color.  From there, you can access the R, G, and B properties.  If it is stored as a string (i.e. the ToString of the color), then I don't think that there's a simple way to get that value back into a .NET color unless it is a known color, but you could parse that string for the A, R, G, and B values and create the color yourself.

    -Matt