happycat Posted October 7, 2003 Posted October 7, 2003 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) Quote
*Experts* Volte Posted October 7, 2003 *Experts* Posted October 7, 2003 Set the CurrentRow property to the number of rows in the DataSet. Quote
happycat Posted October 7, 2003 Author Posted October 7, 2003 I've been looking for the currentrow property. Is CurrentRow a property of the DataSet or the Grid? I don't see it as an option. Quote
*Experts* Volte Posted October 7, 2003 *Experts* Posted October 7, 2003 It's part of the DataGrid. Quote
happycat Posted October 7, 2003 Author Posted October 7, 2003 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() Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.