Click here to Skip to main content
15,880,725 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C#
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
C#
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??
Posted
Updated 17-Jun-13 0:55am
v3
Comments
Clifford Nelson 18-Jun-13 20:37pm    
I would contact DevExpress on this. If you were using a standard Microsoft WPF grid you might get an answer, but very unlikely you will get an answer on a 3rd party control because there are few people using any one 3rd party control.

1 solution

I got the solution, handled the issue by setting the values in "CustomUnboundColumnData" event..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900