c# - Getting the selected row from dataGridView1 -
The datagrid view on my Wondose form is 1. I have popped the Data Grid view 1 with a list of wires. It all works great but ...
I should be able to get the line at which the user has been selected and I can not do that. My code just gives me an error, written below.
I have copied the Gridview form to the site. I tried to do this, but I'm getting the error: "Type or namespace 'Gridviewview' could not be found." My basic question is how do I get to do this work? Assume that you have a By copying that link, you got their code with WPF controls and Winfords. Often people only add Private Zero Edit Button (Object Sender, EventGurge E) {GridViewRow row = dataGridView1.SelectedRow; // This is what I was using earlier with a list box. If (itemList.SelectedIndex> = 0) {int newInt = itemList.SelectedIndex; Form form = new new item (selected folders, this, item [newiint], windowname. Item report); Form.Show (); }}
Winforms DataGridView you should do this: < / p>
Private Zero editing button_kill (object sender, eventarges e) {if (Datagraphic view 1. Selected Rhodes.Count> 0) {DataGridView line = DataGrid view. Selectors [0]; If (itemList.SelectedIndex> = 0) {int newInt = itemList.SelectedIndex; Form form = new new item (selected folders, this, item [newiint], windowname. Item report); Form.Show (); }}}
DataGridView vs
GridViewRow , but you also have copied Wong Property
SelectedRow . Instead use the first element of the
SelectedRows archive Always check with this or the array accessal will crash.
Comments
Post a Comment