We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

"Specified argument was out of the range of valid values" messagebox from grid

Thread ID:

Created:

Updated:

Platform:

Replies:

5512 Jul 7,2003 11:37 AM UTC Jul 7,2003 02:37 PM UTC Windows Forms 2
loading
Tags: GridControl
Eric Duesing
Asked On July 7, 2003 11:37 AM UTC

In the attached form, I have a virtual grid that has a new base style defined called "FilterHeader" that is based on a column header. It's a combo box. When I change the value of the combo box and then try to select another cell, I get the "Specified argument was out of the range of valid values" messagebox from deep inside the grid. The only thing I can think that I could be doing wrong is the QueryCellInfo code? I boiled it down to the following: if (e.ColIndex==15 && e.RowIndex==0) { e.Style.BaseStyle="FilterHeader"; e.Style.ChoiceList=new StringCollection(); e.Style.ChoiceList.Add("a"); e.Style.ChoiceList.Add("b"); e.Handled=true; } Any help would be appreciated.

Administrator [Syncfusion]
Replied On July 7, 2003 12:53 PM UTC

A couple of points. If you want the grid to store the header values for you, then you need to allocate some internal storage for this. Or, you could provide this header cell value in QueryCellInfo and save it in SaveCellInfo through some data item that you control. To use the grid's internal storage, you would need to set the column count on the grid's Data object.
public Form1()
{
	InitializeComponent();
	this.gridControl1.Model.Data.ColCount = 100; //could use only 17 if that is last column hedaer you want to populate
	gridControl1.ResetVolatileData();
}

Then in QueryCellInfo, you should not set e.Handled = true for this cell as you want to retrieve the saved value. Attached is a file with these changes that seems to work for me.

Eric Duesing
Replied On July 7, 2003 02:37 PM UTC

As usual, you are correct. Thanks.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;