Canuserfreezecolumns and columns visibility

6 posts, 0 answers
  1. Mike
    Mike avatar
    79 posts
    Member since:
    Nov 2011

    Posted 28 Aug 2012 Link to this post

    Hi, 

    When I set canuserfreezecolumns property to true, and want to hide one or many columns programmatically by doing this : myGrid.Columns["1"].IsVisible = false; it takes a long time to be rendered. Can some one tell me why please?

    thanks for help.
  2. Mike
    Mike avatar
    79 posts
    Member since:
    Nov 2011

    Posted 29 Aug 2012 Link to this post

    Can someone help me please !
  3. Yoan
    Admin
    Yoan avatar
    1182 posts

    Posted 29 Aug 2012 Link to this post

    Hello Radouan,

     Unfortunately I was not be able to reproduce the problem you described. For your convenience I have prepared a sample project demonstrating test. Please, find it attached and let me know in case you need further assistance. 

    All the best,
    Yoan
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  4. Mike
    Mike avatar
    79 posts
    Member since:
    Nov 2011

    Posted 29 Aug 2012 Link to this post

    Hi, 
    Thanks for reply, but...
    I thought I posted in the wrong place. Your sample is a WPF project.
    I forgot one thing, I enabled EnableColumnVirtualization & EnableRowVirtualization and it works fine. But I need to disable these properties to resolve an other performance problem. When EnableColumnVirtualization  &  EnableRowVirtualization  are enabled, then Expander is not fluid. I think that it's due to GridView resizing.

    this is my code:
    <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <telerik:RadSlider>
                <!--My options UI -->
            </telerik:RadSlider>
            <telerik:RadGridView>
                <!--my columns-->
            </telerik:RadGridView>
        </Grid>


    How can I do ?

    Thanks for help.

  5. Mike
    Mike avatar
    79 posts
    Member since:
    Nov 2011

    Posted 30 Aug 2012 Link to this post

    Hello, 

    I can't upload a projet as attachement. I post a sample code here.

    Mainpage.xaml
    <UserControl
        x:Class="SilverlightApplication1.MainPage"
        Width="640" Height="480" KeyDown="UserControl_KeyDown">
     
        <Grid x:Name="LayoutRoot" Background="White">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
             
             
            <telerik:RadExpander>
                <Canvas Height="200"/>
            </telerik:RadExpander>
            <telerik:RadGridView EnableColumnVirtualization="True" EnableRowVirtualization="True" x:Name="gridView" Grid.Row="1"/>
             
             
        </Grid>
    </UserControl>


    MainPage.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
     
    namespace SilverlightApplication1
    {
        public partial class MainPage : UserControl
        {
            public MainPage()
            {
                // Required to initialize variables
                InitializeComponent();
                 
                Init();
            }
     
            public void Init(){
             
                var itemSource  = new List<entity>();
                 
                for(int i=0; i<200; i++)
                    itemSource.Add(new entity{
                        value1 = i.ToString(),
                        value2 = i.ToString(),
                        value3 = i.ToString(),
                        value4 = i.ToString(),
                        value5 = i.ToString(),
                        value6 = i.ToString(),
                        value7 = i.ToString(),
                        value8 = i.ToString(),
                        value9 = i.ToString(),
                        value10 = i.ToString(),
                        value11= i.ToString(),
                        value12= i.ToString(),
                        value13 = i.ToString(),
                        value14= i.ToString(),
                        value15 = i.ToString(),
                    });
                 
                gridView.ItemsSource = itemSource;
            }
             
            private void UserControl_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
            {
                for(int i=0;i<9; i++)
                    gridView.Columns[i].IsVisible = !gridView.Columns[i].IsVisible;
            }
             
            public class entity{
             
            public string value1 {get;set;}
            public string value2 {get;set;}
            public string value3 {get;set;}
            public string value4 {get;set;}
            public string value5 {get;set;}
            public string value6 {get;set;}
            public string value7 {get;set;}
            public string value8 {get;set;}
            public string value9 {get;set;}
            public string value10 {get;set;}
            public string value11 {get;set;}
            public string value12 {get;set;}
            public string value13 {get;set;}
            public string value14 {get;set;}
            public string value15 {get;set;}
            }
        }
    }


    this code reproduce the issue. I believe that I must enable Virtualization to importe performance, but when it is enabled, then expander is not fluid.


  6. Yoan
    Admin
    Yoan avatar
    1182 posts

    Posted 30 Aug 2012 Link to this post

    Hello Radouan,

     You can open a support ticket in order to attach a sample project. However, I could not reproduce any problem with the code you provide as you can see in this video. It is expected for RadGridView or RadExpander to be slow when you do not use virtualization. For more information about UI virtualization 
    please check this article.

    Regards,
    Yoan
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top