+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Custom module - Frontend controls

Custom module - Frontend controls

8 posts, 0 answered
  1. Johnny
    Johnny avatar
    45 posts
    Registered:
    08 Mar 2009
    29 Jul 2010
    Link to this post
    Hello Team,

    I have been working on a module based on Gabe´s and Ivan´s "Introduction to Sitefinity Intra-Site Module Creation". I have three tables: Golfclub that are related to Branch and Branch is related to company. For my frontend control I want to have a combobox with the golfclubs and a menu or a tabstrip that are populated depending on what the user chooses in the combobox. The menu/tabstrip should then populate my grid with the companies.

    Can some one point me in the right direction? Regular Ajaxmanager or proxy? Can I skip the first combobox/datasource and choose from a fancy looking webeditor or something?

    Thanks
    Johnny
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    29 Jul 2010
    Link to this post
    Hello Johnny,

    You should AjaxManagerProxy as we have discussed in one of your prevous tickets. What you can do is add AjaxSettings for the controls which are going to be updated from your comboboxes. You can achieve something like this one here:
    ComboBox / Related ComboBoxes
    ComboBox / Grid Filtered by Combo

    Kind regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Johnny
    Johnny avatar
    45 posts
    Registered:
    08 Mar 2009
    29 Jul 2010
    Link to this post
    I get a error and I don´t see how this is different then the backend scenario?
    Serverfel i tillämpningsprogrammet /UnigolfnetStd3.7sp3.
    --------------------------------------------------------------------------------
      
    Operatorn == är inte kompatibel med operandtyperna Guid? och Object 
    Beskrivning: Ett undantag som inte kunde hanteras uppstod när den aktuella webbegäran kördes. Mer information om felet och var i koden det uppstod finns i stackspårningen. 
      
    Undantagsinformation: System.Web.Query.Dynamic.ParseException: Operatorn == är inte kompatibel med operandtyperna Guid? och Object
      
    Källfel: 
      
    Ett undantag som inte hanteras genererades vid körningen av den aktuella webbegäran. Information om undantagets ursprung och plats kan identifieras med undantagsstackspårningen nedan.  
      
    Stackspårning: 
      
      
    [ParseException: Operatorn == är inte kompatibel med operandtyperna Guid? och Object]
       System.Web.Query.Dynamic.ExpressionParser.CheckAndPromoteOperands(Type signatures, String opName, Expression& left, Expression& right, Int32 errorPos) +484761
       System.Web.Query.Dynamic.ExpressionParser.ParseComparison() +583
       System.Web.Query.Dynamic.ExpressionParser.ParseLogicalAnd() +25
       System.Web.Query.Dynamic.ExpressionParser.ParseLogicalOr() +25
       System.Web.Query.Dynamic.ExpressionParser.ParseExpression() +22
       System.Web.Query.Dynamic.ExpressionParser.Parse(Type resultType) +25
       System.Web.Query.Dynamic.DynamicExpression.ParseLambda(ParameterExpression[] parameters, Type resultType, String expression, Object[] values) +45
       System.Web.Query.Dynamic.DynamicExpression.ParseLambda(Type itType, Type resultType, String expression, Object[] values) +67
       System.Web.Query.Dynamic.DynamicQueryable.Where(IQueryable source, String predicate, Object[] values) +62
       System.Web.UI.WebControls.DynamicQueryableWrapper.Where(IQueryable source, String predicate, Object[] values) +14
       System.Web.UI.WebControls.LinqDataSourceView.ExecuteSelectExpressions(IQueryable source, IDictionary`2 whereValues, IOrderedDictionary orderByOrderedValues, IDictionary`2 groupByValues, IDictionary`2 orderGroupsByValues, IDictionary`2 selectNewValues) +288
       System.Web.UI.WebControls.LinqDataSourceView.ExecuteSelectQuery(LinqDataSourceSelectEventArgs selectEventArgs, Object selectResult, Object table, Boolean storeOriginalValues) +327
       System.Web.UI.WebControls.LinqDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +457
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
       System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
       Telerik.Web.UI.GridTableView.PerformSelect() +4
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
       Telerik.Web.UI.GridTableView.DataBind() +221
       Telerik.Web.UI.RadGrid.DataBind() +80
       System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
       System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72
       System.Web.UI.Control.EnsureChildControls() +87
       Telerik.Web.UI.GridBaseDataList.get_Controls() +15
       Telerik.Web.UI.RadAjaxControl.PopulatePlainPanels(Control parent, List`1 list, Control root) +63
       Telerik.Web.UI.RadAjaxControl.OnPagePreRender(Object sender, EventArgs e) +1372
       System.EventHandler.Invoke(Object sender, EventArgs e) +0
       System.Web.UI.Control.OnPreRender(EventArgs e) +8683846
       System.Web.UI.Control.PreRenderRecursiveInternal() +80
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
      

    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="NearBy.NearByDataClassesDataContext" TableName="GolfClubs">
    </asp:LinqDataSource>
    <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
        ContextTypeName="NearBy.NearByDataClassesDataContext" TableName="Branches" 
        Where="GolfClubId == @GolfClubId">
        <WhereParameters>
            <asp:ControlParameter ControlID="RadComboBox1" DbType="Guid" Name="GolfClubId" 
                PropertyName="SelectedValue" />
        </WhereParameters>
    </asp:LinqDataSource>
    <asp:LinqDataSource ID="LinqDataSource3" runat="server" 
        ContextTypeName="NearBy.NearByDataClassesDataContext" TableName="Companies" 
        Where="BranchId == @BranchId">
        <WhereParameters>
            <asp:ControlParameter ControlID="RadMenu1" DbType="Guid" Name="BranchId" 
                PropertyName="SelectedValue" />
        </WhereParameters>
    </asp:LinqDataSource>
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    29 Jul 2010
    Link to this post
    Hello Johnny,

    This does not look like an exception thrown from Sitefinity. It looks like it is not accepting the where parameter for from your combo box. The problem seems to be in the <WhereParameters> in your Linq data source.

    All the best,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Johnny
    Johnny avatar
    45 posts
    Registered:
    08 Mar 2009
    29 Jul 2010
    Link to this post
    Hi Radoslav,
    I think you are on the right track but I think their is something wrong with the RadMenu and the WhereParameters. I took out the grid and the datasource connected to the grid. The combobox then populate the menu correctly but I can´t seem to get the menu to populate the grid.

    Is their some property on the menu that I need to set?
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    29 Jul 2010
    Link to this post
    Hello Johnny,

    Have you set an AjaxSetting for the Menu to be updating the Grid? Could you show us how are you populating the Grid from the menu?

    Greetings,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Johnny
    Johnny avatar
    45 posts
    Registered:
    08 Mar 2009
    29 Jul 2010
    Link to this post
    Here is my ajax settings
    protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(this.Page);
            if (ajaxManager != null)
            {
                ajaxManager.AjaxSettings.AddAjaxSetting(RadComboBox1,RadMenu1, RadAjaxLoadingPanel1);
                ajaxManager.AjaxSettings.AddAjaxSetting(RadMenu1, RadGrid1, RadAjaxLoadingPanel1);
            }
        }
  8. Johnny
    Johnny avatar
    45 posts
    Registered:
    08 Mar 2009
    30 Jul 2010
    Link to this post
    I think I´ve sorted it out... I used a couple of sqldatasources instead of linqdatasources. And after some trial and error I set DbType="Guid" in my ControlParameter. Now I just need to find out some way to set a selected value in my initial load.

    Johnny
Register for webinar
8 posts, 0 answered