Telerik Forums
UI for Universal Windows Platform Forum
2 answers
44 views

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:

  • The custom filter is applied to the column when the CommandId.FilterButtonTap command executes, but the Clear button executes CommandId.FilterRequested, so if I want to reset the filter I'd need to do so in my custom GridFilterRequestedCommand
  • IsFiltering and Descriptor are both read-only properties on the FilterRequestContext in CommandId.FilterRequested so I can't try to set the first to false or null the second
  • It looks like the Clear Filters button removes the FilterDescriptor from the owner, but this didn't make any difference when I tried it because I can't un-set IsFiltering
  • I can't create my own FilterRequestedContext to fake an invocation because of the internal sets on all the properties
  • WPF appears to have a ClearFilters method which UWP lacks

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.

Nasko
Telerik team
 answered on 28 Jun 2019
3 answers
153 views

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

 

 

Lance | Manager Technical Support
Telerik team
 answered on 13 Jun 2019
0 answers
40 views

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?


Tony
Top achievements
Rank 1
 asked on 11 Jun 2019
1 answer
40 views

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.

Lance | Manager Technical Support
Telerik team
 answered on 28 May 2019
2 answers
29 views

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);
Chris
Top achievements
Rank 1
 answered on 27 May 2019
2 answers
20 views
Hello,

For more than a decade, an ImageSource accepts an URL to load an image on the fly. Windows has its own caching system.

In our app, we have a way to download all the images needed into disk, so if the system is disconnected from the Internet, we could continue to load images.

Challenge: I haven't found a way to load an image on the fly with the source being an image on disk. One part of the issue is a Converter does not accept async methods.

Thanks
Sebastien
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 14 May 2019
1 answer
9 views

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?

Yana
Telerik team
 answered on 13 May 2019
5 answers
412 views

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!

Milenny
Top achievements
Rank 1
 answered on 09 May 2019
6 answers
10 views

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

Yana
Telerik team
 answered on 24 Apr 2019
3 answers
395 views

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>

Lance | Manager Technical Support
Telerik team
 answered on 16 Apr 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Toby
Top achievements
Rank 3
Iron
Iron
Benjamin
Top achievements
Rank 2
Iron
Veteran
Bernd
Top achievements
Rank 4
Bronze
Iron
Iron
minh
Top achievements
Rank 2
Iron
Iron
Iron
Sebastien
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Toby
Top achievements
Rank 3
Iron
Iron
Benjamin
Top achievements
Rank 2
Iron
Veteran
Bernd
Top achievements
Rank 4
Bronze
Iron
Iron
minh
Top achievements
Rank 2
Iron
Iron
Iron
Sebastien
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?