Ultragrid infragistics excel导出导出UltraDropDownList ValueMember而不是DisplayMember

我使用Infragistics.Documents.Excel将UltraGrid导出到Excel。 网格包含各种各样的列,其中一个types是绑定到数据源的DropDownListtypes。 但是,当它被导出到Excel时,它显示的列很好,但是excel字段中的数据是ValueMember,例如1,2,3,4,而不是DisplayMember,例如“Book”。 有谁知道这个方法吗?

谢谢,

您可以处理创buildUltraGrid布局副本的UltraGridExcelExporter组件的ExportedStarted事件,获取您知道的ValueList,并为每个项目设置显示成员将数据值转换为string。

private void ultraGridExcelExporter1_ExportStarted(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.ExportStartedEventArgs e) { ValueList valueList = e.Layout.Bands[0].Columns[0].ValueList as ValueList; foreach (var item in valueList.ValueListItems) { item.DisplayText = item.DataValue.ToString(); } }