J
JohnAim11
Guest
hi guys,i hope you can help me im just a beginner developing my programming skills in c#,how can i view other datas to another datagridview(datagraidView2) when i select a current data on another datagridview(datagridview1) so theyre attached in somehow but i dont know how,do i have to configure it starting from creating my database or is it just simply codes in C#?exmaple is i select a column(Name) automatically upon selecting that column(Name)on datagridView2 it will show or display other informations, that is not saved into its similar table(tbl_info)
ex. i have two tables,tbl_info and tbl_serial..
my current codes when viewing are these,i havent yet created the columns on my presented two tables mention there above these codes are from my existing program which only supports one datagridview and it shows the value when clicked to the textboxes
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0)
{
DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];
txtTransac.Text = row.Cells["Control#"].Value.ToString();
txtlocale.Text = row.Cells["Locale/District"].Value.ToString();
txtDealer.Text = row.Cells["Dealer/Supplier"].Value.ToString();
txtPo.Text = row.Cells["P.O.#"].Value.ToString();
dateTimePicker1.Text = row.Cells["Date Posted"].Value.ToString();
txtamount.Text = row.Cells["Amount"].Value.ToString();
txtremarks.Text = row.Cells["Remarks"].Value.ToString();
}
}
i hope someone could really help me so that i can further more enhance my knowledge and skills,thank you very much in advance..
Continue reading...
ex. i have two tables,tbl_info and tbl_serial..
my current codes when viewing are these,i havent yet created the columns on my presented two tables mention there above these codes are from my existing program which only supports one datagridview and it shows the value when clicked to the textboxes
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0)
{
DataGridViewRow row = this.dataGridView1.Rows[e.RowIndex];
txtTransac.Text = row.Cells["Control#"].Value.ToString();
txtlocale.Text = row.Cells["Locale/District"].Value.ToString();
txtDealer.Text = row.Cells["Dealer/Supplier"].Value.ToString();
txtPo.Text = row.Cells["P.O.#"].Value.ToString();
dateTimePicker1.Text = row.Cells["Date Posted"].Value.ToString();
txtamount.Text = row.Cells["Amount"].Value.ToString();
txtremarks.Text = row.Cells["Remarks"].Value.ToString();
}
}
i hope someone could really help me so that i can further more enhance my knowledge and skills,thank you very much in advance..
Continue reading...