Hi -
I have a dataset bound to an ultrawingrid. One of the column [Status] is assigned a ValueList which contains only two values - Approved or UnApproved. Depending on the value for each row, I display an Image in the Status column cell for that particular row. and I am using the following code
statusList.DisplayStyle = ValueListDisplayStyle.Picture; e.Layout.Bands[0].Columns["MapStatus"].ValueList = statusList; e.Layout.Bands[0].Columns["MapStatus"].CellActivation = Activation.NoEdit;
where statusList is my ValueList.
Now when I export the rows to excel,I am expecting the actual value [ie either Approved/UnApproved] to be exported to excel, which is not happening.The column is empty when exported. Is there something that I am missing here or how do we accomplish this..?
Thanks
Rajesh
Hi Rajesh,
What version of the controls are you using?
What are the contents of the ValueList? Are you populating the list with items that have both a DataValue and DisplayText?
Thanks for your time Mike
The version is 9.2
Following is the code that I have in the Initializelayout event of the Grid
// Create a ValueList with an image for each item. ValueList statusList = e.Layout.ValueLists.Add("Status");
ValueListItem vli = statusList.ValueListItems.Add("Approved");vli.Appearance.Image = XYZ.Resources.Approve;
vli = statusList.ValueListItems.Add("UnApproved");vli.Appearance.Image = XYZ.Resources.Denied;// Set the DisplayStyle to Picture so that the list displays only pictures, and no textstatusList.DisplayStyle = ValueListDisplayStyle.Picture;// Assign the ValueList to the column and disable Edite.Layout.Bands[0].Columns["MapStatus"].ValueList = statusList;e.Layout.Bands[0].Columns["MapStatus"].CellActivation = Activation.NoEdit;
And then I bind the dataset which contains a column named 'MapStatus'. I have added the Approved and Denied icons to the resource file and I set them to the valuelistitem as seen in the code above.Depending on the value [Approved/UnApproved] in the dataset, I am able to see the corresponding image displayed in the cell for the Status Column.But when I export the row, this data is missing.I am not sure whether the images get exported , but at the least the expectation is that the actual cell value [ie Approved/Unapproved] gets exported .