• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 773
  • Last Modified:

Control check box in ComponentOne datagrid

Hi, expert...

i would like to control every check box in the row which when the check state change.... the caption at others columns also will change...during the design time....i had set "Presentation" = CheckBox.  May i know what is the code to control the checkbox check state?

Thank you.
3 Solutions
CheckBox1.Checked will check a check box.
I haven't used ComponentOne's products, but in general if you want to know when a check box inside a DataGrid has changed, you'll need to set up an event handler for the table's ColumnChanging event, like so (where ds is the DataSet, and dtTable is the DataTable within the DataSet that your DataGrid is displaying):
' Put this line in the Form Load event handler
    AddHandler ds.dtTable.ColumnChanging, New DataColumnChangeEventHandler(AddressOf MyTableColumnChanging)

    Private Sub MyTableColumnChanging(ByVal sender As Object, ByVal e As DataColumnChangeEventArgs)
        If e.Column.ColumnName = "Presentation" and e.ProposedValue = True Then
            ' Do whatever you want when the box is checked
        End If 
    End Sub

Open in new window

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

chkuehAuthor Commented:
Hi, ElrondCT...

should i need to declare anythings 1st before i put "AddHandler ds.dtTable.ColumnChanging, New DataColumnChangeEventHandler(AddressOf MyTableColumnChanging)" at form load? because i get an error "dtTable is not a member of 'System.Data.DataTable".

even i change my dataSet to my own...the error is "dtKitting is not a member of 'System.Data.DataSet"...

what should i do first? thanks..
"ds.dtTable" needs to be changed to your DataSet and DataTable names. They need to be declared before the AddHandler statement.
chkuehAuthor Commented:
Problem partial solved. thanks

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now