Hi!
We've seen this sporatically: when a ultraWinGrid is bound to a dataset, rows disappear when we know the dataset has rows in it. A code snippet looks like this:
private DataSet ds;
public void refresh(){
ds = WebService.GetDataSet();Logger.WriteLine(string.Format("loaded # records = {0}, ds.TABLE.Rows.Count ) );
ultraGridEvent.DataSource = ds.TABLE;ultraGridEvent.DataBind();
Logger.WriteLine(string.Format("# grid rows {0}", ultraGridEvent.Rows.Count )); }
After the grid is bound, we know there are rows in the grid (via Rows.Count log message), but nothing is displayed in the grid. Eventually, after calling this function a few times, the grid shows the rows...eventually.
Originally we had just the setting of DataSource, but we added the DataBind thinking we needed an extra InitLayout to fire again, but no luck. We've tried setting the DataSource to null before setting it to ds.Table. And we've tried a Refresh on the grid to no avail. We are not using filtering of any sort.
We're running UltraWinGrid 8.2.20082.1000.
Any advice would be appreciated.
Corey
Yep, that exactly was we saw. # DataRows in the DataTable = # UltraGridRows after the bind. That's the wierd part. The grid is completely empty. I don't recall seeing a vertical scrollbar.
I'll add logging messages to loop through the UltraGridRows and check the HiddenResolved property and report back when this happens the next time.
Corey.
CoreyW said:Does the grid do any optimization that would prevent the rows from being painted? Maybe it thinks that it's already painted them before?
The grid has lots of optimizations for all kinds of things, but none of them should cause the rows not to dislpay.
You are saying that the grid.Rows.Count is returning the correct number of rows, but those rows are not visible on the screen?
Is the grid showing no rows at all or is it only showing some rows and not others?
Is there a vertical scrollbar in the grid?
Have you tried looping through the rows in the grid and checking the HiddenResolved property on each row to see if the rows are hidden because of a Filter or because of the hidden property?
This is really mystifying. What I do not understand is why the log messages tell me that there's 'x' rows in the Dataset table, and after the bind there's the same count of UltraGridRows. That wouldn't seem like a 'normal' timing issue.
The dataset has the same contents each time it comes back from the webservice. Does the grid do any optimization that would prevent the rows from being painted? Maybe it thinks that it's already painted them before? Thanks!
Hi Corey,
You certainly do not need to call DataBind - that will just be inefficient. Setting the DataSource propety does an implicit DataBind, anyway. So there's no reason to do it twice.
I'm afraid I've never seen anything like what you are describing here. But I wonder if it has something to do with the fact that the data is coming from a WebService. Maybe there's some kind of timing or threading issue there.
Does the same code work if you use another control, like the inbox DataGridView?