Datagrid Events

I am trying to find an event that then the user scrolls down the datagrid for each record I can display the notes in a listview control. So, when the user goes to a different record the notes for that record will appear in the listview control. Can somebody help
thanks


Answer this question

Datagrid Events

  • Sandro Guedes P da Costa

    Take a look at the CurrentCellChanged event for the grid:



    private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)

    {

        this.listView1.Items.Clear();

        this.listView1.Items.Add(new ListViewItem(((DataTable)this.dataGrid1.DataSource).Rows[this.dataGrid1.CurrentRowIndex].ItemArray[1].ToString(),0));

    }


     


  • winformmaker

    Hopefully this is not taken in the wrong thought, but did you create a handler for the event, not just copy and paste the code

    I presume this is Framework 1.1 not 2.0, since the datagrid is now a data grid view


  • UKAndrewC

    I put that event in there but when a scroll through the datagrid the event is not fired. What is the problem thanks steven pennington42@hotmail.com

  • Datagrid Events