I have a DevExpress grid control, grdcntrl with 10 fixed fields(columns) in xaml
items source is given for grdcntrl using c# code in a button click event, the observable collection, which is having more than 10 fields
its working fine and showing 10 columns with templates given in xaml.
Now i added some fields(columns) to the grdcntrl dynamically like following codes:
GridColumn column = new GridColumn()
{
Name = "columnName", FieldName = "columnName", Header = "description", Width = 150
};
grdcntrl.Columns.Add(column);
Worked...
But While i am trying to set some value to the cells like
List<int> lst = GridRowHandle.GetDataRowHandles(grdcntrl);
string cellvalue = "";
foreach (int rwHandle in lst)
{
cellvalue = "something1";
grdcntrl.SetCellValue(rwHandle, "columnName", cellvalue);
}
its not adding the cell values to the grdcntrl..Its showing the values for 10 fixed columns mensioned in xaml and added columns with empty cells.
How to add cell values to the cells under newly added columns??