Winforms DataGridView Notes
It is not often when I have to go and create a DataGridView in Winforms so here are some notes. Sadly we are stuck in .net 2.0. I find it easier to add the columns manually through the designer that the datagridview will hold. Ids, text fields, buttons, etc. I have a custom CalendarColumn as well. The main fields of the columns in the dgv that are used are the HeaderText, Visible, DefaultCellStyle->Format, DataPropertyName, Name, AutoSizeMode, and Width. In case of Button UseColumnTextForButtonValue (remember to have the FlatStyle = Standard). When accessing data, the values could be nothing or DBNull.value, depending if it is a new row or not. So will need a lot of testing for DBNull or Nothing. Adding data to dgv could be done inside the dgv, but having fields outside to add to the grid is feasible as well. Modifing inside or outside grid can work. Deleting seems to work well inside. Rebinding works well after a changing data (aka getting datatable and setting it