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

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -