This is a migrated thread and some comments may be shown as answers.

BringDataItemIntoView scrolling

5 Answers 178 Views
GridView
This is a migrated thread and some comments may be shown as answers.
NS
Top achievements
Rank 1
NS asked on 27 Feb 2009, 10:00 AM
Hi,

I'm using BringDataItemIntoView to go to the item i reselect after i refresh my grid.

But now i have a problem with when you select an item in the grid that is already visible (no scrolling required) and there aren't enough items to make the grid scroll.

So what happens the grid sets the selected item to the first row visible and the records above aren't shown any more and there isn't a scrollbar visible.

For example
If you have 3 records in the grid and you call the method BringDataItemIntoView on the third record, then this will put the 3 record to the first visible record in the grid but the 2 records above aren't visible any more and there also isn't a scrollbar (using the mouse wheel does the trick for scrolling)

Any ideas how i can fix this?

My code to bring the currentitem in to view
                        int logId = 0;  
 
                        if (radGridDocuments.CurrentItem != null)  
                            logId = (radGridDocuments.CurrentItem as DocumentLog).LogId;  
 
                        Mouse.OverrideCursor = Cursors.Wait;  
                        btnDocumentsForTruck.IsChecked = false;  
 
                        fillDocumentLog(((PrintShop.Data.Action)dtcDocumentType.SelectedItem).Name, txtCustomerName.Text, dtpFrom.SelectedDate, dtpTo.SelectedDate, txtDocumentNumber.Text, (dtcSender.SelectedItem as Sender).SenderId);  
 
                        if (logId != 0)  
                        {  
                            DocumentLog d = (radGridDocuments.ItemsSource as BindingList<DocumentLog>).FirstOrDefault(x => x.LogId == logId);  
 
                            if (d != null)  
                            {  
                                Record record = radGridDocuments.FindRecord(d);  
                                record.IsSelected = true;  
                                record.IsCurrent = true;  
 
                                radGridDocuments.BringDataItemIntoView(radGridDocuments.CurrentItem);  
                            }  
                        } 

5 Answers, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 03 Mar 2009, 12:44 PM
Hello NS,

Unfortunately, this is a bug in RadGridView. Thanks for reporting it -- I have updated your Telerik points.
The fix does not seems like it would affect a lot of areas of the control, and it is going to make it in the upcoming Q1 2009 release. The release should be officially out in a week or two.

I am sorry for the inconveniences this may cause.

Greetings,
Jordan
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
pajesz
Top achievements
Rank 1
answered on 26 Jun 2009, 08:58 AM
Hi,

How can I fix that problem, if that record is ExpandableDataRecord, and I would like to bring to view not only the master record, but also the expanded content (content of the HierarchyChildTemplate).
My code looks like this, but in the result, only the master record is shown in the bottom of the list:
  var foundRecord = listGridView.FindRecord(entity); 
  if (foundRecord != null)  
  { 
    foundRecord.IsCurrent = true
    foundRecord.IsSelected = true
    if (foundRecord is ExpandableDataRecord) 
      ((ExpandableDataRecord)foundRecord).IsExpanded = true
    listGridView.BringDataItemIntoView(listGridView.CurrentItem); 
  } 
 
Thanks,
  Tibor


0
Rossen Hristov
Telerik team
answered on 01 Jul 2009, 02:04 PM
Hello pajesz,

Currently this is not supported but we will log it and will try to implement it as soon as possible.

Please, excuse us for any inconvenience that we might have caused.

Kind regards,
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
riki riki
Top achievements
Rank 1
answered on 13 May 2010, 07:56 AM
Hi.
I want to use this function - BringDataItemIntoView, but it does not exist in RadGridview. Maybe this function is not supported in the newer version. We use the latest version. Which alternative function can I use?
0
Vlad
Telerik team
answered on 13 May 2010, 07:59 AM
Hi,

You can use ScrollIntoView() method instead

All the best,
Vlad
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.
Tags
GridView
Asked by
NS
Top achievements
Rank 1
Answers by
Jordan
Telerik team
pajesz
Top achievements
Rank 1
Rossen Hristov
Telerik team
riki riki
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or