You must Sign In to post a response.
  • Category: .NET

    Add a row to gridview

    Hi.
    Is it possible to increase a row in gridview like this which is in vb 6.0


    MSFGREL.Rows = MSFGREL.Rows + 1


    Because I have to get data row by row after doing a lot of calculations


    MSFGREL.Rows(MSFGREL.Rows.Count - 1).Cells(0).Text = temprel(Sno)
    MSFGREL.Rows(MSFGREL.Rows.Count - 1).Cells(1).Text = tempamt(Sno)
    MSFGREL.Rows(MSFGREL.Rows.Count - 1).Cells(2).Text = tempstr(Sno)


    After getting values in first row, a row has to be incremented and some other values should be inserted in 2nd row.
  • #648559
    hi


    dataGridView1.Rows.Add();

    this will add new row to datagridview .

    Regards
    Sagar pawar
    Software developer

  • #648626
    Hello,
    please check below code:


    adding rows to the DataTAble

    Dim dataRowObject as DataRow
    dataRowObject("column1") = "v1"
    dataRowObject("column2") = "v2"

    DataTableObject.Rows.Add( dataRowObject )
    //Then

    GridView.DataSource = DataTableObject
    GridView.Bind()

    Regards
    Mr.Rajesh
    Software Engg.


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.