I am using ultragrid and I want to show the text portion of a enum property. I tried doing it like so
private void MapToLevel() { foreach (var row in HistoryGrid.Rows) { row.Cells["LevelId"].Value = row.Cells["LevelId"].Value.ToString(); } }this doesn't change anything.this method is being called herepublic new void Refresh() { LoadData(); HistoryGrid.DataSource = null; HistoryGrid.DataSource = _BindingSource; HistoryGrid.DataBind(); MapToLevel(); }private void LoadData() { _histories = _controller.GetAll(_personId, _companyId); _BindingSource = new BindingSource { DataSource = _histories }; }
private void LoadData() { _histories = _controller.GetAll(_personId, _companyId); _BindingSource = new BindingSource { DataSource = _histories }; }
I just posted this which may help
this is for populating a combo box with an enum
http://forums.infragistics.com/forums/p/68648/347675.aspx#347675
theres also a link to the original article the work was based on which may help
Hi,
I'm afraid I am not sure what you are asking. What do you mean by "text portion"?
If your column's DataType is an enum, then the code you have here will blow up, because you cannot assign a string to an enum value.
If you have an Enum type column and you want the column to show the name of the enum instead of the integer value, then the best thing to do is to use a ValueList that maps the enum to the string.