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

RadGridView - LargeChange Error for GridViewComboBoxColumn and Grouping?

3 Answers 153 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kevin White
Top achievements
Rank 2
Kevin White asked on 23 Dec 2009, 09:10 PM
I recently upgraded my project to RadControls for WinForms Q3 2009 SP1 and now due to the following errors my application will not even open. 

I get the following error whenever I try to set the ValueMember of a GridViewComboBoxColumn. The model I am using has a string for the text Display Member and an integer for the ValueMember. Other GridViewComboBoxColumns where I use a string and a string are not having this issue?

Value of '-2' is not valid for 'LargeChange'. 'LargeChange' must be greater than or equal to 0.
Parameter name: LargeChange
   at Telerik.WinControls.UI.RadScrollBarElement.set_LargeChange(Int32 value)
   at Telerik.WinControls.UI.GridTableElement.UpdateVScrollBarVisibility(SizeF bodySize)
   at Telerik.WinControls.UI.GridTableElement.UpdateChildViewHeight(Int32 delta)
   at Telerik.WinControls.UI.GridTableElement.Update_OperationChanged(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.UI.GridTableElement.UpdateCore(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.UI.GridViewTemplate.UpdateUI(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.Data.DataAccessComponent.FilterExpressionChanged2()
   at Telerik.WinControls.UI.GridViewDataColumn.set_DataType(Type value)
   at Telerik.WinControls.UI.GridViewLookUpColumn.SetFieldDescriptors()
   at LeaseTracker.Views.TrackerGrid.InitializeIsSBAN() in F:\Projects\LeaseTracker\LeaseTrackerProj\LeaseTracker\Views\TrackerGrid.cs:line 1004
   at LeaseTracker.Views.TrackerGrid.InitializeGridDropDowns() in F:\Projects\LeaseTracker\LeaseTrackerProj\LeaseTracker\Views\TrackerGrid.cs:line 956
   at LeaseTracker.MainForm.PopulateGrid(String name) in F:\Projects\LeaseTracker\LeaseTrackerProj\LeaseTracker\MainForm.cs:line 448
   at LeaseTracker.MainForm.OnTabSelected(Object sender, TabEventArgs args) in F:\Projects\LeaseTracker\LeaseTrackerProj\LeaseTracker\MainForm.cs:line 436
   at Telerik.WinControls.UI.TabEventHandler.Invoke(Object sender, TabEventArgs args)
   at Telerik.WinControls.UI.RadTabStripElement.RaiseTabSelected(RadElement tab)
   at Telerik.WinControls.UI.RadTabStripElement.SetIsSelected(RadElement childElement, Boolean value)
   at Telerik.WinControls.UI.RadTabStripElement.SetSelectedTab(RadElement tabElement)
   at Telerik.WinControls.UI.TabItem.set_IsSelected(Boolean value)
   at LeaseTracker.MainForm.InitializeComponent() in F:\Projects\LeaseTracker\LeaseTrackerProj\LeaseTracker\MainForm.Designer.cs:line 514
   at LeaseTracker.MainForm..ctor() in F:\Projects\LeaseTracker\LeaseTrackerProj\LeaseTracker\MainForm.cs:line 39
 

Pseudo Code below shows the lines where this is occur and sample model I refer to above : 
 
private void InitializeTechnology () { 
    IList<DropDownIntItem> ddList = ListTechnology(); 
    this.TechnologyColumn.DataSource = ddList; 
    this.TechnologyColumn.DisplayMember = "Name"
    this.TechnologyColumn.ValueMember = "ID"// ERRORS HERE 
 
// ~~~ // 
 
public class DropDownIntItem { 
    private string _name; 
    private int _id; 
 
    public DropDownIntItem(int id, string nam) { 
        this._name = nam; 
        this._id = id; 
    } 
 
    public string Name { 
        get { return _name; } 
    } 
 
    public int ID { 
        get { return _id; } 
    } 


======================================================================

Even if I comment out all the ValueMember items being set for the various combobox columns I still receive the same error on the following line of code later in the process:

this.gridView.MasterGridViewTemplate.GroupByExpressions.Clear(); 

   
Value of '-2' is not valid for 'LargeChange'. 'LargeChange' must be greater than or equal to 0.
Parameter name: LargeChange
   at Telerik.WinControls.UI.RadScrollBarElement.set_LargeChange(Int32 value)
   at Telerik.WinControls.UI.GridTableElement.UpdateVScrollBarVisibility(SizeF bodySize)
   at Telerik.WinControls.UI.GridTableElement.UpdateChildViewHeight(Int32 delta)
   at Telerik.WinControls.UI.GridTableElement.Update_GroupingChanged(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.UI.GridTableElement.UpdateCore(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.UI.GridViewTemplate.UpdateUI(GridUINotifyAction action, GridViewRowInfo[] rowInfos)
   at Telerik.WinControls.Data.ExpressionHelper.GroupByExpressionsChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.Data.ExpressionFieldCollection`1.NotifyListenersCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionReset(IList oldItems)
   at Telerik.WinControls.Data.ObservableCollection`1.ClearItems()
   at Telerik.WinControls.Data.ItemObservableCollection`1.ClearItems()
   at System.Collections.ObjectModel.Collection`1.Clear()
   at LeaseTracker.Views.TrackerGrid.LoadGridData() in F:\Projects\LeaseTracker\LeaseTrackerProj\LeaseTracker\Views\TrackerGrid.cs:line 1057


   
   
NOTE : I was having similar errors with LargeChange here -> http://www.telerik.com/community/forums/winforms/forms-and-dialogs/minimizing-radform-largechange-error.aspx
I have not had time to reproduce this in a smaller application as yet, but they may be linked so I am referencing it here just in case.

3 Answers, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 28 Dec 2009, 10:07 AM
Hi Kevin White,

I have tried to reproduce the issue, but unfortunately I cannot figure out the problem having only the provided information. Could you please send me a sample project demonstrating the problem?

Greetings,
Svett
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
Jason Morris
Top achievements
Rank 1
answered on 30 Dec 2009, 10:23 PM
I was just fighting this exact problem.  Spelunking through the Telerik code, I found our problem was because I had the VerticalScrollState on the grid MasterGridViewTemplate set to AlwaysShow.  Set it to AutoHide and the problem goes away.  (And the Property Builder will open now as well, for an added bonus)

The problem is in GridTableElement.cs (line 2110 or so):

 

 

            if ((scrollableHeight > 0 && scrollableHeight < this.vscrollBar.Maximum)  
                || this.ViewTemplate.VerticalScrollState == ScrollState.AlwaysShow)  
            {  
                this.vscrollBar.Visibility = ElementVisibility.Visible;  
                this.vscrollBar.LargeChange = (int)scrollableHeight;  
                this.vscrollBar.SmallChange = firstRowHeight;  
                return true;  
            }  
 

If AlwaysShow is enabled then the scrollableHeight can be less than 0, and trying to set this.vscrollBar.LargeChange to something less than 0 will cause the exception.

Now, if Telerik could fix this that would be great, because I kinda liked my AlwaysShow vertical scroll bars....

Jason

 



0
Svett
Telerik team
answered on 04 Jan 2010, 01:33 PM
Hi Jason Morris,

Thank you for your effort. We are happy that you located the problem on your own. The issue is addressed in the next internal build. Let us know, if you need further assistance.

Kind regards,
Svett
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.
Tags
General Discussions
Asked by
Kevin White
Top achievements
Rank 2
Answers by
Svett
Telerik team
Jason Morris
Top achievements
Rank 1
Share this question
or