DataGridView, ComboboxColumn, Enum Type, DataBase : Description and Value ?

csharp Tunisia
  • 14 years ago

    hi !
    i have a big problem i need to solve it quickly :(
    ok let me explain i'm using an sql server database in which i have a column in "int", in that column i save the values of an Enum type in my application. Now the problem is how to populate the combobox column of my DataGridView with descriptions of the Enum values instead of teh values themselves and also how to save the selected description into the DataBase with its corresponding Enum value wich is int, please i really need help :(





  • 14 years ago

    solved :) by using the properties .dispalymemember and MemeberValue the value must be the cast of the enum

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Engineers are all basically high-functioning autistics who have no idea how normal people do stuff.” - Cory Doctorow