VB6 DataGrid书签错误 [英] VB6 DataGrid Bookmark Error
问题描述
当我向下滚动DataGrid,然后在DataGrid中选择一行,然后重新绑定DataGrid时,DataGrid显示从第一行开始的行,DataGrid.Row = 0.
如何重新定位DataGrid以显示上次选择的行?
DataGrid绑定到DataEnvironment中的Command。 br />
我在DataGrid.SelChange事件中尝试了以下代码,使用BookMarks属性,其中lastRow被声明为Variant:
When I scroll down a DataGrid, then select a row in the DataGrid, then rebind the DataGrid, the DataGrid displays the rows starting with the very first row, DataGrid.Row = 0.
How do I reposition the DataGrid to display the row that was last selected?
The DataGrid is bound to a Command in the DataEnvironment.
I have tried the following code in the DataGrid.SelChange event, using the BookMarks property, where lastRow is declared as a Variant:
DataGrid1.Col = 0
lastRow = DataGrid1.Text
i = DataGrid1.Row
DataGrid1.Bookmark(i) = lastRow
当我运行代码时,我在最后一行收到错误: 运行时错误'13':类型不匹配
知道我做错了吗?
谢谢。
[edit]已添加代码块[/ edit] < /小>
推荐答案
您已经在 http://www.codeproject.com/Messages/4595853/VB6 cannotGrid-Bookmark-Error.aspx [ ^ ]。请不要在多个论坛中发布相同的问题。
You already asked this question at http://www.codeproject.com/Messages/4595853/VB6-DataGrid-Bookmark-Error.aspx[^]. Please do not post the same question in multiple forums.
这篇关于VB6 DataGrid书签错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!