I create some unbound fields for my own fieldlayout.
... string[] strarray = { "aaa", "bbb", "ccc" }; string[] cols = {"1","2","3"}; Infragistics.Windows.DataPresenter.FieldLayout fl = new Infragistics.Windows.DataPresenter.FieldLayout();
foreach (string name in cols) { CreateUnboundField(fl, name, name); }
//CreateField(fl, "Value", "");
this.SetGrid.FieldLayouts.Add(fl);
this.SetGrid.DataSource = strarray;...
CreateUnboundField and CreateField is like:
public void CreateUnboundField(Infragistics.Windows.DataPresenter.FieldLayout fl, string name, string label) { Infragistics.Windows.DataPresenter.UnboundField codefield = new Infragistics.Windows.DataPresenter.UnboundField(); codefield.Name = name; codefield.Label = label; fl.Fields.Add(codefield); }
public void CreateField(Infragistics.Windows.DataPresenter.FieldLayout fl,string name,string label) { Infragistics.Windows.DataPresenter.Field codefield = new Infragistics.Windows.DataPresenter.Field(); codefield.Name = name; codefield.Label = label;
fl.Fields.Add(codefield); }
If I create a bound field in my fieldlayout, grid will change the default fieldlayout to one which just includes "Value" field.What's the problem? I use the 9.1 assembly.
Hi Everyone,
I am facing same sort of problem even in 9.2 version. I have created unbounded field to compose a control, But at time its not able to keep its layout as defined in xaml. Please suggest solution thanks.