Hi,
I have a website programmed in Asp.Net and use a ListView for displaying data. The data is coming from a LinqDataSource.
In my EditItemTemplate I have a CheckBoxList which consist of:
<asp:CheckBoxList runat="server" ID="TypeCheckBoxList" RepeatColumns="2">
<asp:ListItem Value="128">6.-10. klasse<br />Norddjurs vejleder</asp:ListItem>
<asp:ListItem Value="64">6.-10. klasse<br />Syddjurs vejleder</asp:ListItem>
<asp:ListItem Value="32">Gået ud af skolen<br/>Norddjurs vejleder</asp:ListItem>
<asp:ListItem Value="16">Gået ud af skolen<br/>Syddjurs vejleder</asp:ListItem>
<asp:ListItem Value="8">Ekstra støtte<br/>Norddjurs vejleder</asp:ListItem>
<asp:ListItem Value="4">Ekstra støtte<br />Syddjurs vejleder</asp:ListItem>
<asp:ListItem Value="2">Kontakt</asp:ListItem>
<asp:ListItem Value="1">Om os<br />Medarbejdere</asp:ListItem>
</asp:CheckBoxList>
I have a column called Type in my db and it is a tinyint. Therefore I can say (byte)Eval("Type").
But how do I databind my Eval("Type") to the CheckBoxList so if Eval("Type") is 3, then the two last items are selected?
I have tried setting a hidden value which binds to Type and then in the CheckBoxList OnLoad setting the selected items. But that did'nt work.