[SOLVED] DGV Multiselection rows and deletion

Answered
0
0

Hello,

I noticed, that when selecting multiple rows in DGV, I get back only 1 row as rowcount from int[dataGridView1.SelectedRows.Count].

With the following code I try to fill an array with primary keys from rows which should be deleted .

private void btnDel_Click(object sender, EventArgs e) {

var rows = new int[dataGridView1.SelectedRows.Count];
int nIndex = 0;
int nDeleted;
foreach(DataGridViewRow Row in dataGridView1.SelectedRows)
{
rows[nIndex++] =  (int)Row[“colGESINR”].Value;
}
if(nIndex > 0)
{
nDeleted =DBGlobal.DeleteRows(“GESELLSCHAFTEN”, “GESINR”, rows);
}
taGESELLSCHAFTEN.Fill(wIWO12DataSet.GESELLSCHAFTEN);

};

Is this a bug in Wisej or in my code?

Regards

Johann

 

  • Johann Gregorich
    sorry I found the bug in my code, Wisej is ok.
  • Frank (ITG)
    Thanks Johann. Was just about to reply that I cannot reproduce :-) Regards, Frank
  • You must to post comments
Best Answer
0
0

Just for the records and to not leave it unanswered:

Not a bug in Wisej.

Best regards
Frank

 

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.