C# - Get the sum of the total amount of width for each column in datagridview -


is there faster way other looping through each column , increment variable width?

for best solution, pretty slow:

int contentwidth = 0; foreach (datagridviewcolumn column in grid.columns) {     contentwidth += column.width; } 

this return length of visible columns:

contentwidth = grid.columns.getcolumnswidth(datagridviewelementstates.displayed); 

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -