button click event in datagridview -


I have a button cell in DataGrid witch. When that button is clicked, another data grid view should be visible. Click button for each button column, new datagrid view should have data differences. I do not know how to implement button click events that are different for each line. Please help me with sample code.

You clicked a button-clicked event for button cells in DataGridViewButtonColumn Can not apply. Instead, you use the CellClicked event from DataGridView and determine whether the event has been removed for a cell in your DataGridViewButtonColumn .

  Private Zero DataGrid View1_CellClick (Object Sender, DataGridViewCellEventArgs e) {// Do not ignore clicks that are not Ignore the event's  DataGridViewCellEventArgs.RowIndex  property usage Please. In our (E. column index == Datagram view1.Column ["MyButtonColumn"]. Index and E.R. Indx; = 0) {Console.WriteLine ("clicked on the line {0}", E .ro index); }}   

This is a more complete example of MSDN documentation.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -