How to bind a LLGenDataSource to a DropDownList

Posts   
 
    
gurzaco
User
Posts: 1
Joined: 17-May-2007
# Posted on: 17-May-2007 17:23:49   

Hi everybody:

Maybe my question has been replay before in other threat, but I cant find it.

It is possible to bind a LLGenDataSource to a DropDownList as just we can do with a GridView? Por ejample, I would like to have a DropDownList with all the Countries which are stored in a column from the database. Then when the user selects one coutry, this value is used in a GridView to filter the results.

Thanks in advance for any help.

Guri

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 18-May-2007 01:46:32   
<llbl:LLBLDataSource ID="MyDataSource" ... />
<asp:DropDownList ... DataText="Country" DataValue="CountryId" DataSourceID="MyDataSource" />
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 18-May-2007 09:53:01   

bind the dropdownList as Jason showed you. Then use another LLBLGenDataSource for the GridView with a SelectParameter tag, that filter upon the selected item/value from the dropdownList.

Example for the second datasource:


<cc1:LLBLGenProDataSource ID="llblgenDS2" runat="server"
    CacheLocation="Session" DataContainerType="EntityCollection" 
    EnablePaging="True"
    EntityCollectionTypeName="NWTest.CollectionClasses.OrderCollection, NWTest"
    LivePersistence="True">
    <SelectParameters>
        <asp:ControlParameter ControlID="DropDownList1" Name="CountryName" PropertyName="SelectedValue" Type="String" />
    </SelectParameters>
</cc1:LLBLGenProDataSource>