1. Add a table header
sGC. primarygrid.selectiongranularity = Selectiongranularity.row; // Click to select a row NULL ; New DevComponents.DotNetBar.SuperGrid.GridColumn ("ID"); sGC. PRIMARYGRID.COLUMNS.ADD (GC); New DevComponents.DotNetBar.SuperGrid.GridColumn (" type code "); sGC. PRIMARYGRID.COLUMNS.ADD (GC);
2. Add Data plus a row
sGC. PRIMARYGRID.ROWS.ADD ( new Gridrow (newobject"a" " b " }));
3. Click to select a row to take the first row of the value of the first column
Selectedelementcollection col = SGC. Primarygrid.getselectedrows (); // the selected row collection if 0 ) { = (col[0 as Gridrow); int. Parse (Gr. cells[0]. Value.tostring ()); // take the value of the first column and turn it // is equivalent to int id= Int. Parse (SGC. Primarygrid.getselectedrows () [0] as Gridrow). Cells[0]. Value.tostring ()); }
C # WinForm Change of parts Supergridcontrol