How to implement paging and Add button

S

Siegfried Heintze

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top