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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Databound Grid on Panel

Thread ID:





5499 Jul 6,2003 01:11 PM UTC Jul 6,2003 07:43 PM UTC WinForms 2
Tags: GridControl
Asked On July 6, 2003 01:11 PM UTC

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 04:01 PM UTC

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;

Replied On July 6, 2003 07:43 PM UTC

It works. Thanks again Clay!


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon