vb.net - VB DataGridView 1 Row selection -


i have problem . when load form datagridview , want data transferred text fields when click on > @ left of datagridview. now, have select content in rows select row. how set selects row based on left row selector? instead of having me click on contents of row ? dtguser_cellcontentclick makes me select based on content click right? should if want select entire row?

private sub dtguser_cellcontentclick(byval sender system.object, byval e         system.windows.forms.datagridviewcelleventargs) handles dtguser.cellcontentclick     if groupbox3.enabled = false     else           'this code pass value specific row selected user         lblid.text = dtguser.currentrow.cells(0).value         serial.text = dtguser.currentrow.cells(0).value         fname.text = dtguser.currentrow.cells(1).value         lname.text = dtguser.currentrow.cells(2).value         gender.text = dtguser.currentrow.cells(3).value         address.text = dtguser.currentrow.cells(4).value         contact.text = dtguser.currentrow.cells(5).value         course.text = dtguser.currentrow.cells(6).value         datestart.text = dtguser.currentrow.cells(7).value         datecomplete.text = dtguser.currentrow.cells(8).value         datecertify.text = dtguser.currentrow.cells(9).value         nationality.text = dtguser.currentrow.cells(10).value         email.text = dtguser.currentrow.cells(11).value         certification.text = dtguser.currentrow.cells(12).value     end if  end sub 

if want select entire row set selection mode fullrowselect.

datagridview1.selectionmode = datagridviewselectionmode.fullrowselect; 

if want data when click rowheader (> button) subscribe rowheadermouseclick event.

datagridview1.rowheadermouseclick += new datagridviewcellmouseeventhandler(datagridview1_rowheadermouseclick);  private sub datagridview1_rowheadermouseclick(sender object, e datagridviewcellmouseeventargs)     // put code copying row data textboxes. end sub 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -