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

[Solved] Lambda Expression and Delegate Error on Splitter/Grid Combination

1 Answer 96 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rachael
Top achievements
Rank 1
Rachael asked on 23 Feb 2012, 09:33 PM
I have the following splitter with 4 vertical panes inside a partial view. The second and fourth panes contain a grid and the first and third panes contain a header for the grid sections. All panes compile and display appropriately until I add the content to the 3rd pane (buttons and a label), which is basically the same as section 1 with the ids/titles renamed. When I add this content I return the following errors:

1) Delegate 'System.Func<object,object>' does not take 0 arguments.
2) Not all code paths return a value in lambda expression of type 'System.Func<object,object>'
3) Cannot convert lambda expression to type 'string' because its not a delegate type

When I select the error it comes up at the Content (() => section of the 3rd pane.
Any help would be appreciated.
<% Html.Telerik().Splitter().Name("QualCondJurSplitter")
        .HtmlAttributes(new { style = "height: 450px;" })
        .Orientation(SplitterOrientation.Vertical)
        .Panes(vPanes => {
                //SECTION 1
            vPanes.Add()
               .Size("20px")
               .Collapsible(false)
               .Resizable(false)
               .Content(() =>
               {%>
                       <div>
                            <img src="<%=Url.Content("~/Content/images/add2.png") %>" id="AddQualifyCond" title="Add Qualifying Condition"
                                class="actionImg readOnly" />
                            <img src="<%=Url.Content("~/Content/images/spacer16.png") %>" id="AddQualifyCondSpacer" title="" class="actionImg readOnly inithide"  />
                            <img src="<%=Url.Content("~/Content/images/edit.png") %>" id="EditQualifyCond"" title="Edit Qualifying Condition" class="actionImg readOnly" />
                            <img src="<%=Url.Content("~/Content/images/spacer16.png") %>" id="EditQualifyCondSpacer" title="" class="actionImg readOnly inithide"  />
                            <img src="<%=Url.Content("~/Content/images/delete2.png") %>" id="DeleteQualifyCond" title="Delete Qualifying Condition" class="actionImg readOnly" />
                        
                            <div style="text-align:center"><%= Html.Label("Qualifying Conditions")%>   </div>
             
                        </div>
 
                <% });
                //SECTION 2
            vPanes.Add()
                        //.Size("20px")
                  .Collapsible(false)
                  .Resizable(false)
                  .Content(() =>
                    {%>
 
                      <%  Html.Telerik().Grid(Model.taxRuleRepository.taxRuleQualCond)
                            .Name("QualifyingConditionsGrid")
                            .Columns(columns =>
                            {
                                columns.Bound(o => o.taxabilityCategory.TaxabilityCategoryId).Title("Category Id");
                                columns.Bound(o => o.taxabilityCategory.TaxabilityCategoryName).Title("Category Name");
                                columns.Bound(o => o.qcDataType.DataTypeName).Title("Type");
                                columns.Bound(o => o.DisplayMinDate).Title("Min Date").Format("{0:MM/dd/yyyy}").Width(30);
                                columns.Bound(o => o.DisplayMaxDate).Title("Max Date").Format("{0:MM/dd/yyyy}").Width(30);
                                columns.Bound(o => o.exprConditionType.ExprCondTypeName).Title("Operator");
                                columns.Bound(o => o.CompareValue).Title("Numeric Value");
                            })
                            .DataBinding(dataBinding => dataBinding.Ajax().Select("_AjaxGetQualifyingCond", "TaxRule"))
                            .Selectable()
                            .Sortable(settings => settings.Enabled(false))
                            .Filterable(settings => settings.Enabled(false))
                            .Footer(false)
                            .DataKeys(dataKeys => dataKeys.Add(c => c.TaxRuleQualCondId))
                            .Render();%>
      
              <% });
            //SECTION 3 Error at Content
            vPanes.Add()
               .Size("20px")
               .Collapsible(false)
               .Resizable(false)
               .Content(() =>
               {%>
                    <div>
                        <img src="<%=Url.Content("~/Content/images/add2.png") %>" id="AddTaxRuleCondJur" title="Add Conditional Jurisdiction Condition" class="actionImg readOnly" />
                        <img src="<%=Url.Content("~/Content/images/spacer16.png") %>" id="AddTaxRuleCondJurSpacer" title="" class="actionImg readOnly inithide"  />
                        <img src="<%=Url.Content("~/Content/images/edit.png") %>" id="EditTaxRuleCondJur" title="Edit Conditional Jurisdition" class="actionImg readOnly" />
                        <img src="<%=Url.Content("~/Content/images/spacer16.png") %>" id="EditTaxRuleCondJurSpacer" title="" class="actionImg readOnly inithide"  />
                        <img src="<%=Url.Content("~/Content/images/delete2.png") %>" id="DeleteTaxRuleCondJur" title="Delete Conditional Jurisdiction Condition" class="actionImg readOnly" />
            
                        <div style="text-align:center"><%= Html.Label("Conditional Jurisdictions")%>   </div>
                    </div>
                <% });
                //SECTION 4
            vPanes.Add()
               .Content(() => {
               %>
                   <%   Html.Telerik().Grid(Model.taxRuleRepository.taxRuleCondJur)
                        .Name("ConditionalJurisdictionsGrid")
                        .Selectable()
                        .Sortable(settings => settings.Enabled(false))
                        .Filterable(settings => settings.Enabled(false))
                        .Footer(false)
                        .DataKeys(dataKeys => dataKeys.Add(c => c.TaxRuleCondJurId))
                        .Columns(columns =>
                        {
                            columns.Bound(o => o.TaxRuleCondJurId).Hidden();
                            columns.Bound(o => o.TaxRuleSourceId).Hidden();
                            columns.Bound(o => o.TaxRuleId).Hidden();
                            columns.Bound(o => o.jurisdiction.JurisdictionId).Title("Jurisdiction Id");
                            columns.Bound(o => o.jurisdiction.Name).Title("Jurisdiction Name");
                            columns.Bound(o => o.jurisdiction.JurisdictionTypeName).Title("Jurisdiction Type");
                            columns.Bound(o => o.EffDate).Hidden();
                            columns.Bound(o => o.EndDate).Hidden();
                            columns.Bound(o => o.taxType.TaxTypeId).Hidden();
                            columns.Bound(o => o.taxType.TaxTypeName).Hidden();
                        })
                        .DataBinding(dataBinding => dataBinding.Ajax().Select("_AjaxGetCondJur", "TaxJurisdiction"))
                        .Render();%>
                <%});
         })
        .Render();
             
    %>




1 Answer, 1 is accepted

Sort by
0
Rachael
Top achievements
Rank 1
answered on 24 Feb 2012, 04:04 PM
I added a reference to a css file and it seemed to fix the problem. Even though I have no idea why this is related.
Tags
Splitter
Asked by
Rachael
Top achievements
Rank 1
Answers by
Rachael
Top achievements
Rank 1
Share this question
or