I am looking for a way to filter Datagridview to another Datagridview and by using a reference number in the first column and searching for a sum of the values of this reference number in another column
Look at the pictures below to understand what I'm looking for:
Datagridview 1
For datagridview 1 in doesn't have any data table or database just get data from some text boxes
Datagridview 2
For datagridView 2 i Just filled it manually, So i want to do it automatically.
can someone help me..? thanks.
sorry for my bad english.
This is my code
- namespace SAMPLE
- {
- public partial class Form2 : Form
- {
- public Form2()
- {
- InitializeComponent();
- }
- private void add_Click(object sender, EventArgs e)
- {
- int n = dataGridView1.Rows.Add();
- dataGridView1.Rows[n].Cells[0].Value = txtReff.Text;
- dataGridView1.Rows[n].Cells[1].Value = txtProd.Text;
- dataGridView1.Rows[n].Cells[2].Value = textPrice.Text;
- dataGridView1.Rows[n].Cells[3].Value = txtNumber.Text;
- dataGridView1.Rows[n].Cells[4].Value = txtSum.Text;
- }
- private void textHt_TextChanged(object sender, EventArgs e)
- {
- try
- {
- txtSum.Text = (double.Parse(textPrice.Text) * double.Parse(txtNumber.Text)).ToString();
- }
- catch
- {
- }
- }
- private void txtFrs_TextChanged(object sender, EventArgs e)
- {
- try
- {
- txtSum.Text = (double.Parse(textPrice.Text) * double.Parse(txtNumber.Text)).ToString();
- }
- catch
- {
- }
- }
- }
- }