c# - how to retrieve selected row of datagrid into textboxes -


i using windows application c# , want show datagrid's selected row data in text boxes. want user click datagrid selected row should show in textboxes need put code?? event of datagrid use , need write code?? trying not working right way thing?

private void gvprodcttypname_cellcontentclick(object sender, datagridviewcelleventargs e) {  tbproducttypename.text = gvprodcttypname.selectedrows[0].cells[1].value.tostring();   } 

move code selectionchanged event:

private void gvprodcttypname_selectionchanged(object sender, eventargs e) {     tbproducttypename.text = gvprodcttypname.selectedrows[0].cells[1].value.tostring(); } 

i guess using selectionmode = fullrowselect should work. otherwise have access selectedcells instead.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -