Gilbert van Veen
Top achievements
Rank 1
Gilbert van Veen
asked on 21 Apr 2010, 10:31 AM
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).
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).
4 Answers, 1 is accepted
0
Hi Gilbert van Veen,
And then to call the method "ScrollIntoViewAsync()":
I hope this helps.
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.
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);
void RadGridView1_DataLoaded(object sender, System.EventArgs e)
{ this.RadGridView1.ScrollIntoViewAsync(this.RadGridView1.CurrentItem,this.RadGridView1.Columns[40], null);
}
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.
0
Gilbert van Veen
Top achievements
Rank 1
answered on 23 Apr 2010, 01:21 PM
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
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
0
Accepted
Hello Gilbert van Veen,
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.
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.
0
Gilbert van Veen
Top achievements
Rank 1
answered on 23 Apr 2010, 03:54 PM
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
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