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.

Databound Grid on Panel

Thread ID:

Created:

Updated:

Platform:

Replies:

5499 Jul 6,2003 09:11 AM Jul 6,2003 03:43 PM Windows Forms 2
loading
Tags: GridControl
XP
Asked On July 6, 2003 09:11 AM

I have developed some databound grid with a filter bar on it. Everything is ok. For some reason I need to place the datagrid on a panel. If I do that the Filter bar will not work... I get the following error: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: colIndex I used the samples to create the filter bar and my code looks like this: dsStock = new DataSet(); this.adptStock.Fill(this.dsStock); this.Cursor = Cursors.WaitCursor; this.dgStock.BeginUpdate(); this.dgStock.DataSource = dsStock.Tables[0]; this.dgStock.Model.ColWidths.ResizeToFit(GridRangeInfo.Row(0), GridResizeToFitOptions.NoShrinkSize); this.dgFilterBar = new GridFilterBar(); this.dgFilterBar.WireGrid(this.dgStock); this.dgStock.EndUpdate(); this.Cursor = Cursors.Arrow; The debugger highlights this line when the error strikes: this.dgStock.EndUpdate(); Again without the panel everything is perfect. The filter bar does the job.

Administrator [Syncfusion]
Replied On July 6, 2003 12:01 PM

The grid inherits its binding context from its parent so try setting the grid's BindingContext to the BindingContext of the form to see if that makes things work. this.dgStock.BindingContext = this.BindingContext;

XP
Replied On July 6, 2003 03:43 PM

It works. Thanks again Clay!

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.

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.

;