I have a datagridview which im binding DataTable to. What I want do is add an extra column which will fill out the remaining gap in the windows form. At the moment I only have 3 columns so the width of all the columns is only about half the size of the windows form.
C# – Add extra column to fill out space in datagridview C#
cdatagridviewnetwinforms
Related Topic
- C# – How to remedy “The breakpoint will not currently be hit. No symbols have been loaded for this document.” warning
- C# – Programmatically add new column to DataGridView
- C# – reason for C#’s reuse of the variable in a foreach
- C# – DataGridView AutoFit and Fill
- Scala: list.flatten: no implicit argument matching parameter type (Any) = > Iterable[Any] was found
Best Answer
After databinding the DataTable to the DataGridView, set the desired column's AutoSizeMode to Fill.
You may also want to set the DataGridView to Anchor to the Right and Bottom sides of the form (as well as the left and top) so that the DGV gets bigger as the form is resized. (or set Dock to Fill).