Vb.net 编辑时将 Datagridview 行移动到最后一行
Vb.net Move A Datagridview Row to the last row when being edited
我在论坛上没有找到我需要的东西。我不想移动选择或滚动索引,我需要做的就是将具有特定索引的整行更改为我的 datagridview 中的最后一行。
我需要在编辑此行时自动执行此操作。
P.S。数据网格未绑定
例如:
dgv.rows(index).index=dgv.row.getlastrow
然而,调试器return一个索引是只读的错误。
请大家帮忙!
这对我有用:
Dim curr_row As DataGridViewRow = idgv.Rows(Index)
Dim curr_index As Integer=idgv.Rows.GetLastRow(DataGridViewElementStates.Visible)
idgv.Rows.Remove(curr_row)
idgv.Rows.Insert(curr_index, curr_row)
我在论坛上没有找到我需要的东西。我不想移动选择或滚动索引,我需要做的就是将具有特定索引的整行更改为我的 datagridview 中的最后一行。 我需要在编辑此行时自动执行此操作。
P.S。数据网格未绑定
例如:
dgv.rows(index).index=dgv.row.getlastrow
然而,调试器return一个索引是只读的错误。
请大家帮忙!
这对我有用:
Dim curr_row As DataGridViewRow = idgv.Rows(Index)
Dim curr_index As Integer=idgv.Rows.GetLastRow(DataGridViewElementStates.Visible)
idgv.Rows.Remove(curr_row)
idgv.Rows.Insert(curr_index, curr_row)