<ControlTemplate x:Key="NewGaugeBackground" TargetType="{x:Type ContentControl}"> |
<Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"> |
<Grid.ColumnDefinitions> |
<ColumnDefinition Width="20"/> |
<ColumnDefinition Width="*"/> |
<ColumnDefinition Width="20"/> |
</Grid.ColumnDefinitions> |
<Grid.RowDefinitions> |
<RowDefinition Height="20"/> |
<RowDefinition Height="*"/> |
<RowDefinition Height="20"/> |
</Grid.RowDefinitions> |
<Ellipse Stretch="Fill" Grid.ColumnSpan="3" Grid.RowSpan="3"> |
<Ellipse.Fill> |
<ImageBrush ImageSource="pack://application:,,,/images/bronze.jpg" /> |
</Ellipse.Fill> |
<Ellipse.BitmapEffect> |
<BevelBitmapEffect BevelWidth="20" |
EdgeProfile="BulgedUp" |
Relief="0.5" |
Smoothness="0.3" /> |
</Ellipse.BitmapEffect> |
</Ellipse> |
<Ellipse Grid.Row="1" Grid.Column="1" Stretch="Fill" Fill="White" /> |
<Ellipse Grid.Row="1" Grid.Column="1" Height="48" Width="48"> |
<Ellipse.Fill> |
<ImageBrush ImageSource="pack://application:,,,/images/bronze.jpg" /> |
</Ellipse.Fill> |
<Ellipse.BitmapEffect> |
<BevelBitmapEffect BevelWidth="5" |
EdgeProfile="BulgedUp" |
Relief="0.5" |
Smoothness="0.3" /> |
</Ellipse.BitmapEffect> |
</Ellipse> |
</Grid> |
</ControlTemplate> |
<telerik:GridViewDataColumn IsFilterable="False" IsGroupable="False" IsReadOnly="True" IsSortable="False" Header="Adet" Width="125"> |
<telerik:GridViewDataColumn.CellTemplate> |
<DataTemplate> |
<StackPanel Orientation="Horizontal"> |
<TextBlock Text="{Binding ItemAmount}" FontWeight="Bold"/> |
<TextBlock Text=" yerine "/> |
<TextBlock Text="{Binding ArrivedAmount}" FontWeight="Bold"/> |
</StackPanel> |
</DataTemplate> |
</telerik:GridViewDataColumn.CellTemplate> |
</telerik:GridViewDataColumn> |
... |
<UserControl.Resources> |
<CollectionViewSource x:Key="EmployeeSkillSource" Source="{Binding DataSet.Tables[Roster.EmployeeSkill]}"/> |
<CollectionViewSource x:Key="Roster.Station" Source="{Binding DataSet.Tables[Roster.Station].DefaultView}"/> |
</UserControl.Resources> |
... |
<telerik:GridViewComboBoxColumn |
Header="Station" |
DataMemberBinding="{Binding StationID}" |
UniqueName="Station" |
ItemsSource="{Binding Source={StaticResource Roster.Station}}" |
SelectedValueMemberPath="StationID" |
DisplayMemberPath="StationName" |
IsReadOnly="True" |
/> |
I noticed the samples that came with the latest version does not have a single instance of GridViewComboBoxColumn in the code so I cannot verify any changes.
Can you please provide a demo project veerifying that this usecase is still supported.
Thanks,
Nic
Hi
I am using a PanelBar with HierarcicalDataTemplate, and would like to define different ItemTemplates, and use them based on some data bound to the control.
XAML:
<Border Margin="0">
<Border.Resources>
<DataTemplate x:Key="CheckItem">
<StackPanel Orientation="Horizontal" Margin="10 0 0 0">
<CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}" Margin="0 0 5 0" Click="Checkbox_Click" />
<TextBlock Name="txtCriteria" Text="{Binding Description}" HorizontalAlignment="Left" MouseDown="TextBlock_MouseDown" Cursor="{Binding LinkCursor}" />
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="TextItem">
<StackPanel Orientation="Horizontal" Margin="10 0 0 0">
<TextBlock Text="{Binding Description}" HorizontalAlignment="Left" />
<TextBox Width="50" HorizontalAlignment="Right" />
</StackPanel>
</DataTemplate>
<HierarchicalDataTemplate x:Key="Category" ItemsSource="{Binding Items}" ItemTemplate="{StaticResource CheckItem}">
<StackPanel Orientation="Horizontal" Margin="0">
<CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}" IsThreeState="True" Margin="0 4 5 6" Click="CategoryCheckbox_Click" />
<TextBlock Text="{Binding Description}" Height="13" Margin="5 4 5 6" HorizontalAlignment="Left"/>
</StackPanel>
</HierarchicalDataTemplate>
</Border.Resources>
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="10">
<telerik:RadComboBox Name="rcbDefinition" Margin="0,0,0,0" Height="20"
HorizontalAlignment="Stretch" VerticalAlignment="Top"
SelectionChanged="rcbDefinition_SelectionChanged" FontSize="12" />
<telerik:RadPanelBar BorderThickness="1" BorderBrush="#FF6699CC" Name="rpbSearchCategories" Margin="0,80,0,0" Width="250" HorizontalAlignment="Left"
ExpandMode="Single" ItemTemplate="{StaticResource Category}" Expanded="rpbSearchCategories_Expanded" Background="White" />
</Grid>
</Border>
codebehind:
...
rcbDefinition.ItemsSource = SearchConfig.Items;
...
private void rcbDefinition_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
SearchDefinition srchDef = (SearchDefinition)rcbDefinition.SelectedItem;
if (srchDef.Items == null)
srchDef.LoadItems();
rpbSearchCategories.ItemsSource = srchDef.DisplayItems;
txtSubHeader.Text = srchDef.Instructions;
UpdateQuery();
}
I defined two DataTemplates, one called CheckItem and one TextItem.
What I would like to accomplish is to define which one to use, based on a field on the SearchDefinition.DisplayItem class.
Taking a wild shot, I would write something like this:
<HierarchicalDataTemplate x:Key="Category" ItemsSource="{Binding Items}" ItemTemplate="{Binding CategoryType}">
But realizing this was too wild a shot.
The "CategoryType" field on the Categories in the list Items would then return either "CheckItem" or "TextItem", depending on whether the underlying items should have a checkbox or a textbox for input by the user.
I hope my question i clear enough for someone to give me a hint on how to do this!
Regards
Jonas