BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
//Example to create DataTemplate in code behind
FrameworkElementFactory textblock = new FrameworkElementFactory(typeof(TextBlock));
textblock.SetValue(TextBlock.TextAlignmentProperty, TextAlignment.Center);
textblock.SetValue(TextBlock.TextProperty, "Some Text");
textblock.SetValue(TextBlock.TextWrappingProperty, TextWrapping.Wrap);
DataTemplate headerTemplate = new DataTemplate() { VisualTree = textblock };
//Example to create MutiBindig in code behind
MultiBinding multiBinding = new MultiBinding();
multiBinding.Converter = (BackgroundColorConverter)this.Resources["ConverterName"];
multiBinding.Bindings.Add(new Binding() { Path = new PropertyPath("") });
multiBinding.Bindings.Add(new Binding() { Path = new PropertyPath("NameHere") });
//Example to create Style in code behind
Style cellStyle = new Style(typeof(Syncfusion.UI.Xaml.Grid.GridCell));
Setter borderThickness = new Setter(GridCell.BorderThicknessProperty, new Thickness(0));
Setter background = new Setter(GridCell.BackgroundProperty, multiBinding);
cellStyle.Setters.Add(borderThickness);
cellStyle.Setters.Add(background);
//Add TextColumn to the DataGrid
this.datagrid.Columns.Add(new GridTextColumn() { MappingName = "NameHere", HeaderTemplate = headerTemplate, CellStyle = cellStyle }); |