Hi there,
I have a XamDataGrid that is bound to a table.
Then on each row I want to provide a different display value for an Int field. Thing is, there are many thousands of values and we actually only want to display the current value. Previously we did this in WinForms with the ValueList and bound a different ValueList to each UltraGridRow.
Now we are converting to WPF and using XamDataGrid there might be a better way to do this - maybe using a converter?
Currently this is the code I have, my problem is that the ComboBoxItemsProvider, although generated dynamically with one value, only has the value of the last record. Of course I can make a work around to this by generating a List of all the items when the page is rendered, then bind all to that list.
Just wonder if;
a) Is there a way to have a different data source behind per Record for a single field?
b) Would I be better in this instance to use a Converter function to return the display value?
As an aside, when the user clicks on this field, they cannot edit it In-Line, a new editor starts.
Thanks in advance,
Steve
{
// Get the Description Text for this Language/Theme
String descriptionText = _baseDataAccess.GetDES(des_DescId, "EN");
// Store the Description Id for later use?
cell.Field.Tag = des_DescId;
// Create the datasource for the Combo Box
ComboBoxItemsProvider lookUpItems = new ComboBoxItemsProvider();
lookUpItems.Items.Add(item);
// Use the setter to set the datasource
// Now this is where we really want to have a unique ValueList
setter.Value = lookUpItems;
// Add the setter to the style and assign to this field
style.Setters.Add(setter);
cell.Field.Settings.EditorStyle = style;
}
Oh I solved this. The grid data type was Int. My lookup value is string. So I changed the grid row type to String and it displays sweet. Much better I think than creating a value list for display purposes!
Ok. Since I don't need to edit inline have decided to go with a Converter.
Converter looks fine, is bound when the grid is, I can step in to it and each values is returned fine. However...in the physical display on the UI. The text is empty.
Any clues?