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!
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.