473,385 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DatagridviewCheckboxColumn

OuTCasT
374 256MB
Hi, i have a checkbox column in a datagridview. when i select it i want that rows data to move into a listbox.
i did that like this
Expand|Select|Wrap|Line Numbers
  1. Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
  2.         If DataGridView1.CurrentRow.Cells(0).Selected = True Then
  3.             ListBox1.Items.Add(DataGridView1.CurrentRow.Cells(1).Value.ToString())
  4.                    End If
  5.     End Sub
now it add the cell information to the listbox, what i want to do now is if they uncheck that column that they have already checked then it must remove the corresponding data from the listbox.

is this possible ?
Apr 16 '09 #1
1 2723
OuTCasT
374 256MB
If DataGridView2.CurrentRow.Cells(0).Selected = True Then
Dim dgCB As New DataGridViewCheckBoxCell
Dim blnchecked As Boolean
dgCB = CType(DataGridView2("Select Category", e.RowIndex), DataGridViewCheckBoxCell)
If dgCB.EditedFormattedValue Then
blnchecked = True
Else
blnchecked = False
End If
Apr 30 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Bill | last post by:
I have an unbound DataGridView with a DataGridViewCheckBoxColumn as column 2(configured in the designer). How would I programatically set the checkbox state in, say, row 3 column 2? I need to do...
0
by: Brian | last post by:
I've got a datagridview with a bound dataset. I also added an unbound checkbox column. I can check the box when I run the application with the mouse but can't seem to set the checkbox through the...
0
by: Sunday Oke | last post by:
hello I have a datagrid view with a DataGridViewCheckBoxColumn, and all I'm trying to do is use the "CellContentClick" toggle the check box on and off (or checked and unchecked) So far I...
1
by: baudenbacher | last post by:
Hi all, I´m using a System.Windows.Forms.DataGridView which first column is a DataGridViewCheckBoxColumn (.NET 2.0). My DataGridView is enabled to insert new rows. When a check the...
9
by: =?Utf-8?B?UGV0ZXJX?= | last post by:
I have a TabControl on a Windows form in which I have various tab pages each with a DataGridView, the first column of which is a DataGridViewCheckBoxColumn and subsequent columns being...
2
by: usharanib | last post by:
Hi, I m doing project in windows application using c#.net 2005. In this i m having datagridview with 5 datagridviewtextboxcolumn and 1 datagridviewcheckboxcolumn. In my project i m converting...
3
by: Soulless | last post by:
Hi, I am very new to C# and am trying to figure out DataGrids. I have a DataGrid whos data member (I think that is what it is called) has a checkbox on it. The checkbox defaults to a check that...
0
by: news.microsoft.com | last post by:
Hi, I am having problem using "DataGridViewCheckBoxColumn" in my project. The function dgvCheckBox_Clicked is called when CheckBox in DataGrid is clicked ( checked or unchecked). ...
12
by: G.S. | last post by:
Is it acceptable to use { } blocks to improve readability and maintainability of the code? Example: //add the checkbox column DataGridViewCheckBoxColumn column = new...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.