We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Public Sub FindTypeEdit() Dim TypeCheckBoxListEdit As CheckBoxList = CType(FormView1.FindControl("Tabcontainer1").FindControl("TabPanel1").FindControl("TypeCheckBoxListEdit"), CheckBoxList) 'This was as a trial - hardcoded string of items -,representing possible values for the 'column "Type" . This was to ensure that checkboxList items are passed and display ok 'on CheckBoxList. 'Dim preferences As String = "Government,Non Government,International" 'Now, in my real life senario, I need to get the value of column "Type" 'and pass it as a string. This is where I fail. ObjectDataSource1.SelectParameters("Type").DefaultValue ' not working Dim preferences As String = ????? 'The rest below works perfectly well provided I get string variables in my preference string Dim li As ListItem Dim preference() As String = preferences.Split(",") 'Clear any previous setting TypeCheckBoxListEdit.SelectedIndex = -1 For Each pref As String In preference li = TypeCheckBoxListEdit.Items.FindByValue(pref) If li Is Nothing = False Then li.Selected = True End If Next End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.