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.

Sorting GDBG via code causes slow repainting

Thread ID:

Created:

Updated:

Platform:

Replies:

16415 Jul 15,2004 04:52 AM Jul 15,2004 09:36 AM Windows Forms 3
loading
Tags: GridControl
Mick Speake
Asked On July 15, 2004 04:52 AM

I am currently evaluating your product & have a few questions. 1) When changing the datasource bound to a grid & invoking SortColumn() the grid repaints itself much more slowly than when sorting by clicking on a column. You can briefly see the default column properties before they are overridden. See the attached example. 2) If you don''t set the DataSource to null before reassigning it & the new DataSet has no records, the grid generates a message saying "Column xx does not belong to the table xx" when leaving any field in a new record. Why is this? See comments in the example. 3) Is it necessary to set up the column properties (e.g. HeaderText, width, StyleInfo)for the grid each time the DataSet is populated with a new selection? 4)Can the CurrentCellValidating event be assigned to a GridBoundColumn. For example, I would like to be able to have automatic checking for cells in a date column. Otherwise, the product is looking very good. Thanks, Mick TestSort_5625.zip

Administrator [Syncfusion]
Replied On July 15, 2004 06:12 AM

Hi Mick Please check the sample again, I''m modifying some code in the LoadData method. Regards Thomas TestSort_5625_3410.zip

Administrator [Syncfusion]
Replied On July 15, 2004 06:20 AM

Here is your sample back with your code tweaked a little to avoid the problems you listed. There are comments in the code. 1) Sorting causes IBlindingList.ListChanged to fire with a Reset. The grid responds by cancelling any BeginUpdate so it can respond and redraw teh grid required by Reset. This is way you are seeing the major flickering. One solution as implemented in the returned sample is to just do the sort before you set the datasource. (There are other ways to do this, but they require significantly more code than this simple solution if it works for you.) 2) As the grid''s datasource is set, the currencymanager position is attempted to be placed on a valid position in teh table. In this empty case, there is no such valida poistion, and this leads to the problem you are seeing. The wrok-around of setting the DataSource to null resets teh currencymanager as well and avoid the problem. Another solution (that is in teh returned sample), is to explicitly set teh curencymanager position in this case. 3) Not unless the new query has different attribuits. In the returned sample, a firstTime bool value was added so the GridBoundColumns are only set once. 4) No. If you want to do this, you can derive GridBoundColumn, and in its constructor, subscribe to grid.CurrentCellValidating and handle things in that way. testsort_7437.zip

Mick Speake
Replied On July 15, 2004 09:36 AM

Many thanks for your quick & informative reply. I have decided to buy the product. However, re. 3) it looks like I do have to apply the HeaderText & CellType changes each time. Using the firstTime bool method results in the HeaderText & celltype changing back to the default after the Datasource is reset. Regards, Mick >Here is your sample back with your code tweaked a little to avoid the problems you listed. There are comments in the code. > >1) Sorting causes IBlindingList.ListChanged to fire with a Reset. The grid responds by cancelling any BeginUpdate so it can respond and redraw teh grid required by Reset. This is way you are seeing the major flickering. One solution as implemented in the returned sample is to just do the sort before you set the datasource. (There are other ways to do this, but they require significantly more code than this simple solution if it works for you.) > >2) As the grid''s datasource is set, the currencymanager position is attempted to be placed on a valid position in teh table. In this empty case, there is no such valida poistion, and this leads to the problem you are seeing. The wrok-around of setting the DataSource to null resets teh currencymanager as well and avoid the problem. Another solution (that is in teh returned sample), is to explicitly set teh curencymanager position in this case. > >3) Not unless the new query has different attribuits. In the returned sample, a firstTime bool value was added so the GridBoundColumns are only set once. > >4) No. If you want to do this, you can derive GridBoundColumn, and in its constructor, subscribe to grid.CurrentCellValidating and handle things in that way. >testsort_7437.zip > >

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.

;