Hi,
I've made a lot of use of BindableValueLists to set up options or value decoding in my grids, but I've run into a problem / bug when exporting the grids to Excel. It appears that the bindablevaluelist does not get properly carried across to the print layout, so my export shows the raw value rather than the text. This causes serious problems if there is a filter defined on a column with a bound list, as the filter runs against the text, not the value, and so in the print layout all rows are filtered out.
I can work around this in a few ways, either by manually looping through by data sources to create normal valuelists, or using bound comboeditors set to the editorcontrol of the column.
However, it would be nice to know if this is a bug or something I can fix in one place before I go and rework a load of code. I did wonder whether it might be to do with a change of bindingcontext or something.
Regards
David
Hi David,
What version of the controls are you using? You should not have to do anything special here. The ValueList (whether bindable or not) should be carried over into the export layout and the export should look exactly as it does on-screen.
If that's not working, then something is wrong. It's possible this is a bug in the grid, but that seems unlikely to me since this is a pretty common scenario and such a bug would be widely reported and we would be aware of it - unless there are some obscure set of circumstances that are causing it.
I'm using 2009 vol1, with hotfix. (9.1.20091.2012)
I've attached a sample project that demonstrates the problem. It behaves the same whether the valuelists are set up in the form load or the grid InitializeLayout
From what I can see, the export layout does contain a valuelist for the bindablevalueList column, but the DisplayText is the same as the DataValue.
I hope I'm just missing something simple in the way I'm creating the bindableValuelists or adding them to the grid. However, I can't be that far off, as everything else about them works fine.
Applying latest service release has indeed fixed the issue.
Many thanks
I ran your sample and it worked just fine for me.The exported Excel file looks like this:
Plain ValueList BindableValueList1 Value 1 Value 12 Value 2 Value 23 Value 3 Value 3
If that's now what you are getting then there must be some discrepency between our machines. Perhaps there is a newer service release that I am using and you are not. Did you check for the latest one?
How to get the latest service release - Infragistics Community