Can CheckBoxList items be used in SelectParameters of ODS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bogdan

    Can CheckBoxList items be used in SelectParameters of ODS

    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


  • =?Utf-8?B?TG91aXMgU29tZXJz?=

    #2
    RE: Can CheckBoxList items be used in SelectParameter s of ODS

    Unfortunately the ListItem class is a sealed class.
    You cannot inherit from it and add any new preoperties to it.

    Again unfortunately, it also does not have any 'tag' property of type Object
    on which you would hang your custom class with metadata.

    You would have to whrite your own CheckBoxList component, or get a 3rd party
    one.

    "Bogdan" wrote:
    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
    >
    >
    >

    Comment

    Working...