BindingSource sorting base class member throws MissingMemberExcept

BindingSource sorting base class member throws MissingMemberExcept

Post by RnJpdH » Tue, 30 Dec 2008 19:30:01


Hi,

have problem with sorting data shown in a DataGridView.
Here is how I do it:

BindingSource bindingSource = ...;
DataGridView dataGridView = ...;
dataGridView.DataSource = bindingSource;

IQueryable<Tool> query = GetDataByLinqQuery();
bindingSource.DataSource = query;

Sorting Rows in der DataGridView by mouse click on column heades works fine
for direct members of class Tool.
What does not work is sorting columns which show members of the base class
of class Tool.

Here is the class hirarchy to make it clear.

class ToolBase
{
public int ID {get; set;}
}

class Tool : ToolBase
{
public double Diameter {get; set;}
}


class ToolSpecial1 : Tool
{
public double Height {get; set;}
}


When clicking on column header of row "Diameter" sorting works fine.
When clicking in column header of row "Height" no sorting is done.
But what is worse, clicking in column header of row "ID" throws a
MissingMemberException saying "member Tool.ID could not be found".

Im using .NET 3.5 SP1.

Any help on this issue?

Thanks, Fritz
 
 
 

1. Can a sub-class (composite object) member function access private or protected members of base class?

2. Can Derived class static member access protected member from base class?

Can Derived class static member access protected member from base class?

class Base {
protected:
void setvariable(int);
};

class Derived : Base {
public:
static std::auto_ptr<Base> out(new Derived());
out->setvariable(3); // my compiler gives is not accessible error here!
return out;
};

3. pointer to member conversion to a pointer to member that is a member's base class

4. Fwd: pointer to member conversion to a pointer to member that is a member's base class

5. Dialog Base Class using static member afx message functions and static member variable

6. Why can derived member function not access protected member of a base class object?

7. C++ Templates - passing a pointer to the member to that member's base class

8. Why can derived member function not access protected member of a base class object?

9. C++ Templates - passing a pointer to the member to that member's base class

10. Why can derived member function not access protected member of a base class object?

11. C++ Templates - passing a pointer to the member to that member's base class

12. Copy assignment for derived class when base class has private members

13. accessing base class members when base is template

14. Require base class member to be populated by derived classes.

15. How to hide base class member variable in derived class (w/o shadows)?