This is a migrated thread and some comments may be shown as answers.

Databind Dropdownlist

2 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
saritha78
Top achievements
Rank 1
saritha78 asked on 03 Jun 2010, 12:07 AM
Hi,
In this example, instead of the label, if I have a dropdown list, how do I databind it?
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplatedeclarativerelations/defaultcs.aspx

Here's my code:
<NestedViewSettings DataSourceID="odsContactDetails">  
 <ParentTableRelation> 
   <telerik:GridRelationFields DetailKeyField="CrmEntityId" MasterKeyField="CrmEntityId" /> 
  </ParentTableRelation> 
 </NestedViewSettings> 
<NestedViewTemplate> 
  <asp:Panel ID="pnlContactInfo" runat="server">  
  <asp:DropDownList ID="ddlPhones" runat="server"  DataTextField="Phone" DataValueField="Phone"/>  
  <asp:DropDownList ID="ddlEmails" runat="server" DataTextField="Email" DataValueField="Email"/>  
  </asp:Panel> 
</NestedViewTemplate> 
 
 
.....  
 
 
 <asp:ObjectDataSource ID="odsContactDetails" runat="server"   
  SelectMethod="GetContactInfo" TypeName="FVS.ControllerCRM.CRMDataControl">  
     <SelectParameters> 
        <asp:Parameter Name="crmEntityId" Type="String" /> 
        </SelectParameters> 
</asp:ObjectDataSource> 
 
 

I have got it to work, the data is returned by the datalayer, but it is not getting bound to the dropdownlist.
Thanks in advance!

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 03 Jun 2010, 08:58 AM
Hello Saritha,

 From your code i cannot see the DataSourceID property set to DropDownList. Try setting the property and I hope that will work.

Regards,
Shinu.
0
saritha78
Top achievements
Rank 1
answered on 03 Jun 2010, 06:27 PM
Arg! That was it! Thanks so much.
What I dont understand is, that the NestedViewSettings has the DataSourceID specified, isnt it redundant to specify it on the DropDownList as well?
Thanks again,
Tags
Grid
Asked by
saritha78
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
saritha78
Top achievements
Rank 1
Share this question
or