|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Need to check a checkbox in a checkedlistbox at run timerun time. However I also need to check the items depending on a condition. I have tried a lot but cant get the added item to check. Here is my code. Dim objdb As New clsDB PaymentOptions = objdb.GetPaymentOptionsByProductID Dim objrowPaymentOptions As DataRow For Each objrowPaymentOptions In PaymentOptions.Tables(0).Rows Dim string1 as string = CType(objrowPaymentOptions.Item("is_default"), String) checkedListBox1.Items.Add(CType(objrowPaymentOptions.Item("new_item"), String)) If string1 = "Y" Then ..............Code to check the item added above...... End If next I hope you got my question. Anyone please help. Thanks Riaz Hi you can use one of the overloads of the items.add to specify if the item
is checked or not. checkedListBox1.Items.Add("X",true) Hope this helps Greetz Peter -- Show quoteHide quoteProgramming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook) <akunuri.swa***@gmail.com> schreef in bericht news:1148415197.166820.298170@j33g2000cwa.googlegroups.com... > Hi All - I have a checkedListBox in my form. I am adding items to it at > run time. However I also need to check the items depending on a > condition. I have tried a lot but cant get the added item to check. > Here is my code. > > Dim objdb As New clsDB > PaymentOptions = objdb.GetPaymentOptionsByProductID > Dim objrowPaymentOptions As DataRow > For Each objrowPaymentOptions In PaymentOptions.Tables(0).Rows > Dim string1 as string = > CType(objrowPaymentOptions.Item("is_default"), String) > > checkedListBox1.Items.Add(CType(objrowPaymentOptions.Item("new_item"), > String)) > If string1 = "Y" Then > .............Code to check the item added above...... > > End If > next > > I hope you got my question. > Anyone please help. > > > Thanks > Riaz >
What's the most performant? Fat our smart client?
Postmessage API Can't get true random numbers CHRW .Net Mail and hotmail question Searching within search results (Database) What are they? Controls do not show correctly at runtime. Getting correct copy count from Print Dialog box Problem sending Crystal report (HTML format) via MAPI |
|||||||||||||||||||||||