Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

How to check Checkbox in TreeView porgramatically

Avatar of alsam
alsam asked on
.NET ProgrammingVisual Basic.NET
7 Comments1 Solution431 ViewsLast Modified:
Hi,
please can someone provide me the with the way how can I check checkbox for childnode in my Treeview after If condition is true. Code below

Thank you.
Kind regards.
Private Sub Show_filters(ByVal param As String, ByVal childnode As String)
        Dim cmdSelectFilters As New SqlCommand()
        Dim DataSetFilters As DataSet
        Dim Con As New SqlClient.SqlConnection(My.Settings.MyConnectionString)
        Dim DAFilters As New SqlClient.SqlDataAdapter
        Dim oDataRow As DataRow
        Dim oNode As New TreeNode
        Dim oTreeView As TreeView
        oTreeView = Me.TreeView1


        DAFilters.SelectCommand = cmdSelectFilters
        DAFilters.SelectCommand.Connection = Con
        DAFilters.SelectCommand.CommandText = "SELECT * FROM ALL_TREE_FILTERS WHERE LEAF_NAME = @param AND FILTER_NAME = @param2"
        DAFilters.SelectCommand.Parameters.Add("@param", SqlDbType.NVarChar)
        DAFilters.SelectCommand.Parameters("@param").Value = param
        DAFilters.SelectCommand.Parameters.Add("@param2", SqlDbType.NVarChar)
        DAFilters.SelectCommand.Parameters("@param2").Value = Me.ComboBox2.Text

        DataSetFilters = New DataSet()
        Con.Open()
        DAFilters.Fill(DataSetFilters, "All_Tree_Filters")
        Con.Close()


        For Each oDataRow In DataSetFilters.Tables("All_Tree_Filters").Rows

            If oDataRow("LEAF_VALUE") & (" " + oDataRow("DESCRIPTION").ToString()) = childnode Then

                '''' HERE I WANT TO SET CHECKBOX CHECKED FOR THE CHILDNODE''''

            End If
        Next oDataRow



    End Sub
ASKER CERTIFIED SOLUTION
Avatar of 1303gun
1303gunFlag of Brazil image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answers