c# winforms gridview and selection boxes -
i have winforms c# app displays tabular data db gridview control.
i need programmatically add final column tickbox each row, in order find out rows have been ticked form current view.
how go doing that, tickbox column not exist in db?
you add column directly datasource before binding datagridview. supposing using datatable
datacolumn dc = table.columns.add("select", typeof(bool)); dc.defaultvalue = false; grid.datasource = dt;
another method define datagridviewcheckboxcolumn() , append current column list
checkcol = new datagridviewcheckboxcolumn(); checkcol.headertext = "select"; checkcol.width = 80; checkcol.readonly = false; grid.columns.add(checkcol);
Comments
Post a Comment