Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I've inserted a row into my dataset ds_sw_rules2.

Works fine. When it inserts, it inserts the row as the last row in the grid. I don't want the user to have to scroll to the bottom of the grid to see the new row. What is the method to automatically scroll to the new row?

 

'create a new row

Dim workRow As DataRow

workRow = Ds_sw_rules2.Tables("sw_rules").NewRow

workRow.Item("rule_id") = 1

workRow.Item("effdt") = Now()

workRow.Item("effdt_end") = Now()

'Add the row to the DataSet

Ds_sw_rules2.Tables("sw_rules").Rows.Add(workRow)

Posted

Thanks for the information. I'm sure you can tell I'm very new at this. I couldn't figure out how to code the CurrentRow property. I'll continue to look for it. I did solve my problem by using the movelast method of the grid.

 

'create a new row

Dim workRow As DataRow

workRow = Ds_sw_rules2.Tables("sw_rules").NewRow

workRow.Item("rule_id") = 1

workRow.Item("effdt") = Now()

workRow.Item("effdt_end") = Now()

'Add the row to the DataSet

Ds_sw_rules2.Tables("sw_rules").Rows.Add(workRow)

Me.C1TrueDBGrid1.MoveLast()

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...