FirstVisible column property

5 posts, 1 answers
  1. Gilbert van Veen
    Gilbert van Veen avatar
    68 posts
    Member since:
    Oct 2009

    Posted 21 Apr 2010 Link to this post

    Hi,

    I have a grid with more then 100 columns. The order of the columns may not be changed and therefor it is always the same.

    But is it possible to set the first visible column of the grid? In other words, I have 100 columns and when the grid opens I want to scroll automatically to, lets say, column 40. In other words column 40 should be the first column (on the left). (So to scrollbar is also moved).

  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 23 Apr 2010 Link to this post

    Hi Gilbert van Veen,

    You can use the method of the RadGridView "ScrollIntoViewAsync()". 
    Firstly, you need to define an Event Handler for the DataLoaded event:
    this.RadGridView1.DataLoaded += new System.EventHandler<System.EventArgs>(RadGridView1_DataLoaded);

    And then to call the method "ScrollIntoViewAsync()":
    void RadGridView1_DataLoaded(object sender, System.EventArgs e)
    {            this.RadGridView1.ScrollIntoViewAsync(this.RadGridView1.CurrentItem,this.RadGridView1.Columns[40], null);
    }


    I hope this helps.

     

    Sincerely yours,
    Maya
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Gilbert van Veen
    Gilbert van Veen avatar
    68 posts
    Member since:
    Oct 2009

    Posted 23 Apr 2010 Link to this post

    Maya,

    Many thanks for your response.

    The suggestion worked nicely accept that is not quite what I ment. I need a option, which "moves" the grid (scrollbar) so that the column is shown as first column on the left. (And not reorder columns etc.).

    I must agree that with your option I can make a workaround but I will suggest that Telerik could make a property per column which indicates that the specific column should be the first displayed.

    Gilbert
  5. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 23 Apr 2010 Link to this post

    Hello Gilbert van Veen,

    Indeed, it would be probably a good idea to have a Property for the order of the displayed columns.

    For the time being, you may create your own custom DependencyProperty  which is associated with the functionality you want to implement. Once defined, this Property may be used on every RadGridView in your application. 

    In the sample project attached, there is a Class that defines the ScrollBehavior of the Grid and  the first column to be displayed on the left is defined in xaml as:

    <local:ScrollBehavior FirstVisibleColumnIndex="3"/>

    I hope this helps.

    Greetings,
    Maya
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Gilbert van Veen
    Gilbert van Veen avatar
    68 posts
    Member since:
    Oct 2009

    Posted 23 Apr 2010 Link to this post

    Maya,

    Thanks this is a nice solution and I will going to use it.

    I hope Telerik will enhance their product with a "Out of the box" FirstVisibleColumn property. (I will see me Telerik points growing :) )

    Thanks,

    Gilbert
Back to Top
DevCraft banner