Hy all.
I have a sample where I use databinding between a XamDataGrid and XamNumericEditor, but I think I miss something because it's not working.
<my:XamDataGrid Name="xamDataGrid1" GroupByAreaLocation="None" Theme="Office2k7Blue" Style="{StaticResource GridWithButtons}">
<my:XamDataGrid.FieldLayouts>
<my:FieldLayout>
<my:FieldLayout.Fields>
<my:Field Name="Title" Label="{Binding Path=headerTitle, Source={StaticResource resStaticData}, Mode=OneWay}" />
<my:Field Name="Running" Label="{Binding Path=headerRunning, Source={StaticResource resStaticData}, Mode=OneWay}"/>
<my:Field Name="MPAA" Label="{Binding Path=headerMPAA, Source={StaticResource resStaticData}, Mode=OneWay}"/>
<my:Field Name="Critics" Label="{Binding Path=headerCritics, Source={StaticResource resStaticData}, Mode=OneWay}"/>
<my:Field Name="Load" Label="Load"/>
<my:Field Name="Date" Label="Date"
DataType="{x:Type sys:DateTime}"
Converter="{x:Static local:DateTimeConverter.Instance}">
<my:Field.Settings>
<my:FieldSettings EditAsType="{x:Type sys:String}"/>
</my:Field.Settings>
</my:Field>
</my:FieldLayout.Fields>
</my:FieldLayout>
</my:XamDataGrid.FieldLayouts>
</my:XamDataGrid>
{
xamDataGrid1.DataSource = t.DefaultView;
}
DataTable dt = ds.Tables.Add("TopMovies");
dt.Columns.Add("Title", typeof(string));
dt.Columns.Add("MPAA", typeof(string));
dt.Columns.Add("Valid", typeof(bool));
dt.Columns.Add("Date", typeof(DateTime));
dt.Rows.Add(new object[ { false, "Gridiron Gang", "120 min.", "PG-13", "C+", true, 7.2, DateTime.Now });
dt.Rows.Add(new object[ { false, "Pirates of the Caribbean: Dead Man's Chest", "145 min.", "PG-13", "B-", true, 78, DateTime.Now });
dt.Rows.Add(new object[ { false, "Gridiron Gang", "120 min.", "PG-13", "C+", true, 676, DateTime.Now });
dt.Rows.Add(new object[ { false, "Pirates of the Caribbean: Dead Man's Chest", "145 min.", "PG-13", "B-", true, 345, DateTime.Now });
dt.Rows.Add(new object[ { false, "Gridiron Gang", "120 min.", "PG-13", "C+", true, 53, DateTime.Now });
return ds;
I have a XamNumericEditor and I bound the Value propetry to the Load property of the items of the grid. But when I change the value in the XamNumericEditor, the value from the grid is not changed. Here is the XamNumericEditor.
<igEditors:XamNumericEditor Value="{Binding Path=Load, Mode=TwoWay}"/>
Thanks very much for any idea.
Nico
Hy again.
I found the problem. For the XamNumericEditor I was using a format like this: double:{0}.{1} but the type of the field Load was float and it didn't see it.
Thanks very much any way.