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
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?
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!