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
|I need help displaying 2 models in one view in my MVC.Net application with C# code behind||5||30|
|Trying to get PDF to open as "Open,Save,Cancel" instead of as a pop-up.||6||31|
|DataGridView does not show data rows correctly in vb.net 2013||3||29|
|Convert an ASPX page into PDF||7||21|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
19 Experts available now in Live!