Telerik Forums
UI for Universal Windows Platform Forum
1 answer
14 views

Hello,

I'm using the bar series in my UWP app:

The code behind:

        public class LineChartData
        {
            public int Value { get; set; }
            public string Name { get; set; }
        }

        public ObservableCollection<LineChartData> ParticipationData { get; set; } = new ObservableCollection<LineChartData>();

 

The XAML code:

                            <telerik:RadCartesianChart Name="dgrm_1" PaletteName="DefaultLight" Height="250">
                                <telerik:RadCartesianChart.HorizontalAxis>
                                    <telerik:CategoricalAxis/>
                                </telerik:RadCartesianChart.HorizontalAxis>
                                <telerik:RadCartesianChart.VerticalAxis>
                                    <telerik:LinearAxis/>
                                </telerik:RadCartesianChart.VerticalAxis>
                                <telerik:RadCartesianChart.Grid>
                                    <telerik:CartesianChartGrid MajorLinesVisibility="Y" StripLinesVisibility="Y"/>
                                </telerik:RadCartesianChart.Grid>
                                <telerik:BarSeries Name="dgrm_1_bar" ItemsSource="{x:Bind Path=ParticipationData}">
                                    <telerik:BarSeries.ValueBinding>
                                        <telerik:PropertyNameDataPointBinding PropertyName="Value"/>
                                    </telerik:BarSeries.ValueBinding>
                                    <telerik:BarSeries.CategoryBinding>
                                        <telerik:PropertyNameDataPointBinding PropertyName="Name"/>
                                    </telerik:BarSeries.CategoryBinding>
                                </telerik:BarSeries>
                            </telerik:RadCartesianChart>

 

When I'm loading this page the first time the chart is loading without problems. But if I navigate to another page and then back to the page with the chart there's no displayed but only the message "No data found".

But I've ensured that the data is loaded to the ObservableCollection "ParticipationData" and if I check the values of the ItemsSource of the BarSieries then I can see the data of the ObservableCollection. So I think that only the UI is not refreshed. I've also tried the "UpdateLayout"-method. But this also not works.

 

Does someone has an idea what I can do?

 

Thank you in forward.

 

Best regards

Matthias

Lance | Manager Technical Support
Telerik team
 answered on 04 Sep 2019
2 answers
14 views

Hello!

I'm using a datagrid bound to an observable collection with AutoGenerateColumns mode.
I found bug. Description is here:
1) DataGrid bounded to object with 5 properties, so datagrid will have 5 columns.
2) When i start apllication, I set 4 columns to true, 1 last column to false.

3) I open ColumnChooser and set last column visible check box to True. It is ok. Instantly last column will be appeared in the table.

4) Problem is here: If I click some column to header and sorting method will be called -> my datagrid will be sorted but last column will disapper. And if I open columChooser i will see that CheckBox of last column is uncheched. As result I get sorted grid without all columns, which I add by columnChooser.

I don't know how to fix this. Can you help me with that ?

I attached sample project with this issue. Link: https://dropmefiles.com/ihHqU

Thank you,

Petr

Petr
Top achievements
Rank 1
 answered on 28 Aug 2019
4 answers
11 views
Hello,

I'm using a datagrid bound to an observable collection(autogenerate columns mode).
I need to set all Column Filters to case insensetive mode(when user open filter of string column, case-sensetive mode will be off). I tryed to find it in documantation and here, but without any result. Please, can you help me.

Thanks a lot,

Petr
Petr
Top achievements
Rank 1
 answered on 20 Aug 2019
11 answers
45 views

I am trying to use the chart control in multiple views: Meaning not just one window. I create several windows from the main windows. It is not call "windows". It is views.

It looks like the chart control fails:

 

System.Exception: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))
   at Windows.UI.Xaml.Media.SolidColorBrush.get_Color()
   at Telerik.UI.Xaml.Controls.Chart.ContainerVisualsFactory.ChangeBrushesAccordingToAppTheme()
   at Telerik.UI.Xaml.Controls.Chart.ContainerVisualsFactory.PrepareCartesianAxisLineVisual(CartesianAxis axis, ContainerVisual lineContainer, RadRect layoutSlot, AxisType axisType)
   at Telerik.UI.X

 

Is there a way to fix it ?

 

to understand the concept of multiple views:

 

https://docs.microsoft.com/en-us/windows/uwp/design/layout/show-multiple-views

 

please advise me...

Rodolfo
Top achievements
Rank 1
 answered on 14 Aug 2019
2 answers
11 views

Hi Progress,

I have a read-only RadMap (ie no selection changing by mouse/touch) where the selected shape is chosen following selection of an item in a ListView.  I have configured a MapShapeStyleSelector as per the instructions in [ShapeStyleSelector](https://docs.telerik.com/devtools/universal-windows-platform/controls/radmap/styling/shapestyling#shapestyleselector).

I originally coded the app using a main Page for the ListView and a separate Page for the map: when the user changed the selection in the Main Page and navigated back to the Page with the map, the newly selected shape was Styled according to the MapShapeLayer's ShapeStyleSelector.

I have since changed to use only one Page, and the ListView is now contained in a RadSideDrawer on the page.  The map correctly styles the shape when it is first chosen.  However, when the user opens the side-drawer and selects a different item, while the map still correctly updates ZoomLevel and Center to show the newly selected shape, it doesn't call SelectStyleCore in the MapShapeStyleSelector to style it.

How do I call a MapShapeLayer's SelectStyleCore when the user changes the selection in a ListView in the Page's side-drawer?

 

mc
Top achievements
Rank 1
 answered on 12 Aug 2019
3 answers
19 views

Hi
I have been trying to get your DataGridComboBox working correctly in a RadDataGrid when using the default external editor (UserEditMode="External").
To help illustrate my point I have amended one of your DataGridUWP examples with a simple combobox binding.
I have used different methods of binding with differing results and have commented the example code below.
I seem to be able to either get the data in the grid or in the edit combobox, but can never get the correct item to be selected in the combobox on edit.

Many thanks.

Paul

Code follows:
<----------------------------------xaml-------------------------------

<Page
    x:Class="DataGridUWP.MainPage"
    xmlns:local="using:DataGridUWP"
    xmlns:telerikgrid="using:Telerik.UI.Xaml.Controls.Grid"
    mc:Ignorable="d">
    <Page.Resources>
        <CollectionViewSource x:Key="options" Source="{x:Bind cbOptions}"/>
    </Page.Resources>
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
         
        <telerikgrid:RadDataGrid ItemsSource="{x:Bind data}" x:Name="dataGrid"
           UserEditMode="External"
           AutoGenerateColumns="False" >
 
            <telerikgrid:RadDataGrid.Columns>
                <telerikgrid:DataGridTextColumn PropertyName="Name" />
 
                <!--Displays in grid. Doesn't display items in drop down-->
                <telerikgrid:DataGridComboBoxColumn PropertyName="Col1" x:Name="Col1"             
                          ItemsSource="{Binding Source={StaticResource options}}"                                   
                          DisplayMemberPath="Name" />
 
                <!--Displays in grid. Doesn't display items in drop down-->
                <telerikgrid:DataGridComboBoxColumn PropertyName="Col2" x:Name="Col2"              
                          ItemsSource="{Binding cbOptions}"                                   
                          DisplayMemberPath="Name"/>
 
                <!--Displays in grid. Displays items in drop down but empty selection-->
                <telerikgrid:DataGridComboBoxColumn ItemsSource="{x:Bind cbOptions}"
                                           PropertyName="Col3" x:Name="Col3"    
                                           DisplayMemberPath="Name" />
 
                <!--Doesn't display correctly in grid. Displays items in drop down, but only with default selected-->
                <telerikgrid:DataGridComboBoxColumn ItemsSource="{x:Bind cbOptions}"
                                           PropertyName="Col4" x:Name="Col4"    
                                           DisplayMemberPath="Name" SelectedValuePath="Col4"/>
 
            </telerikgrid:RadDataGrid.Columns>
        </telerikgrid:RadDataGrid>
    </Grid>
</Page>

 

<-----------------------------------------cs---------------------------------------------

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
 
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
 
namespace DataGridUWP
{
 
    public sealed partial class MainPage : Page
    {
        public ObservableCollection<cbOption> cbOptions { get; set; }
        public List<Data> data { get; set; }
        public MainPage()
        {           
            this.InitializeComponent();
 
            this.cbOptions = new ObservableCollection<cbOption>()
            {
                new cbOption(){ Id = 1, Name = "Option1"},
                new cbOption(){ Id = 2, Name = "Option2"}
            };
 
            this.data = new List<Data>()
            {   new Data() { Name = "Row1", Col1 = new cbOption(){Id=1,Name="Option1"},Col2 = new cbOption(){Id=2,Name="Option2"},Col3 = new cbOption(){Id=1,Name="Option1"},Col4 = new cbOption(){Id=2,Name="Option2" } },
                new Data() { Name = "Row2", Col1 = new cbOption(){Id=2,Name="Option2"},Col2 = new cbOption(){Id=2,Name="Option2"},Col3 = new cbOption(){Id=2,Name="Option2"},Col4 = new cbOption(){Id=1,Name="Option1" } },
                new Data() { Name = "Row3", Col1 = new cbOption(){Id=2,Name="Option2"},Col2 = new cbOption(){Id=2,Name="Option2"},Col3 = new cbOption(){Id=2,Name="Option2"},Col4 = new cbOption(){Id=2,Name="Option2" } },
            };      
        }
    }
 
    public class Data
    {
        public string Name { get; set; }
        public cbOption Col1 { get; set; }
        public cbOption Col2 { get; set; }
        public cbOption Col3 { get; set; }
        public cbOption Col4 { get; set; }
    }
 
    public class cbOption
    {
        public int Id { get; set; }
        public string Name { get; set; }
    }
}

 

Yana
Telerik team
 answered on 08 Aug 2019
6 answers
11 views

Hi,

according to the documentation, the RadLoopingList has 2 events: SelectedIndexChanged and ScrollCompleted.

But the ScrollCompleted event doesn't know the control! How do I know ScrollCompleted?

Thank you
Jörg

Jörg
Top achievements
Rank 1
 answered on 06 Aug 2019
3 answers
17 views

Hi, I have a RadMap with separate ShapeLayers for boundaries and roads.  I would like to toggle the display of the roads. How do I do this with UI for UWP?

I tried binding the Visibility of the MapShapeLayer to a VM property.  This seems to allow me to turn visibility 'on' (show the ShapeLayer), but not off again.  

I have found I **can** toggle the Visibility of the entire RadMap using binding.  Is the only way to have two maps (one with the boundaries ShapeLayer and one with both boundaries and roads) in order to toggle the display of a ShapeLayer?

Many thanks

 

mcalex

Yana
Telerik team
 answered on 05 Aug 2019
6 answers
48 views

I create a 16299 UWP project and use DateView as ItemsSource for DataGrid. But the UI cannot show the data.

<my:RadDataGrid x:Name="dataGrid" AutoGenerateColumns="False" >
 </my:RadDataGrid>
public sealed partial class MainPage : Page
    {
        private ObservableCollection<Dictionary<string, string>> items = new ObservableCollection<Dictionary<string, string>>();
 
        public ObservableCollection<Dictionary<string, string>> ItemDictionary
        {
            get
            {
                return items;
            }
            set
            {
                items = value;
            }
        }
 
        public DataTable Items { get; set; }
        public MainPage()
        {
            this.InitializeComponent();
            CreateItems();
            CreateTable();
        }
 
        private void CreateItems()
        {
            for (int i = 0; i < 5; i++)
            {
                Dictionary<string, string> row = new Dictionary<string, string>();
                row["A"] = "A" + i.ToString();
                row["B"] = "B" + i.ToString();
                row["C"] = "C" + i.ToString();
 
                ItemDictionary.Add(row);
 
            }
        }
 
        private void CreateTable()
        {
            Items = new DataTable();
 
            if (ItemDictionary.Count == 0) return;
 
            foreach (KeyValuePair<string, string> entry in ItemDictionary[0])
            {
                DataColumn column = new DataColumn(entry.Key);
                Items.Columns.Add(column);
                Telerik.UI.Xaml.Controls.Grid.DataGridTextColumn dgc = new Telerik.UI.Xaml.Controls.Grid.DataGridTextColumn();
                dgc.Name = entry.Key;
                dgc.Header = entry.Key;
                dgc.PropertyName = entry.Key;
                dataGrid.Columns.Add(dgc);
            }
 
            foreach (Dictionary<string, string> rowEntry in ItemDictionary)
            {
                DataRow row = Items.NewRow();
                int col = 0;
                foreach (KeyValuePair<string, string> entry in rowEntry)
                {
                    row[entry.Key] = entry.Value;
                }
                Items.Rows.Add(row);
            }
            DataView dv = Items.DefaultView;
            dataGrid.ItemsSource = dv;
        }
    }
Lance | Manager Technical Support
Telerik team
 answered on 02 Aug 2019
0 answers
11 views

Is there a property that I can set to turn this behavior off? If I click on the a resize handle, even if I do not resize, the grid scrolls back to the beginning. Therefore, if the whole grid won't fit on the screen without horizontal scrolling, the user won't be able to resize columns that are only visible by scrolling to the right. As soon as they click on the resize handle, the grid scrolls back to the beginning and the column they are trying to resize if off screen.

My code for the table looks like this:

<tg:RadDataGrid

RelativePanel.Below="ColumnsVisibleCheckboxes"

RelativePanel.AlignLeftWithPanel="True"

RelativePanel.AlignRightWithPanel="True"

ColumnDataOperationsMode="Flyout"

x:Name="grid" ItemsSource="{x:Bind ViewModel.Source}"

AutoGenerateColumns="False"

VerticalAlignment="Stretch"

GridLinesVisibility="Both" GridLinesBrush="LightGray"

GridLinesThickness="1" AlternationStep="2"

AlternationStartIndex="0" RowBackground="#3D3B3B"

AlternateRowBackground="#3A494F"

UserEditMode="Inline"

SelectionMode="Extended"

ColumnResizeHandleDisplayMode="Always"

UserGroupMode="Auto"

ScrollViewer.VerticalScrollMode="Auto"

ScrollViewer.VerticalScrollBarVisibility="Auto"

ScrollViewer.HorizontalScrollMode="Auto"

ScrollViewer.HorizontalScrollBarVisibility="Auto">

Thanks for your help!

Matthew
Top achievements
Rank 1
 asked on 23 Jul 2019
Top users last month
Bernd
Top achievements
Rank 2
Iron
Iron
Iron
Benedikt
Top achievements
Rank 2
Iron
Veteran
Iron
Richard
Top achievements
Rank 2
Iron
Iron
Iron
Peter
Top achievements
Rank 1
Veteran
Iron
Salma
Top achievements
Rank 1
Iron