I create a DataGridView with a CheckBox column to be able to mark one or another row.
As data source of the DataGridView I pass a list of strings. When I passed the list, I expected to obtain a datagridview that showed me as the first column, a column of checkbox and the second column the string of the list, but no, instead of the string it shows me its length:
In the Length column you should (or would like to) show the strings passed through the list and not their length.
The way to generate the "Selection" column is as follows:
DataGridViewCheckBoxColumn column = new DataGridViewCheckBoxColumn(); column.HeaderText = "Seleccion"; column.Name = "Seleccion"; column.TrueValue = true; column.FalseValue = false; column.IndeterminateValue = false; column.ThreeState = false; column.ValueType = typeof(Boolean); dgRemotas.Columns.Add(column);
and to add the string list I do the following:
dgRemotas.DataSource = list;
list is defined as:
public List<string> list;
How can I show the string instead of its length?