Hi everyone,
i have a problem with binding datagrid into code behind
indeed i have the code below
dataGrid1.Columns.Clear();
for (int i = 0; i < mylistChamp.Count; i++) //mylistChamp is a liste of the fields in the featurelayer
{
DataGridTextColumn dgc = new DataGridTextColumn();
String c = mylistChamp;
dgc.CanUserSort = true;
dgc.SortMemberPath = mylistChamp;
dgc.Binding = new System.Windows.Data.Binding("Attributes"); // The line with the problem
dgc.Header = mylistChamp;
dataGrid1.Columns.Add(dgc);
}
the code below can not work but if i replace the line: dgc.Binding = new System.Windows.Data.Binding("Attributes")
with dgc.Binding = new System.Windows.Data.Binding("Attributes[NAME]") where NAME represent the Fields the code work well
Please Someone Can Help me ?