How to tell # records in datasource
Hi,
I am applying a row filter to a child grid based on the contents of the parent grid. How can I check to see if records exist in the child grid before displaying it? Can I open a dataview using the filter as criteria and check the recordcount? An example would be very helpful.
Thanks
SIGN IN To post a reply.
8 Replies
AD
Administrator
Syncfusion Team
March 1, 2004 06:06 PM UTC
If you have set the rowfilter on your dataview with code like:
this.dataView1.RowFilter = "????something";
then this.dataView1.Count will give you the visible record count in the dataview.
AD
Administrator
Syncfusion Team
March 1, 2004 11:44 PM UTC
Hi,
The reason I''m asking is that I get an error when trying to drop down a child grid that has no records, but is supposed to allow new records to be added. The error I get is ''there is no row at position 1". It seems that when I add a new record to the child grid where other records already exist and then got to a different record in the parent and again drop down the child grid where there are no records it gives me this error. I''ve attached the code if you wouldn''t mind taking a look. To reproduce:
1. open file called test_ice2.xml
2. click on first child grid in first parent record
3. add a new record to this grid but do not click out of the new record so the pencil icon remains on this new record
4. click on the first child grid in the last parent record. You should get the error ''there is now row at positon ..."
Can you tell me how to solve this bug?
>If you have set the rowfilter on your dataview with code like:
>
>this.dataView1.RowFilter = "????something";
>
>
>then this.dataView1.Count will give you the visible record count in the dataview.
Test21704_2212.zip
AD
Administrator
Syncfusion Team
March 1, 2004 11:48 PM UTC
Here is an attached file with the file to open
testfile_4364.zip
AD
Administrator
Syncfusion Team
March 2, 2004 12:19 AM UTC
Hi Clay,
I think I have this fixed, but I have a more serious problem. Sometimes when I click on the first child grid and it contains no records the grid opens as a transparent box - ui corruption.
I cannot figure out why this would happen. I''ve already submitted a direct trac incident with no luck. I really need to get this resovled. I have attached a screen shot of what I''m talking about. It is not easily reproduced.
>Here is an attached file with the file to open
>
>testfile_4364.zip
>
>
screenshot_3714.zip
AD
Administrator
Syncfusion Team
March 2, 2004 06:14 AM UTC
I am not sure what your picture should look like.....
Is the problem that you would expect to see no dropdown at all if the child grid is empty? If so, have you tried setting e.Cancel = true in CurrentCellShowingDropDown if the datasource for the grid being dropped is empty?
Check the output window to see if any exceptions are being thrown. You also might want to set the debugger to stop on on any exception to try to get a callstack if one is being thrown.
AD
Administrator
Syncfusion Team
March 2, 2004 11:03 AM UTC
Hi Clay,
No, the problem is that the grid drops down and is transparent - you can see the records in the grid behind the child grid and no new record is displayed. I''ve again attached the screenshot so you can see this. The outline of the dropped down grid shows but the rest is see-through. Then when I click on the transparent portion the record shows up and the grid is opaque as it should be. I need the grid to drop down and display the new record. I''ve checked for exceptions and I''m not getting any. I''ve been trying to figure out the problem for several days now and I''m stuck. I really need help with this - could it be a bug in this version of the grid?
Thanks,
CB
>I am not sure what your picture should look like.....
>
>Is the problem that you would expect to see no dropdown at all if the child grid is empty? If so, have you tried setting e.Cancel = true in CurrentCellShowingDropDown if the datasource for the grid being dropped is empty?
>
>Check the output window to see if any exceptions are being thrown. You also might want to set the debugger to stop on on any exception to try to get a callstack if one is being thrown.
>
AD
Administrator
Syncfusion Team
March 2, 2004 11:10 AM UTC
Here is the screenshot. IF you look closely you will see the child grid on the third parent record is dropped down and you can see the horizontal scroll bar at the bottom. But the rest is transparent and you can see the parent records that would be behind the drop down. It should look normal - opaque and show one new record. When I click on the transparent portion the grid then appears normally with the new record.
screenshot2_7472.zip
AD
Administrator
Syncfusion Team
March 2, 2004 04:21 PM UTC
Jay has been working on this problem for you in Direct Trac. I think he posted a suggestion that handled the problem for him in your sample code that he has.
SIGN IN To post a reply.
- 8 Replies
- 1 Participant
-
AD Administrator
- Mar 1, 2004 05:11 PM UTC
- Mar 2, 2004 04:21 PM UTC