Skip to main content

Blog

C# - DataGridView - How to Hide a Column

There are situation when you would like to show only some of the columns that are available in a DataGridView on your form. E.g. a DataGridView could display contact information to system administrators, but for every other user else these information would be hidden.

C# - DataGridView - Cell Text Show Up With "Square" Characters Instead New Lines Problem

Default text behaviour in a DataGridViewTextBoxCell control is that it doesn't wrap.

The behaviour can be changed using the WrapMode property on the cell style. For example, DataGridView.DefaultCellStyle.WrapMode.

This can cause that new line characters in the text do not apply and that's the reason why they are displayed as a non-printable characters. You can compare this behavior with Text property of a TextBox control when the MultiLine property is set to "false".

Ubuntu 12.04 - Most Common Problems and Solutions

Although Ubuntu 12.04 Precise Pangolin is LTS release, long term supported and stable GNU/Linux version, it has some issues.

We provide the list with the most common Ubuntu 12.04 Precise Pangolin problems and their solutions.

C# - DataGridView - Show Controls in All Cells Regardless of Edit

The DataGridView control can display only an actual control when a cell is in edit mode.

The DataGridView is not capable for displaying multiple controls or repeating a set of controls per row. It displays a representation of the control when the cell is not being edited.

The represenation can be a detailed, e.g. the DataGridViewButtonCell draws a button regardless of the cell being in edit or not.

C# - DataGridView - How to Prevent Cell From Being Editable

DataGridView control has a property named ReadOnly that determins if the data in the cell can be changed. The ReadOnly property can be set not only for particular cells but also for entire rows and column. You can achieve this behavior by setting the DataGridViewRow.ReadOnly or DataGridViewColumn.ReadOnly properties.

By default, if a cell's parent row or column is set to read-only, the child cells will adopt the same value.