Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.
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.