Hi,
I have a CheckBoxList on a page and an Object Data Source which expects
values from the list as its select parameters. Is there a way to
declaratively define select parameters to reference items in the check box
list?
Example:
<asp:CheckBoxLi st ID="cblTypes" runat="server" AutoPostBack="T rue"
RepeatDirection ="Horizontal " RepeatLayout="F low" CssClass="legen d"
onselectedindex changed="cblTyp es_SelectedInde xChanged">
<asp:ListItem Selected="True" Value="1">Type1 </asp:ListItem>
<asp:ListItem Value="2">Type2 </asp:ListItem>
<asp:ListItem Value="1">Type3 </asp:ListItem>
</asp:CheckBoxLis t>
[...]
<asp:ObjectData Source ID="odsElements " runat="server"
OldValuesParame terFormatString ="{0}"
SelectMethod="G etElementsByUse rId" TypeName="Eleme ntsBLL">
<SelectParamete rs>
<asp:SessionPar ameter Name="userId" SessionField="U serId" Type="String" />
[...]
</SelectParameter s>
</asp:ObjectDataS ource>
The BLL's select method has the following signature:
public Elements.Elemen tDataTable ElementsBLL.Get ElementsByUserI d(string
userId, short type1, short type2, short type3)
If this cannot be done declaratively then what is the best approach if the
ODS provides data to a GridView control?
Thanks,
Bogdan
I have a CheckBoxList on a page and an Object Data Source which expects
values from the list as its select parameters. Is there a way to
declaratively define select parameters to reference items in the check box
list?
Example:
<asp:CheckBoxLi st ID="cblTypes" runat="server" AutoPostBack="T rue"
RepeatDirection ="Horizontal " RepeatLayout="F low" CssClass="legen d"
onselectedindex changed="cblTyp es_SelectedInde xChanged">
<asp:ListItem Selected="True" Value="1">Type1 </asp:ListItem>
<asp:ListItem Value="2">Type2 </asp:ListItem>
<asp:ListItem Value="1">Type3 </asp:ListItem>
</asp:CheckBoxLis t>
[...]
<asp:ObjectData Source ID="odsElements " runat="server"
OldValuesParame terFormatString ="{0}"
SelectMethod="G etElementsByUse rId" TypeName="Eleme ntsBLL">
<SelectParamete rs>
<asp:SessionPar ameter Name="userId" SessionField="U serId" Type="String" />
[...]
</SelectParameter s>
</asp:ObjectDataS ource>
The BLL's select method has the following signature:
public Elements.Elemen tDataTable ElementsBLL.Get ElementsByUserI d(string
userId, short type1, short type2, short type3)
If this cannot be done declaratively then what is the best approach if the
ODS provides data to a GridView control?
Thanks,
Bogdan
Comment