Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > DataGridViewCheckBoxColumn
 

DataGridViewCheckBoxColumn

Hi

i am new to dot net 2005(Vb.net)Windows Application

how to add DataGridViewCheckBoxColumn in this sample code

i am fetching Status column from database and in this field i will be having YES/NO value
if YES i want to Check the checkbox column
if NO i don't want to check the checkbox column

can some one help me in this?

Thanks in advance

Dim oOracleConn As New OracleConnection("Data Source=serverName;User Id=userid;Password=password")
Dim sExecuteQuery As String
sExecuteQuery = "select CustomerName,CustomerID,Customer_address,Status from customermaster"
Dim odaAdapter As New OracleDataAdapter(sExecuteQuery, oOracleConn)

Dim tbl1 As New DataTable

Dim Col11 As New DataColumn()
Dim Col12 As New DataColumn()
Dim Col13 As New DataColumn()

Col11.DataType = System.Type.GetType("System.String")
Col11.ColumnName = "CustomerName"
Col11.Caption = "CustomerName"
Col11.ReadOnly = False
tbl1.Columns.Add(Col11)

Col12.DataType = System.Type.GetType("System.String")
Col12.ColumnName = "CustomerID"
Col12.Caption = "CustomerID"
Col12.ReadOnly = False
tbl1.Columns.Add(Col12)

Col13.DataType = System.Type.GetType("System.String")
Col13.ColumnName = "Customer_address"
Col13.Caption = "Customer_address"
Col13.ReadOnly = False
tbl1.Columns.Add(Col13)

---
Check box column here.

????

--

odaAdapter.Fill(tbl1)
DataGridView1.DataSource = tbl1

---

Naren

narend  Friday, September 29, 2006 6:06 PM
Take a look the datagridviewcheckboxcolumn's truevalue and falsevalue.
Ken Tucker  Saturday, September 30, 2006 10:34 AM

You can use google to search for other answers

Custom Search

More Threads

• DataTable Returns 0 rows- but data is there
• How to modify DataGridView values upon Database update
• Filtering data listed in a combobox in a datagridview
• Subclass the BindingNavigator
• VB .net Code for storing data from MS SQL server 2000
• binding combobox to object
• Suppling the parameters for insert
• Listview SelectedIndex()?
• Bolding/Coloring a single word in a grid cell
• Databound controls - deployment problem !!