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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Virtual grid - change underlying data, Refresh, and get QueryRowCount error

Thread ID:

Created:

Updated:

Platform:

Replies:

17164 Aug 2,2004 10:06 PM UTC Aug 3,2004 04:45 AM UTC WinForms 2
loading
Tags: GridControl
Dan
Asked On August 2, 2004 10:06 PM UTC

I have a virtual grid that uses my own object model for the data. When I need to change the underlying data, I change the data, then call grid.Refresh() This *eventually* results in calls to QueryRowCount, etc. where I provide the new counts. However...when I call Refresh, the grid apparently first calls Refresh on the currently selected cell (as seen in the call stack for the debug version of the grid assemblies). This causes an error, since the underlying data has been changed to potentially fewer rows, but before the QueryRowCount call comes through, a call to QueryCellInfo comes through for the currently selected cell. Any way to get around this Refresh of the current cell? Note: I tried calling CurrentCell.MoveTo(1,1) before calling the Refresh(), but 2 problems: -- that cell may not always be enabled, so sometimes the call fails to set current cell -- I can *see* the move in the grid, before the refresh happens...not good. Thanks!!

Dan
Replied On August 2, 2004 10:08 PM UTC

p.s. the error is not in QueryRowCount as the subject says, it shows up in QueryCellInfo when I try to hit data that doesn''t exist. My underlying data may only have 10 rows now since it''s been changed, but if a cell in row 20 was the current cell before the refresh, a call comes through to QueryCellInfo for row 20, which doesn''t exist in my underlying data. For now, I''ll put a simple check for this in QueryCellInfo, but wondering if there is a better solution? Thanks!!

Administrator [Syncfusion]
Replied On August 3, 2004 04:45 AM UTC

You can try this. Before you ''refresh'' your external datasource in a manner that may reduce the number of rows/columns, you can call grid.CurrentCell.MoveTo(-1,-1). This normally leaves the grid with no currentcell. I guess you could conditionally make this call so it is only done if necessary.

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.

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

;