Skip to content

Instantly share code, notes, and snippets.

@pingkunga
Last active March 18, 2025 02:48
Show Gist options
  • Save pingkunga/a5132c5ee6ce6f55d5bc5d58aa82e6c5 to your computer and use it in GitHub Desktop.
Save pingkunga/a5132c5ee6ce6f55d5bc5d58aa82e6c5 to your computer and use it in GitHub Desktop.
Back to Basic: Fundamental Data Structure in C#
int[] selectedRows = this._sourceGridView.GetSelectedRows();
int[] sourceIndex = new int[selectedRows.Length];
for (int row = 0; row < selectedRows.Length; row++){
if (selectedRows[row] >= 0){
sourceIndex[row] = this._sourceGridView.GetDataSourceRowIndex(selectedRows[row]);
}
else{
sourceIndex[row] = selectedRows[row];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment