I'm trying to write a simple Compact Framework winforms app. The main form has a DataGrid bound to a DataTable (with data from an xml file). I want to bring up another form that displays the details of the current record. I have something like the following code as the constructor for the detail form.
public DetailsForm(DataTable dtLandlords, int Index) //the constructor
{
InitializeComponent();
lLandlordCode.DataBindings.Add("Text", dtLandlords, "LandlordID");
.......
}
I'm Calling the constructor with the following code
Form frm = new LandlordDetailsForm(dtLandlords, dataGrid1.CurrentRowIndex);
frm.Show();
How do I get it to display the current record (specified in Index - currently not used) rather than just the first record. Or is there a better way that I should be doing this?