Home > Net >  How do you modify selected a line in the listview
How do you modify selected a line in the listview

Time:09-23

 is shown in figure, click on 'modify the answer button to enter into another form, three text box shows the answer respectively, and can provide changes, save the answer to the listview is changed

CodePudding user response:

To a great god help me answer the autumn cream

CodePudding user response:

Save after updating the database, and reload the data to the listview control data,

CodePudding user response:

String ss="";

If (listView1 SelectedIndices!=null & amp; & ListView1. SelectedIndices. Count & gt; 0)
{
Ss=this. ListView1. SelectedItems [0]. SubItems [0]. The Text; The first column//SubItems [0]

}
//ss if be index, and then spread to another form, query the database, then fill the other information to the form, then click modify

CodePudding user response:

Two shows various right way upstairs.
Can click on a cell, put a textbox directly to the correct position above, look better, processing interface, or choose a editable other controls

CodePudding user response:

First get selected row index value, modify, use remove to remove the line first, and then use the insert insert (here want to use the index values), thus modify the good the

In addition, if it is bulk changes, Suggestions from forward modification, after such index values are not random
  •  Tags:  
  • C#
  • Related