all groups > dotnet windows forms databinding > december 2007 >
You're in the

dotnet windows forms databinding

group:

Databinding problem on inherited form



Databinding problem on inherited form Lynn
12/12/2007 1:02:00 PM
dotnet windows forms databinding: In VS2005, I have a base form that is designed to be inherited by many other
forms in an application. This base form contains various controls bound to a
dataset (ds1). The dataset is set to Protected so the base control can have
access to it. I created an inherited form (call it Form2) from the base form
and added controls to Form2. The controls on Form2 are also bound to ds1. I
tried to add the binding for the controls in the code and also setting up the
binding in the designer. Either way, when I run the application, the binding
of the controls on Form2 does not work. I debugged the code and I can see
the binding being added. However when I try to save the datarow, changes
made to the datarow are not detected. The datarow is unchanged. This was
working in Visual Studio 2003. I am only seeing this problem after we've
converted our project over to VS2005. Any ideas on how to resolve this?
Thanks.

RE: Databinding problem on inherited form Morten Wennevik [C# MVP]
12/16/2007 11:46:00 PM
Hi Lynn,

This should work fine in VS 2005 as well. Are you seeing values in the
inherited form? If no values are shown I'd suspect a type somewhere. If
values are shown, do they reflect changes in the inherited form if you change
row?

Try trapping the RowChanging/RowChanged events on the datatable to see if
they fire.

--
Happy Coding!
Morten Wennevik [C# MVP]


[quoted text, click to view]
AddThis Social Bookmark Button