Home Forums WinForms controls Xceed Grid for WinForms DataRows.Count = 0

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15808 |

    Hi Guys,

    I have a UnitTest that requires me to check the properties of the XCeedGrid following some simple coding.

    I create a List<T>, where T is a very simple public class called ‘DummyEntity’ that has a property of ‘BoundId’ on it of type string. The list has 3 instances of the DummyEntity within it.

    I have set the Grid’s ‘AutoCreateColumns’ to ‘true’ and then set the DataSource property on the Grid:

    grid.DataSource = list;

    However, the grid returns ‘0’ from the following code:

    grid.DataRows.Count

    I do not understand this as I have 3 valid objects in my list that I have set on the Grid’s ‘DataSource’. Using ‘SetDataBinding’ instead makes no difference. I’m wondering if the Grid knows that it has not been required to paint (as it is created within a UnitTest) which has resulted in 0 rows being created. Or I am being stupid and need to set another property on the Grid, maybe?

    Can you please suggest what I should do or check?

    Thanks!

    Regards,
    Russell

    Imported from legacy forums. Posted by russellcoombes (had 1876 views)

    Xceed Support
    Member
    Post count: 5658

    I suggest that you take a look at our IBindingList sample (“C:\Xceed Component Samples\Xceed Grid for .NET 3.6\Samples\CSharp\IBindingList”). The “IBindingList – Minimum” should help you implementing your list.

    Imported from legacy forums. Posted by CharlesB (had 2910 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.