I have a few columns in my RadGridView, which I would like to filter - but not to allow Search as You Type.
Is there any way to do this?
In addition: I have boolean values, which I show as "Yes" and "No" in the grid - but in the filters, they are shown as "True" and "False". It there any way to change this to let the filter sow "Yes" and "No", too?
Best regards
Inger Marie
Hi,
I have a
specific behavior I want to achieve with respect to the AutoCompleteBox.
Requirements:
Tried solution:
public
class
MyFilteringBehavior : FilteringBehavior
{
public
override
IEnumerable<
object
> FindMatchingItems(
string
searchText, IList items, IEnumerable<
object
> escapedItems,
string
textSearchPath,
TextSearchMode textSearchMode)
{
if
(
string
.IsNullOrEmpty(searchText))
return
items.Cast<
object
>();
return
base
.FindMatchingItems(searchText, items, escapedItems, textSearchPath, textSearchMode);
}
}
private
void
Classes_GotFocus(
object
sender, RoutedEventArgs e)
{
var box = (RadAutoCompleteBox) sender;
box.Populate(box.SearchText);
//box.IsDropDownOpen = true; // Not necessary
}
<
telerik:RadAutoCompleteBox
Grid.Row
=
"4"
Grid.Column
=
"2"
Name
=
"Classes"
ItemsSource
=
"{Binding Classes}"
AutoCompleteMode
=
"SuggestAppend"
SelectionMode
=
"Multiple"
TextSearchMode
=
"Contains"
IsHighlighted
=
"True"
FilteringBehavior
=
"{StaticResource MyFilteringBehavior}"
GotFocus
=
"Classes_GotFocus"
/>
Expected behavior:
Unexpected/unwanted effects:
Is there any way to avoid the unwanted behavior while on this setup?
Hello,
I'd like to use a DesktopAlert in a WPF MVVM app.
I copy the code from the Telerik WPF app - DesktopAlert Examples - First Look app (email example).
Code:
public class AlertViewModel : BaseViewModel
{
private RadDesktopAlertManager desktopAlertManager;
public AlertViewModel()
{
this.desktopAlertManager = new RadDesktopAlertManager(AlertScreenPosition.BottomRight, 5d);
}
public Action ActivateMainWindowAction { get; set; }
private void OnAlertCommandExecuted(object param)
{
if (this.ActivateMainWindowAction != null)
{
this.ActivateMainWindowAction.Invoke();
}
}
public void TestAlert()
{
BitmapImage b = new BitmapImage();
b.BeginInit();
b.UriSource = new Uri("C:\\...\\error.png");
b.EndInit();
this.desktopAlertManager.ShowAlert(new DesktopAlertParameters
{
Header = "Header",
Content = "Content",
Icon = new Image { Source = b, Width = 48, Height = 48 },
IconColumnWidth = 48,
IconMargin = new Thickness(10, 0, 20, 0),
Command = new DelegateCommand(this.OnAlertCommandExecuted),
CommandParameter = "ABC"
});
}
}
public partial class Alert : UserControl
{
public Alert()
{
InitializeComponent();
AlertViewModel vm = ServiceLocator.Current.GetInstance<AlertViewModel>();
vm.ActivateMainWindowAction = new Action(this.ActivateMainWindow);
DataContext = vm;
}
private void ActivateMainWindow()
{
var mainWindow = Application.Current.MainWindow;
if (mainWindow != null)
{
if (mainWindow.WindowState == WindowState.Minimized)
{
mainWindow.WindowState = WindowState.Normal;
}
if (!mainWindow.IsActive)
{
mainWindow.Activate();
}
}
}
}
The DesktopAlertParameters command never execute and the alert never show.
Is there something i miss? If i try desktop alert on a new classic WPF app (no mvvm) works withuot problems.
Thanks.
Hi,
Any update on removing the white space from the menu if we are using less then 8 items?
Because it is looking very bad on the UI section.
Our clients want to remove the white space. So any option to do it?
Waiting for your quick reply.
public
class
ByteValidation : ValidationRule
{
private
byte
min = 0;
private
byte
max =
byte
.MaxValue;
//The Minimum and Maximum values are there to restrict how low and how high the
//stored value can be.
public
byte
Minimum
{
get
{
return
min; }
set
{ min = value; }
}
public
byte
Maximum
{
get
{
return
max; }
set
{ max = value; }
}
public
string
ErrorMessage
{
get
;
set
; }
public
override
ValidationResult Validate(
object
value, System.Globalization.CultureInfo cultureInfo)
{
if
(value ==
null
)
{
return
new
ValidationResult(
true
,
null
);
}
byte
tmp;
try
{
double
dTmp = (
double
)value;
tmp = (
byte
)dTmp;
}
catch
(Exception)
{
return
new
ValidationResult(
false
,
"Invalid value"
);
}
if
(tmp < min || tmp > max)
{
return
new
ValidationResult(
false
, ErrorMessage);
}
return
new
ValidationResult(
true
,
null
);
}
}
<
telerik:RadMaskedNumericInput
Mask
=
"##"
Margin
=
"550,0,0,0"
Grid.Row
=
"1"
FontSize
=
"16"
VerticalAlignment
=
"Bottom"
FontFamily
=
"Century Gothic"
>
<
telerik:RadMaskedNumericInput.Value
>
<
Binding
Path
=
"DaysPaidLast30"
>
<
Binding.ValidationRules
>
<
local:ByteValidation
Minimum
=
"0"
Maximum
=
"30"
ErrorMessage
=
"Value must be between 0 and 30."
/>
</
Binding.ValidationRules
>
</
Binding
>
</
telerik:RadMaskedNumericInput.Value
>
</
telerik:RadMaskedNumericInput
>
When I view the RadGridView, I can hide columns using the IsVissible=false method. This appears to be ignored when printing. Is this true and if so, is there another way that I can dynamically cause columns to not be printed?
If all the columns show, it bleeds to a second page and if I force all columns to print on a single page, the font is simply too small to read.
Thanks.
I'm trying to add a tooltiptemplate for the series in my RadCartesianChart. I can't get this to work but I don't see any problem with it.
XAML:
<telerik:ScatterLineSeries x:Key="ToolTipDisplay2">
<telerik:ScatterLineSeries.PointTemplate>
<DataTemplate>
<Ellipse Width="2" Height="2" Fill="Black" />
</DataTemplate>
</telerik:ScatterLineSeries.PointTemplate>
</telerik:ScatterLineSeries>
C# code:
... series added...
ScatterLineSeries temp1 = (ScatterLineSeries) this.Resources["ToolTipDisplay2"];
survivalChart.Series[survivalChart.Series.Count() - 1].TooltipTemplate = (DataTemplate) temp1.TooltipTemplate;
Hi Guys,
I'm struggling with an issue and I can't figure why this goes wrong.
I cannot access my object in the resourcedictionary in my code behind. What I have is the following
I have a resourcedictionary like this.
<
ResourceDictionary
xmlns
=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:telerikScheduleView
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView"
xmlns:telerikColorPickers
=
"clr-namespace:Telerik.Windows.Controls.RichTextBoxUI.ColorPickers;assembly=Telerik.Windows.Controls.RichTextBoxUI"
xmlns:local
=
"clr-namespace:Proj"
xmlns:p
=
"clr-namespace:Proj.Resources"
x:Class
=
"Proj.ProductieOrderViewRecources"
>
<
DataTemplate
x:Key
=
"ProductieOrderViewToolBarTemplate"
>
<telerik:RadRichTextBoxRibbonUI x:Name="richTextBoxRibbonUI"
this whitin this resourcedictionary
I have a radgridview like this.
<
DataTemplate
x:Key
=
"ProductieOrderViewMainSectorTemplate"
>
<
Grid
Margin
=
"10"
>
<
Grid
>
<
telerik:RadBusyIndicator
x:Name
=
"BusyIndicator"
Grid.Row
=
"2"
Visibility
=
"{Binding ShowPlanning}"
>
<
telerik:RadGridView
x:Name
=
"gridViewAdminData"
ItemsSource
=
"{Binding DataRecords}"
RowEditEnded
=
"EditRecord"
DataLoading
=
"LoadData"
SelectionChanged
=
"GridSelectionChanged"
FrozenColumnCount
=
"5"
AutoGenerateColumns
=
"False"
Deleting
=
"RadGridView_deleting"
SelectedItem
=
"{Binding SelectedPlanning}"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Artikel}"
IsReadOnly
=
"True"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Aantal}"
/>
now I'm trying the access the gridViewAdminData by name in the code behind.
but it won't work at all.
I have this in my code
public
partial
class
ProductieOrderViewRecources : ResourceDictionary
{
public
ProductieOrderViewRecources()
{
InitializeComponent();
System.Linq.Expressions.Expression<Func<Proj.Models.productieorder,
double
>> expression = order => (order.AantalTeProduceren + 10);
//RadGridView gridViewAdminData = (RadGridView)this["gridViewAdminData"];
GridViewExpressionColumn column = gridViewAdminData.Columns[
"TotalValue"
]
as
GridViewExpressionColumn;
column.Expression = expression;
}
}
but gridViewAdminData won't get recognized. Also enabling the line above gives back a null value.
Does anyone have any idea about how to access this object in the code behind?
thank you
Hello,
I have a VisualizationLayer bound to a collection of objects. I've defined a MapEllipseView for (some of) the objects in the collection via an ItemTemplateSelector.
The issue I have is that when I add items to the collection the ellipses are only rendered on the map at the completion of a zoom animation.
How can I get them to appear straight away after they are added in the collection?
Thanks,
Chris