How can I configure my xamTextEditor to have rounded borders?.
You would need to re-template the control and set a corner radius on the border within it. You can use our default xaml which is included in the DefaultStyles directory as a starting point for your custom template.
OK, this is my template
<ControlTemplate x:Key="XamTextEditorControlTemplate1" TargetType="{x:Type igEditors:XamTextEditor}"><Border CornerRadius="5" x:Name="MainBorder" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"><TextBlock x:Name="TextBlock" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Text="{TemplateBinding DisplayText}" TextAlignment="{TemplateBinding TextAlignmentResolved}" TextWrapping="{TemplateBinding TextWrapping}"/></Border><ControlTemplate.Triggers><Trigger Property="IsEmbedded" Value="False"><Setter Property="CornerRadius" TargetName="MainBorder" Value="5"/></Trigger></ControlTemplate.Triggers></ControlTemplate>
Now I want set this template for one of my xamdatagrid columns at runtime to see the editor of this column with rounded borders
how can I do it?
I am not sure if you are assigning two editor styles for the same column, but if you do, that would not work. You have to put the setters from these styles into one single style and set it to the EditorStyle property
OK,
But How can I change the maxlength in the
PART_FocusSite template Textbox
I have this code to set the template
st3 =
Me.FindResource("EstiloEditorTexto") (this is the style with template)
XamDGFormasPago.Records.FieldLayout.Fields(
"COD").Settings.EditorStyle = st3
But I don't know how to change the maxlength
My problem.
I had a grid with some columns.
One of this columns is XAMTEXTEDITOR type.
It's corner weren't rounded, to make this rounded I retemplate XAMTEXTEDITOR using your sample.
Now my column have rounded corners.
But before retemplate I set a setter to the colum to set the maxlength I could insert with this code
vc.MaxLength = 50
XamDGMonedas.Records.FieldLayout.Fields(
"COD").Settings.EditorType = GetType(XamTextEditor)
st3.TargetType =
GetType(XamTextEditor)
st3.Setters.Add(setter4)
But now I don`t what must I do imulate this code with the template.
Hi,
You need to put the ControlTemplate setter and ValueConstraint setter in the same style and assign it to the field's EditorStyle property. You can use two different editor styles. Note that since you are using XAML to create the template and VB to create the value constraint setter, you can use dynamic resource syntax to reference the ControlTemplate in the style that you are creating in VB. That is put the ControlTemplate in the Resources of the window or the app and then reference it in the setter of the style created in VB code.
Hope this helps,
Sandip
Hello,
I have attached my resource.xaml file.
I have a xamadatagrid, I loadmy datagrid with a dataset.
Before I want configure columns.
st3 = Me.FindResource("EstiloEditorTexto") 'this is in the reosurce file
XamDGFormasPago.Records.FieldLayout.Fields("COD").Settings.EditorStyle = st3
with this code I get my colum editor with rounded corners
But I don't know how to change the maxlength of the editor. I can´t modify resource setters
Can you send me an example code please