Hi,
I want to create XamDataGrid,FieldLayout and Fields in code behind instead of Xaml.
In my Xaml file should be like this:
=========================
<Grid Name="grid"> </Grid>
Code behind :
public void Load() { x1 = new XamDataGrid();
FieldLayout fl = new FieldLayout();
//FieldLayout F1 = new FieldLayout();
//Field fieldA = new Field(); //Field fieldB = new Field();
//fieldA.Label = "FieldA"; //fieldB.Label = "FieldB";
Infragistics.Windows.DataPresenter.Field field = new Infragistics.Windows.DataPresenter.Field();
//RowDefinition row = new RowDefinition();
field.Name = "CSP"; field.Label = "Chandra";
fl.Fields.Add(field);
x1.FieldLayouts.Add(fl);
// x1.FieldLayoutInitialized += new EventHandler<Infragistics.Windows.DataPresenter.Events.FieldLayoutInitializedEventArgs>(x1_FieldLayoutInitialized);
this.grid.Children.Add(x1); }
I am calling load method from Constructor..
In my case, xamDatagrid with Column "Chandra" should come..but it is not coming..
Please let me know, where i did mistake..
Please help me..
Hello,
Thank you for your post. I have created a sample application(DataGridFieldsCodeBehind.zip) here I am adding the fields in the XamDataGrid in code-behind. If this is not your scenario, please modify my sample application in order to provide you with more accurate assistance.
Looking forward to hearing from you.
I am just checking if you require any further assistance on the matter.