I've implemented custom filtering based on the how-to article in the KB, but I see this odd behavior where, after clearing the last checkbox in my filter, the filter control appears to still run the PassesFilter logic, resulting in 0 matches, and the column header still has the visual treatment indicating that it is filtered. What I'd like to do is have an un-check of the last item in a filter behave as if the user has clicked the 'Clear Filter' button.
I've tried several things and havethe following conclusions:
I'm hoping there's some way to hack around these shortcomings. I also think that a CommandId.FilterRequested should be able to notify the Grid column filter that there are no items chosen to filter on, and that the column should act as if the filter has been cleared.
Hi all
I have been looking at the example (App7), specifically this line:
<commands:DataGridUserCommand Id="CommitEdit" Command="{Binding Source={StaticResource ViewModel}, Path=MyCommand}" />
I am trying to pass my ViewModel as a parameter so I can access it here:
private void OnMyCommandExecute(object obj)
At the moment, the Parameter property is empty but CellInfo is populated.
I hope my question is clear.
Thanks
So I am having an issue with Telerik's RadDataGrid for UWP. I have a command that updates an item in the collection that is bound to the RadDataGrid. It sets 3 properties, the one I'm having issues with is an enum property; Status. The Status enumeration is used in a couple of DataTemplateSelectors and StyleSelectors. There is no column defined for the Status property. When it gets updated, an exception gets thrown:
System.InvalidOperationException
HResult=0x80131509
Message=Failed to compare two elements
in
the array.
Source=System.Private.CoreLib
StackTrace:
at System.Collections.Generic.ArraySortHelper`1.BinarySearch(T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
at System.Array.BinarySearch[T](T[] array, Int32 index, Int32 length, T value, IComparer`1 comparer)
at System.Collections.Generic.List`1.BinarySearch(Int32 index, Int32 count, T item, IComparer`1 comparer)
at Telerik.Data.Core.Group.IndexOf(Object item, IComparer`1 sortComparer)
at Telerik.Data.Core.Engine.ParallelDataEngine.Telerik.Data.Core.Engine.IDataEngine.GetFilteredItemIndex(Object item)
at Telerik.Data.Core.LocalDataSourceProvider.ProcessPropertyChanged(Object sender, PropertyChangedEventArgs e)
at Telerik.Data.Core.LocalDataSourceProvider.DataView_ItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
at Telerik.Data.Core.EnumerableDataSourceView.HandlePropertyChanged(Object sender, PropertyChangedEventArgs e)
at Telerik.Data.Core.EnumerableDataSourceView.Telerik.Core.IWeakEventListener.ReceiveEvent(Object sender, Object args)
at Telerik.Core.WeakEventHandlerList`1.OnPropertyChanged(Object sender, PropertyChangedEventArgs e)
at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
at GalaSoft.MvvmLight.ObservableObject.RaisePropertyChanged(String propertyName)
at GalaSoft.MvvmLight.ViewModelBase.RaisePropertyChanged[T](String propertyName, T oldValue, T newValue, Boolean broadcast)
at GalaSoft.MvvmLight.ViewModelBase.Set[T](T& field, T newValue, Boolean broadcast, String propertyName)
at MyLineItemViewModel.set_Status(Status value)
in
MyLineItemViewModel.cs:line 121
Inner Exception 1:
ArgumentException: Object must be of type String.
I have gone through an changed the enum property's data type to string, but I still get the same issue. For what it's worth, I am sorting the collection via PropertySortDescriptors, filtering via a DelegateFilterDescriptor, and grouping via PropertyGroupDescriptor. Does anyone have any suggestions?
In my UWP program there is the potential that a very large number of lines may be drawn on the single chart. This can result in the Legend going down below the bottom of the app, cutting off the remaining items in the legend. This is basically an "excessive" example of the usage of this chart and I'm wanting to make sure it can function effectively when put under this kind of use. I have attached a snip of this chart.
Is there a way to add a scrollbar to the Legend Control so that a user can scroll through the legend? Or should I be looking at a different method for showing the legend?
Note: I am aware that the palette colours are repeating, that's next on my list to resolve.
Thanks for the help in advance.
G'day,
I have a Chart area that I am adding any number of Series to dynamically from a file that my program loads. This can be any number of Series, I've managed to load a file that drew more than 100 lines on my chart. This part of it has been working quite well and it must be done dynamically due to loading the data from a file (I cannot think of another way to do it, at least).
In cleaning it up and adding a few nicer features to it, I am looking at adding a Legend for the chart.
I followed the guides from the Legend Control page and I was able to successfully add a Legend for my graph. However the Legend's colour set does not match my Chart's (DefaultDark at the moment for testing).
The XAML code for my chart is as follows:
<
telerikChart:RadCartesianChart
x:Name
=
"MainChart"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
Margin
=
"10,10,10,10"
PaletteName
=
"DefaultDark"
Grid.Column
=
"1"
>
<
telerikChart:RadCartesianChart.Grid
>
<
telerikChart:CartesianChartGrid
MajorLinesVisibility
=
"XY"
/>
</
telerikChart:RadCartesianChart.Grid
>
<
telerikChart:RadCartesianChart.Behaviors
>
<
telerikChart:ChartPanAndZoomBehavior
ZoomMode
=
"Both"
PanMode
=
"Both"
/>
<
telerikChart:ChartTrackBallBehavior
InfoMode
=
"Multiple"
>
<
telerikChart:ChartTrackBallBehavior.LineStyle
>
<
Style
TargetType
=
"Polyline"
>
<
Setter
Property
=
"Stroke"
Value
=
"Tomato"
/>
<
Setter
Property
=
"StrokeThickness"
Value
=
"2"
/>
<
Setter
Property
=
"StrokeDashArray"
Value
=
"1,2"
/>
</
Style
>
</
telerikChart:ChartTrackBallBehavior.LineStyle
>
<
telerikChart:ChartTrackBallBehavior.IntersectionTemplate
>
<
DataTemplate
>
<
Ellipse
Width
=
"10"
Height
=
"10"
Fill
=
"Tomato"
/>
</
DataTemplate
>
</
telerikChart:ChartTrackBallBehavior.IntersectionTemplate
>
</
telerikChart:ChartTrackBallBehavior
>
</
telerikChart:RadCartesianChart.Behaviors
>
<
telerikChart:RadCartesianChart.VerticalAxis
>
<
telerikChart:LinearAxis
x:Name
=
"Vertical"
Title
=
"Pressure (kPa)"
Minimum
=
"0"
/>
</
telerikChart:RadCartesianChart.VerticalAxis
>
<
telerikChart:RadCartesianChart.HorizontalAxis
>
<
telerikChart:LinearAxis
x:Name
=
"Horizontal"
Title
=
"Depth (mm)"
/>
</
telerikChart:RadCartesianChart.HorizontalAxis
>
</
telerikChart:RadCartesianChart
>
And to add in the LegendControl:
<
telerikPrimitives:RadLegendControl
x:Name
=
"LegendForChart"
LegendProvider
=
"{Binding ElementName=MainChart}"
/>
For some reason the items in the Legend are always blue instead of matching the colours from the Palette/matching the colours from each Series on the Chart.
What am I missing that could make these colours line up appropriately? Any help would be appreciated.
This is the code that adds the series to the chart, if needed.
ScatterLineSeries scatterLineSeries =
new
ScatterLineSeries
{
ItemsSource = graphData,
XValueBinding =
new
PropertyNameDataPointBinding(
"Depth"
),
YValueBinding =
new
PropertyNameDataPointBinding(
"Pressure"
),
DisplayName = $
"G:{groupNumber} I:{insertionNumber}"
,
LegendTitle = $
"G:{groupNumber} I:{insertionNumber}"
,
};
MainChart.Series.Add(scatterLineSeries);
Hi,
I have some rather special display requirements on data in my RadDataGrid. While I'd love to let RadDataGrid handle the sorting I think I need to populate the grid in the order I'd like.
My question is can I detect via an event or something when a user changes the sort and direction on a particular column? If so... how?
What is the easiest way to do this?
I tried to get a template copy, but without success. May be overwriting the ThemeResource?
Thank you!
<telerikInput:RadCalendar SelectedDateRange="{x:Bind DataRange,Mode=TwoWay}" DisplayMode="MonthView" SelectionMode="Multiple"/>
public sealed partial class MainPage : Page
{
private CalendarDateRange? dateRange = new CalendarDateRange(new DateTime(2019,3,1),new DateTime(2019,3,20));
public CalendarDateRange? DataRange
{
get => dateRange;
set
{
dateRange = value;
}
}
public MainPage()
{
this.InitializeComponent();
}
}
My question is how to do the selection operation on this control that will change the DataRange property value correctly? For now, the startdate and enddate always are the same value when I do the selection on the control.
In my RadDataGrid, I have to use a DataGridTemplateColumn because the Itemssource of my combobox is a collection that is a property of the object represented by the grid row. I've got it working except for the fact that the combo box is always editable. In other words, the box and dropdown arrow are always visible.
In a regular combobox column on a RadDataGrid the combo box is not visible unless you double click on the column. Until you click, the column just displays the selected item. In my columns, the box and dropdown arrow are always visible, before and after you click in or out of the column.
How can I change this to the typical behavior? I want the user to have to click in the column before the box and dropdown arrow become visible. Before that, the column just display the selected item. Thanks for your help.
<tg:DataGridTemplateColumn SizeMode="Auto">
<tg:DataGridTemplateColumn.CellContentTemplate>
<DataTemplate>
<ComboBox Width="220"
ItemsSource="{Binding Path=ItemCategory.Items, Mode=OneWay}"
SelectedItem="{Binding Products, Mode=TwoWay}"
SelectedValue="{Binding Products.Id, Mode=OneWay}"
SelectedValuePath="Id"
DisplayMemberPath="ItemName">
</ComboBox>
</DataTemplate>
</tg:DataGridTemplateColumn.CellContentTemplate>
<tg:DataGridTemplateColumn.Header>
<TextBlock.Text = "Item Category"/>
</tg:DataGridTemplateColumn.Header>
</tg:DataGridTemplateColumn>