c# - Dynamically adding columns to DataGridView as it gets expanded -


i'm working on ms office add-in has datagridview 5 columns. possible have many columns shown can fit sidebar, user re-sizes add-in sidebar add more or take away columns there becomes room them?

u can use resize event of datagridview , add , remove (or set visibilty) of rows unwanted.

i guess columns have given size , not sized automatically.

in case u can:

int columnstoshow = (int)(datagridview.size.width / columnwidth); 

now add enough rows match wanted number / remove rows or set visibility


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -