How to implement paging and Add button

Discussion in 'ASP .Net Datagrid Control' started by Siegfried Heintze, Jul 18, 2003.

  1. When I have no paging, this code below works great. However, when I enable
    paging, it does not work right. The add button clobbers some existing row.

    I think this is because I'm using EditItemIndex = 0.

    How do I set the EditItemIndex equal to the last row in the display?
    Will this fix my problem?

    Sieg

    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles btnAdd.Click
    Dim dr As dsAssertions.AssertionsRow
    dr = Me.DsAssertions1.Assertions.NewRow
    dr.A = "" 'txtA.Text
    dr.B = "" 'txtB.Text
    dr.nAssertion = txtAssertion.Text
    dr.ridCase = 359 'txtnCase.Text
    DsAssertions1.Assertions.Rows.InsertAt(dr,
    DsAssertions1.Assertions.Rows.Count)
    dgAssertions.EditItemIndex = 0
    Session("bAddInProgress") = "t"
    Dim ss As String = Session("bAddInProgress")
    rebind()
    End Sub
     
    Siegfried Heintze, Jul 18, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    DataSet paging vs Datareader paging

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 8, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    10,703
    Scott Allen
    Oct 8, 2004
  2. wh1974
    Replies:
    0
    Views:
    2,439
    wh1974
    Jan 12, 2005
  3. Red
    Replies:
    1
    Views:
    724
  4. Rocky
    Replies:
    0
    Views:
    270
    Rocky
    Nov 8, 2006
  5. Replies:
    0
    Views:
    177
Loading...

Share This Page