11 Answers, 1 is accepted
0
Daní
Top achievements
Rank 1
answered on 05 Aug 2009, 04:31 PM
Hi
any word about this topic?
0
Accepted
Hello DanĂ,
I have created two methods that should help you ensure an item is visible:
The key method is BringIntoView - it will bring into view a given data record. You can get access to the grid's records by using RadGridView.Records collection or retrieve a record from a data item using RadGridView.FindRecord method.
Hope this helps.
Kind regards,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I have created two methods that should help you ensure an item is visible:
private void BrindIntoView(DataRecord record) |
{ |
this.ExpandAllParentGroups(record); |
this.Dispatcher.BeginInvoke( new Action(() => |
this.RadGridView1.ItemsControl.BringDataItemIntoView(record.Data))); |
} |
private void ExpandAllParentGroups(Record record) |
{ |
var currentRecord = record; |
while (currentRecord.ParentGroup != null) |
{ |
currentRecord.ParentGroup.IsExpanded = true; |
currentRecord = currentRecord.ParentGroup; |
} |
} |
The key method is BringIntoView - it will bring into view a given data record. You can get access to the grid's records by using RadGridView.Records collection or retrieve a record from a data item using RadGridView.FindRecord method.
Hope this helps.
Kind regards,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Daní
Top achievements
Rank 1
answered on 07 Aug 2009, 09:16 AM
Thanks Milan,
It works great... but I'm getting a warning in Visual Studio about Record class is obsolete and will not be longer used.
It works great... but I'm getting a warning in Visual Studio about Record class is obsolete and will not be longer used.
0
Hi DanĂ,
We will do our best to provide means (API) for doing the same thing when we obsolete the records API.
All the best,
Ross
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
We will do our best to provide means (API) for doing the same thing when we obsolete the records API.
All the best,
Ross
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Daní
Top achievements
Rank 1
answered on 07 Aug 2009, 10:24 AM
Thanks Ross,
I'm sure you will.
I'm sure you will.
0
Jax
Top achievements
Rank 2
answered on 09 Oct 2009, 01:06 PM
With the new API, is there a replacement for:
DataGrid.SelectedRecord.ParentGroup.IsExpanded = true;
?
DataGrid.SelectedRecord.ParentGroup.IsExpanded = true;
?
0
Hi Malcolm Jack,
In Q3 we will introduce several methods that will allow you to do that without using records. For example:
If you such functionality is required in the current RadGirdView version (Q2 2009) we could possibly introduce those methiods with one of our internal build releases.
Hope this information is helpful.
Kind regards,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
In Q3 we will introduce several methods that will allow you to do that without using records. For example:
var group =
this
.gridView.FindGroupByItem(
this
.gridView.SelectedItem);
this
.gridView.CollapseGroup(group);
// or
this
.gridView.ExpandGroup(group);
If you such functionality is required in the current RadGirdView version (Q2 2009) we could possibly introduce those methiods with one of our internal build releases.
Hope this information is helpful.
Kind regards,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
devster
Top achievements
Rank 1
answered on 22 Oct 2009, 09:18 AM
Using version: 2009 Q2
A related question, consider this scenario:
- ShowGroupPanel set to false
- used a GroupDescriptor to define one grouping that cannot be modified by the user
Goal: expand (only) the first group when the data is loaded.
I tried doing this in the Grouping and Grouped events, but the parentgroups are not set at that time.
In which event is the parent group set of the first record?
A related question, consider this scenario:
- ShowGroupPanel set to false
- used a GroupDescriptor to define one grouping that cannot be modified by the user
Goal: expand (only) the first group when the data is loaded.
I tried doing this in the Grouping and Grouped events, but the parentgroups are not set at that time.
In which event is the parent group set of the first record?
0
Hi dev,
You can easily expand groups by using our ExpandGroup method:
Hope this helps.
Regards,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
You can easily expand groups by using our ExpandGroup method:
public
MainPage()
{
InitializeComponent();
this
.playersGrid.ItemsSource = Club.GetPlayers();
this
.playersGrid.DataLoaded +=
new
System.EventHandler<System.EventArgs>(playersGrid_DataLoaded);
}
void
playersGrid_DataLoaded(
object
sender, System.EventArgs e)
{
// expand the first group
this
.playersGrid.ExpandGroup(
this
.playersGrid.Items.Cast<IGroup>().First());
}
Hope this helps.
Regards,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jax
Top achievements
Rank 2
answered on 19 Nov 2009, 09:34 AM
Milan - I don't seem to see the "grid.FindGroupByItem()" in the new release.
Has this been implemented?
Has this been implemented?
0
Hello Jax,
Greetings,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
This functionality is implemented but unfortunately the class that contains the methods is still internal. We will try to make this helper class publicly available with our latest internal build this Friday.
For the time being you could use the file that I have attached to this post. Just add it to your project and you should be able to search for groups.
private
void
Button_Click(
object
sender, System.Windows.RoutedEventArgs e)
{
var group =
this
.playersGrid.Items.OfType<IGroup>().FindGroupByItem(
this
.playersGrid.Items[0]);
}
Greetings,
Milan
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.