samedi 22 avril 2017

Multiple checkbox value into datagridview single coloum

I'm trying to allow specific checkbox's if checked for the data to be merged and to be inserted into the datagridview single column.

The form is adding column as follows;

table.Columns.Add("Drinks", Type.GetType("System.Int32"))

Then

Checkbox 1 = Coke

Checkbox 2 = Pepsi Checkbox 3 = Fanta

Public Class has the following code;

Dim Drinks As String

Each of the checkbox has the following codes along with their text;

Drinks = "Coke"

The button to generate the information is as follows;

  table.Rows.Add(Drinks.ToString)
    DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
    DataGridView1.RowTemplate.Height = 100
    DataGridView1.AllowUserToAddRows = False
    DataGridView1.DataSource = table

Therefore if someone selects 'Checkbox1 & Checkbox2' how can i get datagridview coloum 'Drinks' to show coke & pepsi?




Aucun commentaire:

Enregistrer un commentaire