Tuesday, 15 February 2011

.net - only first 50 rows are getting copied to clipboard from datagridview in winforms -



.net - only first 50 rows are getting copied to clipboard from datagridview in winforms -

i have datagridview mydgv info filled database.

i doing ctrl+a (select all) , copying ( ctrl + c ) when paste copied info excel, first 50 rows of info getting copied. rest of rows comes blank.

here code in keydown event

if e.control andalso e.keycode = keys.c dim d dataobject = mydgv.getclipboardcontent() clipboard.setdataobject(d) e.handled = true end if

when scroll downwards grid till end (last row) , ctrl+c , paste in excel, rows getting pasted.

how proceed solve issue?

use datagridview.selectall method select rows on using ctrl + a.

and utilize next event key pressed:

void datagridview1_keydown(object sender, keyeventargs e) { if (e.control && e.keycode == keys.c) { //call datagridview.selectall method } }

.net vb.net winforms datagridview copy-paste

No comments:

Post a Comment