Completed
Last Updated: 17 Nov 2015 13:04 by Longnd
ADMIN
George
Created on: 14 Feb 2014 12:17
Category: GridView
Type: Bug Report
0
FIX. RadGridView - HtmlViewDefinition causes the horizontal scrollbar to have invalid maximum value
To reproduce:

Add a RadGridView to a form, dont dock it. Use the following code to add the rows, columns and the definition:



this.Grid.Columns.Add("Old");
this.Grid.Columns.Add("New");

Start the application and you will see that you cannot scroll to the end, horizontally.



Workaround:

Use the following code on a button click or execute it in a timer a few millisecond after the form has loaded in order to update the scrollbar's maximum value accordingly:



int width = 0;
foreach (var col in this.Grid.Columns)
{
    width += col.Width;
}


this.Grid.TableElement.HScrollBar.Maximum = width - this.Grid.TableElement.HScrollBar.SmallChange - this.Grid.TableElement.RowHeaderColumnWidth;

3 comments
Longnd
Posted on: 09 Oct 2015 14:20
 need this fix also
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 06 Mar 2015 08:48
Hello John,

Thank you for writing.

You can subscribe to the RadGridView.TableElement.HScrollBar.ScrollParameterChanged event and adjust the TableElement.HScrollBar.Maximum as it is demonstrated in the suggested workaround.
John
Posted on: 03 Mar 2015 20:05
The work around fixes the problem when the form first comes up, but if the user resizes any of the columns (and probably other actions on the grid) it breaks again.