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

grid control exception

My application refesh two grid control every time period , each gridcontrol is laid on tab.

The refresh cycle is as follows :
a) begin update
b)set grid control rowscount to zero
c) grid insert range (1, x)
d) populate the grid with new data
e) end update + refresh

I have seen two problems that i need your help with :
1. how can i make the grid column width change with regrad to the data inserted to it ?

2. while moving the mouse over the grid or changing column border I am experiencing exception "value does not within the expected range" , I can't figure out why?
It would be nice to understand what the source of the exception, meaning and how to handel it.


1 Reply

HA haneefm Syncfusion Team July 2, 2007 03:47 PM UTC

Hi Yaacov,

Question 1:how can i make the grid column width change with regrad to the data inserted to it ?
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
You would have to call the ResizeToFit each time you rebind a grid. Here is a code:

this.grid.Model.ColWidths.ResizeToFit(GridRangeInfo.Table());

Question 2:while moving the mouse over the grid or changing column border I am experiencing exception "value does not within the expected range" , I can't figure out why?
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
The error which you have mentioned, is an indication of threading issues. Are there multiple threads involved in your appilcation? If so, please check the Knowledge Base(KB) article link below.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=78

Intermittant errors can be indications of threading issues. Any calls into the grid must be done on the thread that creates it, and you can use grid.InvokeRequired to check for this.
Here is a sample.
LoaddatainBackGroundThread.zip

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon