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

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -