Hi,
I am using a UltraWinGrid and need to set a ValueList to a column, however the Data Source does not have a regular Id, Value but Name,Value, i tried looking for DataMember, ValueMember properties but no luck. i also tried to change Key property no luck again. this is my code:
UltraGrid grid = (UltraGrid)gridDefinition.Grid;
ValueList valueList = null;
if (source != null)
{
valueList = new ValueList();
valueList.Key = source.Columns[0].ColumnName;
foreach (DataRow row in source.Rows)
valueList.ValueListItems.Add(
new ValueListItem()
DataValue = row[0],
DisplayText = row[1].ToString(),
});
}
grid.DisplayLayout.Bands[0].Columns[columnKey].ValueList = valueList;
Hello,
I am just checking about the progress of this issue. Let me know If you need my further assistance on this matter?
Thank you for using Infragistics Components.
Hi and thanks for the reply.
I have a wingrid where some columns are "ComboBox" type, i fill the data source for these columns by filling the Value List. My data source is always a DataTable, the first column Key is "ID" and the second column Key is "Name" when i work like that the description inside the column is displayed correctly. however if i use a different Key for the first column ("VALUE" instead of "ID") the description is not displayed.
my question was why? and how can i tell the value list that it's "VALUEMEMBER" is "VALUE" and not "ID"?