PDA

View Full Version : انتخاب آخرین رکورد ثبت شده در GridView



mehrdadpaknejad
پنج شنبه 22 اسفند 1392, 11:59 صبح
سلام دوستان
من می خواهم زمانی که کاربر رکوردی را ثبت کرد آن رکورد در GridView در حالت انتخاب قرار گیرد
اگر از دوستان کسی می دونه باید چه دستوری بنویسم ممنون می شم کمکم کنه

davidrobert
پنج شنبه 22 اسفند 1392, 12:30 عصر
از این دستور استاده کنید من از این دستور وقتی فرم لود میشه اولین رکورد رو انتخاب میکنم استفاده میکنم امیدوارم بدرد شما بخوره.
private void DGV_MultiSelectChanged(object sender, EventArgs e)
{
LblDoc.Text = DGV.CurrentRow.Cells[19].Value.ToString();
CmbCodeBank.Text = DGV.CurrentRow.Cells[40].Value.ToString();
// TxtNameBank.Text = DGV.CurrentRow.Cells[38].Value.ToString();
TxtTrackingNumber.Text = DGV.CurrentRow.Cells[24].Value.ToString();
Txt_Description.Text = DGV.CurrentRow.Cells[43].Value.ToString();
CmbCodeCustomer.Text = DGV.CurrentRow.Cells[29].Value.ToString();
LblPID.Text = DGV.CurrentRow.Cells[21].Value.ToString();
TxtAPayment.Text = DGV.CurrentRow.Cells[22].Value.ToString();
}

hamid_hr
پنج شنبه 22 اسفند 1392, 12:44 عصر
Dgv1.CurrentCell = Dgv1.Rows[Dgv1.Rows.Count - 1].Cells[0];