I would like create a custom DataRow that will have -let's say- a propery called IsCheapest.
public class RateDataRow : DataRow
{
protected internal RateDataRow(DataRowBuilder builder) : base(builder)
{
}
public bool IsCheapest { get; set ;}
}
And I want to have a new DataTable that contains only ***RateDataRow***s so that .NewDataRow() returns RateDataRow instance as a new row.
what should be the implementation on the class that extends DataTable?
Thanks,
From your question it's not clear if you are familiar with Typed Datasets. They basically are what you are asking for.
You could use the built-in wizards to create a Typed Dataset based on an XSD (and the XSD is extracted from the Db schema). In a WinForms project, select "Add DataSource" and follow the steps.
Even if you don't want to use that model you could borrow from the code for properties, partial classes etc.
It would be wise to either use that model or stay very close to it.