Telerik Forums
UI for WPF Forum
0 answers
85 views

Hi. 

I've tried to use RadDateTimePicker inside RadGridView, but datepicket is not showing (examle from: WPF DateTimePicker - How to use RadDateTimePicker in a Grid - Telerik UI for WPF).  Tried to add control outside grid but without any effect. 

Project is referenced to Telerik.Windows.Data.dll, Telerik.Windows.ControlsTelerik.Windows.Controls.InputTelerik.Windows.Controls.GridView...


<Window x:Class="Test"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"        
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"         
        Title="Test" Height="450" Width="800">
    <Grid>
    
        <telerik:RadDateTimePicker                                 
                                InputMode="DatePicker"
                                telerik:DropDownButtonExtensions.FocusContentOnOpen="True"                              
                                SelectedValue="{Binding Established, Mode=TwoWay}"/>
        
        <telerik:RadGridView Name="radGridView" 
                     AutoGenerateColumns="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Name" 
                                    DataMemberBinding="{Binding Name}" />
                <telerik:GridViewDataColumn Header="Established" 
                                    DataMemberBinding="{Binding Established}">
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <telerik:RadDateTimePicker                                 
                                InputMode="DatePicker"
                                telerik:DropDownButtonExtensions.FocusContentOnOpen="True"
                              
                                SelectedValue="{Binding Established, Mode=TwoWay}"/>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Stadium" 
                                    DataMemberBinding="{Binding StadiumCapacity}" 
                                    DataFormatString="{}{0:N0}" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>

Michał
Top achievements
Rank 1
 asked on 06 Apr 2023
1 answer
76 views

Programmatically i'm selecting cells in RadGridView based on row and column. Search is done by column name and cell value. Grid records binded to the model by record properties. In my case column name could be different from record' property name, ex. translated to another language. Im wonder if there are a way to handle internaly record's column names but show on the grid custom names instead?

Binding is done by behavior:RadGridCustomBindingBehavior.Columns="{Binding GridColumns}", so [DisplayName("CustomColumnName")] is not applyed to the grid

Thank you

Martin Ivanov
Telerik team
 answered on 03 Apr 2023
1 answer
52 views

Hello,

How can I select all expanded/visible rows in a radgridview control, which have been grouped and possibly filtered, even if the rows fall out of view of the window container?

I have a window that contains a radgridview and a button that is outside of the grid which selects or deselects all visible rows in the radgridview. An end user may add multiple groupings and filters. There is a lot of data in the item source, at the time of this test over 3 thousand rows. The resulting data display after the end user has made changes will likely exceed the window containers viewable area. when I implemented the line of code below only the expanded row visible in the window was selected. The expanded rows that I had to scroll down to see were not selected. I would like to select all of the expanded/visible rows.

 var visibleRows = grdBatches.ChildrenOfType<GridViewRow>();

I have read that ChildrenOfType<T> works on visual elements. In another forum question, the answer stated that the use of visual elements is not advised when working with virtualized controls such as the radgridview.


Martin Ivanov
Telerik team
 answered on 24 Feb 2023
0 answers
92 views

In Gridview collection, once collection is loaded from data source, we evaluate some conditions, that depends on previous records. Such that if previous record and current record has same Owner Id, then hide signature of current record i.e. IsVisible=false; else make it visible. 

e.g.

index 0:     {OwnerId = 123, IsVisible=True}        // Index 0 is always true

index 1:      {OnwerId = 123, IsVisible = false}    // Index 1 Owner Id == Index 0 Owner Id

index 2:     {OwnerId = 456, IsVisible = true}   // index 2 Owner id != index 1 Owner Id

Index 3:     {OwnerId = 567,  IsVisible = true}

Index 4:   {OwnerId = 567, IsVisible =  false}

Before using VirtualQueryableCollectionView, we can easily iterate collection, but as VirtualQueryableCollectionView is loading items on demand, therefore I need to iterate collection on each load.

If I implement such evaluation in ItemsLoading or ItemsLoaded event, It hurts performance. I want suitable place, where itemsLoading is completed, new collection is rendered in gridview and then I can iterate collection.

Is it possible in VirtualQueryableCollectionView. Is it right way to handle such situation. What can be alternative.

 

Kamran
Top achievements
Rank 3
Iron
Iron
Veteran
 asked on 28 May 2022
1 answer
109 views

Hi, I have a shapefile from iran in UTM coordinates, I need to add the shape file to WPF, I added the shape file to my C# and XAML but it did not display. how can I resolve this problem ? if I should change the coordinate system, which coordinate system must be choose in Arc Map(GIS)?

C#

        public MainWindow()
        {
            InitializeComponent();
            fillData();
            this.MouseLeftButtonDown += delegate { this.DragMove(); };
            d_table2.ItemsSource = Dmus;
            d_table.ItemsSource = Dmus;
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
        }

        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            xShapeReader.Source = new Uri("shp9/Export_Output_9.shp", UriKind.Relative);
            xShapeReader.DataSource = new Uri("shp9/Export_Output_9.dbf", UriKind.Relative);
        }

XAML

                        <Grid x:Name="LayoutRoot">
                            <telerik:RadMap x:Name="radMap">
                                <telerik:RadMap.Provider>
                                    <telerik:EmptyProvider/>
                                </telerik:RadMap.Provider>
                                <telerik:InformationLayer x:Name="xInfo">
                                    <telerik:InformationLayer.Reader>
                                        <telerik:MapShapeReader x:Name="xShapeReader"/>
                                    </telerik:InformationLayer.Reader>
                                </telerik:InformationLayer>
                            </telerik:RadMap>

                        </Grid>

Martin Ivanov
Telerik team
 answered on 22 Sep 2021
9 answers
368 views
Hi,

I have a requirement to populate high volume of data(>50000 rows) in the gridview. I feel data vitualization/lazy loading is a good way to implement this. If I load 500 records at a time and keep loading while scrolling the content the next set, how can I address the following scenarios :
  • Select All option(for the whole underlying datasource)
  • Sorting, grouping features of the grid(for the whole underlying datasource)
  • Export to excel feature(for the whole underlying datasource)

Assuming all the records are not loaded for the above mentioned scenarios,

Regards,
Anand

Dilyan Traykov
Telerik team
 answered on 15 Aug 2018
3 answers
119 views

Hey guys,

I have a RadGridView in the UI of my application and bind it to a VirtualQueryableCollectionView shown in the example:
https://docs.telerik.com/devtools/wpf/consuming-data/using-data-virtualization
That works fine so far.

Since I have a client/server architecture, it may happen that the server updates the database table collection is "looking" on.

Let's say there are 41 entries in the table after the UI started. Then the server adds one entry to the database. Afterwards the server notifies the client and the client executes "view.Refresh();".

Due to sorting the new entry may appear in the UI BUT the VirtualItemsCount remains 41.

I cannot find any method that allows me to refresh/update the underlying collection so that the collection is synchronized to the database.

Is it possible to achive this behavior or do I have to recreate the VirtualQueryableCollectionView with "view = new VirtualQueryableCollectionView (query);" on each refresh?

 

I appreciate any feedback :)

Dilyan Traykov
Telerik team
 answered on 15 Mar 2018
5 answers
119 views

Hi,

We are using VQCV (Telerik 2016.2.503.40) to virtualize data to RadGridView from the server side to client, sometimes the grid doesn't refresh correctly the new added items (we had a workaround with an explicit call to the .Refresh() function in the end of the data loading routine), unfortunately this causes a freeze of the main Thread on Windows10.

This problem exists also in the telerik Demo panel (see the attached file).

01.Task.Factory.StartNew(() =>
02.{
03.    // Getting data from the server Side
04.    return result;
05. 
06.}).ContinueWith(finLazyLoading =>
07.{
08.   // DataVirtualisationRoutine...
09. 
10.    MyVQCV.VirtualItemCount = collection.ItemsCount;
11. 
12.    MyVQCV.Load(currentOffset, collection.Items);
13. 
14.    // If we call the refresh here it occurs the bug on Win10 (total freeze of the app).
15. 
16.}, TaskScheduler.FromCurrentSynchronizationContext()).ContinueWith(fixwin10 =>
17.{
18.    // This call causes an infinite loop... :(
19.
20.    MyVQCV.Refresh();
21. 
22.}, TaskScheduler.FromCurrentSynchronizationContext());

Can we have a fixe for this please or a working solution, we don't know how to do.

Thank you!

DenisCL
Top achievements
Rank 1
 answered on 30 Jun 2017
0 answers
54 views

Hello,

At this line

  • public DataServiceCollection<CustomerDto> Customers = new DataServiceCollection<CustomerDto>(Container.Customers.IncludeTotalCount());

in the code below i am getting the  ContextSwitchDeadlock exception when loading 100 000 to  VirtualQueryableCollectionView using an OData v4 rest service.  The VirtualQueryableCollectionView  is boud to the ItemsSource of the RadGridControl

If i deactivate ContextSwitchDeadlock in the Exception Settngs of VS2015 it just takes 10 - 15 minutes for the rows "to load". 

Why is this?  

Why the ContextSwitchDeadlock (how would i prevent it)??

I thought the idea of VirtualQueryableCollectionView is that it returns in a jiffy (isnt that what data virtualisation is about?) with a couple hundred rows, and then loads the rest as we scroll.  It shouldnt take 10 - 15 minutes just to start up.

I would like to reactivate ContextSwitchDeadlock Exception Setting in VS2015 and debug without the exception being raised.

Any ideas on how to go about it?

Also i would like to solve the issue of the long load time - that isnt data virtualisation.  What causes it?  How to solve it?  Should i rather use the DataServiceDataSource? Is the VirtualQueryableCollectionView is wrong candidate for loading large quantities of data in small bites?

If a full demo of the VS2015 solution is needed to answer this, you can download here (use the Inserting10000Customers.sql file in it to the Customer SQL Express table with 100 000 rows), at:    https://app.box.com/s/73dufnlkf63se19ehhzfzz6upevbn92m

Hope someone at Telerik or someone who knows answers.

Paul S.

nb. removing IncludeTotalCount() doesnt change the problem.

 

  public partial class MainWindow
    {
        private static readonly Container Container = new Container(new Uri("http://localhost:21026/")); //http://localhost:21026/
        public DataServiceCollection<CustomerDto> Customers = new DataServiceCollection<CustomerDto>(Container.Customers.IncludeTotalCount());
        public MainWindow()
        {
            InitializeComponent();
            IQueryable<CustomerDto> test = Customers.OrderBy(o => o.Name).AsQueryable();
            var source = new VirtualQueryableCollectionView(test) { LoadSize = 1000 };
 
           // source.ItemsLoading += Source_ItemsLoading;
 
            DataContext = source;
 
        }
 
        private void Source_ItemsLoading(object sender, VirtualQueryableCollectionViewItemsLoadingEventArgs e)
        { }
    }
}

 

 

 

<Window x:Class="ODataAndAutoMapper.Telerik.UI.MainWindow"
        xmlns:controls="http://schemas.telerik.com/2008/xaml/presentation"
        mc:Ignorable="d">
    <Grid>
        <controls:RadGridView ItemsSource="{Binding}" FilteringMode="FilterRow"/>
         
    </Grid>
</Window>

Paul Schwartzberg
Top achievements
Rank 1
 asked on 07 Oct 2016
2 answers
96 views

Hi to all,

I'm developing a MVVM Application, I have a global context for application, I have a provider class that exposes me a method that returns a List<MyModel>

MyModel is a class that I use internally in application:

My entityframework context (EF5 & FW4.0) exposes MyTable (this table corresponde to MyModel class).

My provider get IQuarable<MyTable> by linq and convert all items in MyModel, then return List<MyModel>.

Now, If I have a lot of records and I have to show all items into ComboBox, I could user VirtualQueryableCollectionView.

But how can I use List<MyModel> to do this? I will get the same result?

Dario Concilio
Top achievements
Rank 2
 answered on 03 May 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?