Declined
Last Updated: 20 Mar 2014 07:21 by ADMIN
ADMIN
Georgi I. Georgiev
Created on: 06 Dec 2013 02:01
Category: GridView
Type: Bug Report
1
FIX. RadGridView - Adding new rows on scrollbar's ValueChanged does not refresh the scrollbar when arrow navigation is used
To reproduce:

Add a RadGridView and bind it to a DataTable.

Subscribe to the TableElement's vertical scroll's ValueChanged event and add new data when the value reaches the maximum:

private void RequestData(int startFrom, int count) { for (int i = 0; i < count; i++) { DataRow row = dt.NewRow(); row["ID"] = startFrom + i; dt.Rows.Add(row); } } private void VScrollBar_ValueChanged(object sender, EventArgs e) { if (dgwData.TableElement.VScrollBar.Value + dgwData.TableElement.VScrollBar.LargeChange >= dgwData.TableElement.VScrollBar.Maximum) { int maxVScrollBarBefore = dgwData.TableElement.VScrollBar.Maximum; dgwData.SelectionChanged -= dgwData_SelectionChanged; dgwData.TableElement.VScrollBar.ValueChanged -= VScrollBar_ValueChanged; RequestData(dt.Rows.Count, rowsToCharge); dgwData.SelectionChanged += dgwData_SelectionChanged; dgwData.TableElement.VScrollBar.ValueChanged += VScrollBar_ValueChanged; } }

You will notice that when you use the mousewheel the scrollbar is being updated, but when you use the arrows it is not.

Workaround: Invoke the UpdateScrollRange method of the TableElement's RowScroller after adding the new data: dgwData.TableElement.RowScroller.UpdateScrollRange();
1 comment
ADMIN
Ralitsa
Posted on: 20 Mar 2014 07:20
Resolution: 

RadGridView is not designed to support this case. To extend RadGridView we should done huge amount of core changes which will lead to totally exchange of the behavior and functionality of the control. That is why, we consider that these changes will be more harmful than useful for our clients. We do not have purpose to support this case.

However, if you want to achieve the desired behavior you can use the suggest workaround:  

dgwData.TableElement.RowScroller.UpdateScrollRange();