This question is locked. New answers and comments are not allowed.
Hi All,
We face an issue that we need to change current telerik grid to dynamical table(which is inherit from RadGridView,
In previous implementation, There is radButton in <telerik:GridViewDataColumn.CellTemplate>
Here is the sample code:
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<telerik:RadButton Style="{StaticResource EditButtonStyle}" x:Name="EditButton" Margin="5,0,0,0" Command="{Binding EditCustomCommand, Source={StaticResource ViewModel}}" CommandParameter="{Binding}" / >
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
But in dynamic table, How should we add this button,in current dynamic table only has databinding property,
all column and row was created step by step for it.
How should we create these buttons by xml:
Here is my test code but no working:
case "RadButton":
GridViewDataColumn radButton = new GridViewDataColumn();
StringBuilder cellBuilder = new StringBuilder();
cellBuilder.Append("<DataTemplate ");
cellBuilder.Append("xmlns='http://schemas.microsoft.com/winfx/");
cellBuilder.Append("2006/xaml/presentation' ");
cellBuilder.Append("xmlns:telerik='http://schemas.telerik.com/2008/xaml/presentation' ");
cellBuilder.Append("xmlns:local='clr-namespace:BindableDataGrid;assembly=BindableDataGrid'> ");
cellBuilder.Append(" <telerik:RadButton Style='{StaticResource EditButtonStyle}' x:Name='EditButton' Margin='5,0,0,0' Command='{Binding EditCustomCommand, Source={StaticResource ViewModel}}' CommandParameter='{Binding}' ></telerik> ");
cellBuilder.Append("</DataTemplate>");
radButton.CellTemplate = (DataTemplate)XamlReader.Load(cellBuilder.ToString());
radButton.CellEditTemplate = (DataTemplate)XamlReader.Load(cellBuilder.ToString());
dgc = radButton;
Any suggestion ?
We face an issue that we need to change current telerik grid to dynamical table(which is inherit from RadGridView,
In previous implementation, There is radButton in <telerik:GridViewDataColumn.CellTemplate>
Here is the sample code:
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<telerik:RadButton Style="{StaticResource EditButtonStyle}" x:Name="EditButton" Margin="5,0,0,0" Command="{Binding EditCustomCommand, Source={StaticResource ViewModel}}" CommandParameter="{Binding}" / >
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
But in dynamic table, How should we add this button,in current dynamic table only has databinding property,
all column and row was created step by step for it.
How should we create these buttons by xml:
Here is my test code but no working:
case "RadButton":
GridViewDataColumn radButton = new GridViewDataColumn();
StringBuilder cellBuilder = new StringBuilder();
cellBuilder.Append("<DataTemplate ");
cellBuilder.Append("xmlns='http://schemas.microsoft.com/winfx/");
cellBuilder.Append("2006/xaml/presentation' ");
cellBuilder.Append("xmlns:telerik='http://schemas.telerik.com/2008/xaml/presentation' ");
cellBuilder.Append("xmlns:local='clr-namespace:BindableDataGrid;assembly=BindableDataGrid'> ");
cellBuilder.Append(" <telerik:RadButton Style='{StaticResource EditButtonStyle}' x:Name='EditButton' Margin='5,0,0,0' Command='{Binding EditCustomCommand, Source={StaticResource ViewModel}}' CommandParameter='{Binding}' ></telerik> ");
cellBuilder.Append("</DataTemplate>");
radButton.CellTemplate = (DataTemplate)XamlReader.Load(cellBuilder.ToString());
radButton.CellEditTemplate = (DataTemplate)XamlReader.Load(cellBuilder.ToString());
dgc = radButton;
Any suggestion ?