Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

How to: when clicking row or cell on datagridview, open new window filled with row's data

$
0
0

Using SQL SERVER express, OleDBDataAdapter, Dataset, DataGridView, I need the user to be able to edit an entire record like this: User must first fill the datagridview by first applying a filter. He must enter a valid Project Number, then press FILTER to make data appear. This is the only way to fill the Datagridview.

Then, to make changes (UPDATE statement), he must click on the concerned row and that window appears with all the field filled with the row's data.

Here's how I apply the filter...

 private void button1_Click_1(object sender, EventArgs e)
        {
            int iCnt;

            oleDbDataAdapter1.SelectCommand.Parameters[0].Value = RFIfilter.Text;
            rfIlogDS1.Clear();
            iCnt = oleDbDataAdapter1.Fill(rfIlogDS1);

            if (iCnt > 0)
            {
                dataGridRFIlog.Enabled = true;


            }
            else
            {
                MessageBox.Show("Job Number Not Found");
                dataGridRFIlog.Enabled = false;
            }
        }

I basically have no clue on how to make chosen data appear on the EDIT window, then make UPDATE statement upon clicking SAVE CHANGES....

private void dataGridRFIlog_CellClick(object sender, DataGridViewCellEventArgs e)
        {

        //opens up edit form filled with row's data, ready to be edited...

        }




Viewing all articles
Browse latest Browse all 2535

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>