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.

PopulateValues - to expand the grid automatocally

Thread ID:

Created:

Updated:

Platform:

Replies:

26400 Mar 22,2005 12:31 PM Mar 23,2005 11:38 AM Windows Forms 5
loading
Tags: GridControl
Charles Vereker
Asked On March 22, 2005 12:31 PM

I''ve written the following method: protected void PasteData(GridRangeInfo rangeInfo, object data) { // expand the grid if necessary (to fit the data!) if (rangeInfo.Bottom > this.RowCount) this.Rows.InsertRange(this.RowCount+1, rangeInfo.Bottom - this.RowCount); if (rangeInfo.Right> this.ColCount) this.Cols.InsertRange(this.ColCount+1, rangeInfo.Right - this.ColCount); this.Model.PopulateValues(rangeInfo, data); } When I had a UserControl with a GridControl as a member then this worked. Now that my UserControl inherits directly from GridControl an exception is generated (Index out of Range) in the PopulateValues call.

Administrator [Syncfusion]
Replied On March 22, 2005 01:46 PM

Can you post a call stack showing the exception? You might check whether this.RowCount/ColCount and base.RowCount/ColCount are different values? One comment is that in a GridControl, it should automatically add rows/columns during a paste if they are needed (unless you have set the grid.Model.CutPaste.ClipboardFlags to include the GridDragDropFlags.NoAppendRows and GridDragDropFlags.NoAppendCols flags).

Charles Vereker
Replied On March 23, 2005 03:24 AM

>Can you post a call stack showing the exception? "An unhandled exception of type ''System.ArgumentOutOfRangeException'' occurred in syncfusion.grid.windows.dll Additional information: Specified argument was out of the range of valid values." >You might check whether this.RowCount/ColCount and base.RowCount/ColCount are different values? They are different (i.e. pre-InsertRange) values. I tried setting them explictly but that did not work. >One comment is that in a GridControl, it should automatically add rows/columns during a paste if they are needed (unless you have set the grid.Model.CutPaste.ClipboardFlags to include the GridDragDropFlags.NoAppendRows and GridDragDropFlags.NoAppendCols flags). The name of my method is misleading. It should really be an override of PopulateValues. The data passed in is not the result of a cut and paste operation, but rather an array, or DataTable from elsewhere in my program.

Administrator [Syncfusion]
Replied On March 23, 2005 03:49 AM

Something else to try. Instead of calling this.Rows.InsertRange this.Cols.InsertRange try calling this.Model.Rows.InsertRange this.Model.Cols.InsertRange If you can upload a sample showing the problem (or email one to support@syncfusion.com mentionaing this thread in the subject line) we can try to debug it here.

Charles Vereker
Replied On March 23, 2005 04:06 AM

I still get an exception. I will email/ upload my code later this week. Thanks for the exceptionally quick reply!!

Charles Vereker
Replied On March 23, 2005 11:38 AM

In cleaning my code of other dependencies before uploading I took on board another suggestion/instruction of yours to do some things AFTER the GridControl had been added to it''s parent''s control. This fixed the problem (& others!!) Thank, Charlie

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.

;