<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!
Q: Can I use Bing Maps (Virtual Earth) within a Windows Forms or WPF Desktop Application?
A: As far as Licensing, you’ll need to contact Microsoft. The “Microsoft Virtual Earth Platform API Terms of Use” doesn’t really cover this specific usage scenario.
Microsoft
doesn’t have a Window Forms or WPF control that you can just drag onto
a Window, but you could access the Web Service from your application or
display the JavaScript Map Control within an embedded WebBrowser
control.
<Window x:Class="MVVMCommand.MainWindow" |
x:Name="LayoutRoot" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
Title="MainWindow" Height="300" Width="300" |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"> |
<StackPanel> |
<Button Content="This one works" |
CommandParameter="42" |
Command="{Binding ElementName=LayoutRoot, Path=DataContext.StopCommand}" /> |
<telerik:RadGridView Name="radGridView1" ItemsSource="abcd"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewColumn Header="Start"> |
<telerik:GridViewColumn.CellTemplate> |
<DataTemplate> |
<Button Content="This one does not" |
CommandParameter="42" |
Command="{Binding ElementName=LayoutRoot, Path=DataContext.StopCommand}" /> |
</DataTemplate> |
</telerik:GridViewColumn.CellTemplate> |
</telerik:GridViewColumn> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
</StackPanel> |
</Window> |
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Text; |
using Microsoft.Practices.Composite.Presentation.Commands; |
namespace MVVMCommand |
{ |
public class MVVMCommandViewModel |
{ |
public DelegateCommand<object> StopCommand { get; set; } |
public MVVMCommandViewModel(string s) |
{ |
StopCommand = new DelegateCommand<object>(StopCommand_Execute); |
} |
void StopCommand_Execute(object o) |
{ |
} |
} |
} |
public partial class MainWindow : Window |
{ |
MVVMCommandViewModel _viewModel; |
public MainWindow() |
{ |
InitializeComponent(); |
_viewModel = new MVVMCommandViewModel("42"); |
this.DataContext = _viewModel; |
} |
} |