參考
--
//增行
private void grdDetail_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
RedoSerialNo();
}
//删行
private void grdDetail_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e)
{
RedoSerialNo();
}
//取得序列号
private void RedoSerialNo()
{
for (int i = 0; i < grdDetail.RowCount; ++i)
{
grdDetail[0, i].Value = i + 1;
}
}
沒有留言:
張貼留言