how Can i create Xam grid dynamically?
vikas227,
Begin by adding references to the following assemblies
InfragisticsWPF3.v10.3InfragisticsWPF3.Editors.v10.3InfragisticsWPF3.DataPresenter.v10.3
Or another version of the same assemblies.
Once that is done, add a using (C#) or Imports (VB) statement for the Infragistics.Windows.DataPresenter namespace:
using Infragistics.Windows.DataPresenter;
Imports Infragistics.Windows.DataPresenter
Then simply create an instance of the XamDataGrid and make it the child of a Panel or Window:
C#:
Window w = new Window();w.Title = "Dynamically Created Window With XamDataGrid";
XamDataGrid xdg = new XamDataGrid();xdg.DataSource = GetData(); // Where GetData returns an IEnumerablew.Content = xdg;w.Show();
VB:
Dim w as Window new Window()w.Title = "Dynamically Created Window With XamDataGrid"
Dim xdg as XamDataGrid new XamDataGrid()xdg.DataSource = GetData() ' Where GetData returns an IEnumerablew.Content = xdgw.Show()
Let me know if you have any questions with this matter.
How can i create Field layouts dynamically and set others setting like margin,width etc?