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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Use Enumeration as Cell Value Type?

Thread ID:





31475 Jul 7,2005 06:27 PM UTC Jul 7,2005 10:12 PM UTC WinForms 4
Tags: GridControl
Jack Benny
Asked On July 7, 2005 06:27 PM UTC

Is it possible to use an Enum as the value type for a cell? In particular, the cells I need this for are all comboboxes. I put the name of my enum (TypeEnum) under CellValueType for the corresponding base style, which seemed to work OK, but when I use dataGrid[row,col].CellValue, it returns an object and throws an invalid cast message when I try (TypeEnum) dataGrid[row,col].CellValue Where to, Gumshoe? ------ LSMFT

Mary Livingstone
Replied On July 7, 2005 06:33 PM UTC

Actually, Jack meant "unable to convert" error, instead of just "bad cast". Probably same difference but hey. Jack''s too cheap to post again, so I had to do it. He didn''t want to have to tip the computer (that''s a PCMCIA rack, not a coin slot!)

Martin Cyr
Replied On July 7, 2005 06:43 PM UTC

Check out System.Enum.GetNames. It returns an array of strings wich you can then use as DataSource.

Martin Cyr
Replied On July 7, 2005 06:47 PM UTC

I''m sorry, I misread your post, what you want in the situation might be more like System.Enum.Parse or .GetValues Sorry

Administrator [Syncfusion]
Replied On July 7, 2005 10:12 PM UTC

Here is a sample using Enums in a combobox without this casting problem. You can also type the enum text into the cell as well. Do you need something different? http://www.syncfusion.com/Support/user/uploads/GC_CustomObject_728fd939.zip


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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