<Grid> |
<telerikNavigation:RadTileView x:Name="settingRadTileView" |
MinimizedItemsPosition="Left" |
ItemsSource="{Binding Source={StaticResource ModulItems}, XPath=Modul}" |
MaximizeMode="One" |
ItemContainerStyle="{StaticResource RadTileViewItemStyle}" |
Background="{x:Null}" |
SizeChanged="RadTileView_SizeChanged" |
> |
<telerikNavigation:RadTileView.ItemTemplate> |
<DataTemplate> |
<DockPanel Width="Auto" Height="Auto" LastChildFill="False"> |
<TextBlock Text="{Binding XPath=Name}" |
HorizontalAlignment="Center" |
Style="{DynamicResource TextBlockStyle}" |
VerticalAlignment="Center" Height="Auto"/> |
</DockPanel> |
</DataTemplate> |
</telerikNavigation:RadTileView.ItemTemplate> |
<telerikNavigation:RadTileView.ContentTemplate> |
<DataTemplate> |
<telerik:RadFluidContentControl SmallToNormalThreshold="128 128" NormalToSmallThreshold="128 128" |
NormalToLargeThreshold="600 600" LargeToNormalThreshold="600 600" State="Normal"> |
<telerik:RadFluidContentControl.SmallContent> |
<Grid Width="64" Height="64"> |
</Grid> |
</telerik:RadFluidContentControl.SmallContent> |
<telerik:RadFluidContentControl.Content> |
<Grid Width="128" Height="128"> |
</Grid> |
</telerik:RadFluidContentControl.Content> |
<telerik:RadFluidContentControl.LargeContent> |
<Border Width="Auto" Height="Auto" BorderThickness="3" BorderBrush="Blue"> |
<StackPanel> |
<TextBlock Text="Large" Foreground="White"/> |
</StackPanel> |
</Border> |
</telerik:RadFluidContentControl.LargeContent> |
</telerik:RadFluidContentControl> |
</DataTemplate> |
</telerikNavigation:RadTileView.ContentTemplate> |
</telerikNavigation:RadTileView> |
</Grid> |
private void RadTileView_SizeChanged(object sender, System.Windows.RoutedEventArgs e) |
{ |
Grid parent = this.settingRadTileView.Parent as Grid; |
int itemsCount = settingRadTileView.Items.Count - 1; // beacause one is alwasy maximized |
foreach (var item in settingRadTileView.Items) |
{ |
if (item != null) |
{ |
// set the height of each item in order to show all items minimzed at the left. |
RadTileViewItem radTileItem = settingRadTileView.ItemContainerGenerator.ContainerFromItem(item) as RadTileViewItem; |
radTileItem.MinimizedHeight = settingRadTileView.ActualHeight / itemsCount; |
radTileItem.MinimizedWidth = settingRadTileView.ActualHeight / itemsCount; |
} |
} |
} |
private void RadGridView_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Tab)
{
var grid = sender as RadGridView;
var currentItem = grid.CurrentItem as OrderDetail;
if ((currentItem != null) && (currentItem.IsValid))
{
grid.BeginInsert();
grid.CurrentColumn = grid.Columns[0];
}
else
{
e.Handled = true;
}
}
}
private void RadGridView_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
{
e.NewObject = OrderDetail.NewOrderDetail();
}
<UserControl x:Class="XXXXXXXXXX_Controls.ServerControlLog" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
mc:Ignorable="d" |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"> |
<Grid> |
<Grid.RowDefinitions> |
<RowDefinition Height="Auto" /> |
<RowDefinition Height="Auto" /> |
</Grid.RowDefinitions> |
<WrapPanel Grid.Row="0" Margin="10"> |
<telerik:RadButton Content="Start Server" Margin="5" Height="23" HorizontalAlignment="Left" Name="btnStartServer" Click="btnStartServer_Click" VerticalAlignment="Top" Width="75" /> |
<Label Name="lblMessage" Margin="5"></Label> |
</WrapPanel> |
<telerik:RadGridView HorizontalAlignment="Left" Name="radGridServerLog" VerticalAlignment="Top" Grid.Row="1" ScrollViewer.VerticalScrollBarVisibility="Visible" /> |
</Grid> |
</UserControl> |
Hi,
I'm trying to implement filter search in the grid
This is the code:
private void OnFilterByTextCommand(string parameter)
{
var compositeDescriptor = new CompositeFilterDescriptor
{
LogicalOperator = FilterCompositionLogicalOperator.Or
};
foreach (GridViewColumn column in RadGrid.Columns)
{
var dataColumn = column as GridViewDataColumn;
if (column == null) continue;
object obj = null;
try
{
if (dataColumn != null)
obj = Convert.ChangeType(parameter, dataColumn.DataType);
}
catch
{
continue;
}
if (obj == null) continue;
FilterOperator op = dataColumn.DataType.IsValueType ? FilterOperator.IsEqualTo : FilterOperator.Contains;
FilterDescriptor filterDescriptor = new FilterDescriptor
{
IsCaseSensitive = false,
Member = dataColumn.UniqueName,
Operator=op,
Value=obj
};
compositeDescriptor.FilterDescriptors.Add(filterDescriptor);
}
RadGrid.FilterDescriptors.Add(compositeDescriptor);
}
I get exception in the columns that the column type is not the same as the
Item source collection in this binding member
If I bind the column to same data type and us one of this data properties
The exception is cant cast beaten the types
Someone know this problem?
Maybe I need to change the filter method?
Best Regards
Ehud
Hi, all
Nice to meet you!