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

[Solved] Dynamic resource filtering in Insert/Edit Template

1 Answer 101 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 2
Andrew asked on 20 Jul 2009, 01:17 PM
Hello

In my AdvancedInsertTemplate i have :
<tr> 
 <td> 
  <asp:Label ID="Label2" AssociatedControlID="CB_Groupe" runat="server" CssClass="inline-label">Groupe :</asp:Label> 
 </td> 
 <td> 
  <telerik:RadComboBox runat="server" ID="CB_Groupe" DataTextField="Text" DataValueField="Key" 
    Width="230px" Skin="Black" SelectedValue='<%# Bind("GroupeID") %>' 
    DataSource="<%# GetAvailableUsers(Container) %>"
  </telerik:RadComboBox> 
 </td> 
</tr> 
 
<tr> 
 <td> 
  <asp:Label ID="Label5" AssociatedControlID="CB_Forfait" runat="server" CssClass="inline-label">Formule :</asp:Label> 
 </td> 
 <td> 
  <telerik:RadComboBox runat="server" ID="CB_Forfait" DataSourceID="ForfaitsDataSource"
    DataTextField
="FormuleComplete" DataValueField="comptes_groupes_id" Width="230px" Skin="Black"
    SelectedValue='<%# Bind("ForfaitID") %>'
  </telerik:RadComboBox> 
 </td> 
</tr> 
 

When i want to add a control parameter on the ForfaitsDataSource (AccessDataSource). I haven't the access to the control because the control is in the AdvancedInsertTemplate.

<asp:AccessDataSource runat="server" ID="GroupesDataSource" DataFile="~/App_Data/bdd.mdb" 
  SelectCommand="SELECT * FROM [groupes]"
</asp:AccessDataSource> 
<asp:AccessDataSource runat="server" ID="StudiosDataSource" DataFile="~/App_Data/bdd.mdb" 
  SelectCommand="SELECT * FROM [studios] ORDER BY [Ordre]"></asp:AccessDataSource> 
<asp:AccessDataSource runat="server" ID="ForfaitsDataSource" DataFile="~/App_Data/bdd.mdb" 
  SelectCommand="SELECT [comptes_groupes_id], [id_groupe], [id_tarif], [nb_heures_restantes], [Studio]&', '& [duree]&'h, Backline : '&[comptes_groupes].[backline]&' , '& [nb_heures_restantes]&'h restante(s)' as [FormuleComplete]  from [comptes_groupes], [tarifs_studios], [studios] where [id_tarif] = [tarifs_studios_id] and [studios].[id] = [id_studio]"
 <SelectParameters> 
   (ControlParameter here ?) 
 </SelectParameters> 
</asp:AccessDataSource> 




I want, when the id_groupe is changed, the ForfaitsDataSource filter the SQL request (in the ForfaitsDataSource SelectCommand : "(...) AND id_groupe = (id_groupe selected in the control)" )

Any ideas ?

Thanks in advance :)

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 22 Jul 2009, 02:56 PM
Hello Andrew,

Please, see the kb article on how to Implement related dropdownlist controls in the advanced form. Using a select parameter worked well in this case, so this is something you might want to consider:
<SelectParameters>   
<asp:ControlParameter ControlID="TypeDDL" Name="?" PropertyName="SelectedValue" />   
</SelectParameters>   
 
 


Best wishes,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Scheduler
Asked by
Andrew
Top achievements
Rank 2
Answers by
Peter
Telerik team
Share this question
or