A lot of details have not been recorded for a long time. Now we need to pay attention to the fact that good memory is not as good as bad writing, you know
1. In winform, how does C # determine whether the checkbox column in The dview is selected?
For (INT I = 0; I <datagridview1.rows. Count; I ++)
{
If (bool) datagridview1.rows [I]. cells [0]. editedformattedvalue = true)
{
// Todo
}
}
2. Select All checkbox columns in the datagridview
Private void checkall_checkedchanged (Object sender, eventargs e) {If (datagridview1.rows. count> 0) {for (INT I = 0; I <= datagridview1.rows. count-1; I ++) {maid (I ). cells (0 ). value = true ;}} 3. In the checkbox column of the dview datagri, select private void checkreverse_checkedchanged (Object sender, eventargs e) {If (datagridview1.rows. count> 0) {for (INT I = 0; I <= datagridview1.rows. count-1; I ++) {If (convert. toboolean (maid (I ). cells (0 ). editedformattedvalue) {maid (I ). cells (0 ). value = false;} else {datagridview1.rows (I ). cells (0 ). value = true ;}}4, C # retain the second decimal point double dbdata = 0.55555;
String str1 = dbdata. tostring ("F2"); // FN retains n digits, rounding string str1 = string. format ("{0: N2}", 5.6789); // result: 56,789.05, C # display angle symbol string str1 = string. format ("{0: N2}", 5.6789); // result: 56,789.0
Textbox1.text = str1 + "°"; special characters -- open sogou -- menu -- soft keyboard -- select "°" for special characters.