the C# code behind examples have all but disappeared with teeh advent of Xaml and it's extremely frustrating that I have to come onto a forum to figure out how to implement something that should take 30 seconds to do and is not documented in any help file.
can someone please post some C# code not xaml. that shows how do to this?
Hi ,
I suppose you want to set XamTextEditor.Format property from the codebehind. In this case you can try
the following :
private void xamDataGrid1_InitializeRecord(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e){ Style stl = new Style(); Setter set=new Setter(); set.Property=XamTextEditor.FormatProperty; set.Value="N8"; stl.TargetType = typeof(XamTextEditor); stl.Setters.Add(set);
xamDataGrid1.FieldLayouts[0].Fields[1].Settings.EditAsType = typeof(Double); xamDataGrid1.FieldLayouts[0].Fields[1].Settings.EditorType = typeof(XamTextEditor); xamDataGrid1.FieldLayouts[0].Fields[1].Settings.EditorStyle = stl;}
I'm using a XamTextEditor to Format a double value.
Hope this helps
Vlad
Actually I just found a nother post that was doing something very similar to this and it will work.
I created a style in xaml
<
Style TargetType="{x:Type igEditors:XamDateTimeEditor}" x:Key ="MyDateFormat" >
Setter Property="Format" Value="MM/dd/yyyy hh:mm tt" />
</
Style>
and call it as so
;
grdExistingDSrcs.FieldLayouts[
);
].Settings.EditorStyle = stl;
thanks for the quick reply.
there really needs to be some more code behind documentation.
I understand the push towards Xaml but it's not always the best implementation or approach.
Nick