G
Guest
I've used the Designer to create a strongly typed Dataset class from a stored
procedure definition. I called this class cMyDSraw, and the table within it
is called MyTable. The Designer generated nested class definitions for
cMyDSraw.MyTableDataTable and cMyDSraw.MyTableDataRow. Everything works fine
-- I can add a dataset of this class to a form and bind controls to the
fields, and they display the results of the sp call properly.
Now I want to derive from this class to provide some custom wrappers for
some of the database columns, by extending the definition of the base class's
nested class for the data row, e.g.:
public class cMyDS : cMyDSraw {
new public class MyTableDataRow : cMyDSraw.MyTableDataRow {
public bool MyBoolCol {
get { return (base.MyTextCol == @"Y"); }
set { base.MyTextCol = (value ? @"Y" : @"N"); }
}
}
The Designer can place an instance of this new derived DataSet class on my
form. However, the only properties available for design-time binding to
controls on the form are the ones in the "raw" class cMyDSraw.
Is this the correct approach? How can a make my "custom" columns such as
"MyBoolCol" visible in the binding dialogs in the Forms Designer?
procedure definition. I called this class cMyDSraw, and the table within it
is called MyTable. The Designer generated nested class definitions for
cMyDSraw.MyTableDataTable and cMyDSraw.MyTableDataRow. Everything works fine
-- I can add a dataset of this class to a form and bind controls to the
fields, and they display the results of the sp call properly.
Now I want to derive from this class to provide some custom wrappers for
some of the database columns, by extending the definition of the base class's
nested class for the data row, e.g.:
public class cMyDS : cMyDSraw {
new public class MyTableDataRow : cMyDSraw.MyTableDataRow {
public bool MyBoolCol {
get { return (base.MyTextCol == @"Y"); }
set { base.MyTextCol = (value ? @"Y" : @"N"); }
}
}
The Designer can place an instance of this new derived DataSet class on my
form. However, the only properties available for design-time binding to
controls on the form are the ones in the "raw" class cMyDSraw.
Is this the correct approach? How can a make my "custom" columns such as
"MyBoolCol" visible in the binding dialogs in the Forms Designer?