By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,219 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,219 IT Pros & Developers. It's quick & easy.

Datagrid current row number is the same as the dataset row number?

P: n/a
I'm working on a Window based application. I have 2 textboxes and a datagrid
on a form. The textboxes are databind to the same datasource as datagrid. I
want to use the following to update the dataset but I am not suer if the
datagrid's current row number does corresponds to the row number in the
dataset table that I want to update. Appreciate it if someone can give me
answer to this.
Thanks, Alpha

private void txtLastOdometer_Validated(object sender, System.EventArgs e)
{
dsMaintDued.Tables["MaintenanceDued"].Rows[dgMaintDued.CurrentRowIndex]["LastOdometerReading"] = txtLastOdometer.Text.ToString();
}

private void dtpLastService_Validated(object sender, System.EventArgs e)
{
dsMaintDued.Tables["MaintenanceDued"].Rows[dgMaintDued.CurrentRowIndex]["LastOdometerDate"] = dtpLastService.Value.ToString();
}
Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.