I am developing a Silverlight Application in VS 2010 with SQL Server 2008 as the database server. In a certain table in my database, I have a field AccessLevel which can take values such as 0, 1, 2 etc. each corresponding to a level of access. Eg:- 0 = User, 1 = Moderator, 2 = Administrator, 3 = Super Administrator etc. The AccessLevel is stored as an int in the database. In the UI, I wish to display the list of users in a DataGrid control which can be edited by a DataForm control. The name of the access level must appear on the DataGrid as well as the DataForm instead of the level number. How can I achieve that? Entity Data Model and Domain Data Service are being used.
Thanks in advance.
I am developing a Silverlight Application in VS 2010 with SQL Server 2008 as
Share
You could define an enum:
Then create another property on your entity, that maps to the original access level:
You can then use this property in DataGrids/DataForms. Here’s an example.