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

[Solved] Nullable boolean bug

1 Answer 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sheryl Stoller
Top achievements
Rank 1
Sheryl Stoller asked on 04 Aug 2011, 02:47 PM
I understand that the dropdown for true/false/not set is the default template for a nullable boolean value (as discussed here: http://www.telerik.com/community/forums/aspnet-mvc/grid/boolean-appears-as-dropdown-in-grid.aspx ) in the grid. however, i'm using pagination on this grid, and at first they appear with the dropdown, but on subsequent pages/httpposts they just say "true" and "false" with no dropdown.

The following is my code (the javascript at the bottom is to handle another lookup on the page - this grid is looking up vendors by facility).
      <% Html.Telerik().Grid(Model.LookupItems)
        .Name("VendorLookup")
       .ToolBar(toolBar =>
       {
           toolBar.Template(() =>
           { %>
                          
                         Facility ID: <%=Html.TextBoxFor(model => model.FacilityID) %> <input type="button" onclick="rebind()" value="Submit" />
                          
           <% });
       })
  
          .Columns(columns =>
          {
              columns.Bound(o => o.BaswareSupplierID);
              columns.Bound(o => o.SupplierName);
              columns.Bound(o => o.AccountNumber);
              columns.Bound(o => o.DepartmentNumber);
              columns.Bound(o => o.PurchaseOrderRequired);
               
            
  
          })
        .DataBinding(dataBinding =>
        {
            dataBinding.Ajax().Select("GetData", "VendorLookup");
  
        })
        .ClientEvents(events => events.OnDataBinding("onload"))
        .Scrollable(scrolling => scrolling.Enabled(false))
        .Sortable(sorting => sorting.Enabled(true))
        .Pageable(paging => paging.Enabled(true))
        .Filterable(filtering => filtering.Enabled(true))
  
        .Footer(true).Render();
%>
  
<script type="text/javascript" language="javascript">
    function rebind() {
        var facilityID = $("#FacilityID").val();
        $("#VendorLookup").data("tGrid").rebind({ FacilityID: facilityID });
    }
  
    function onload(args) {
        var facilityID = $("#FacilityID").val();
        args.data = $.extend(args.data, {FacilityID: facilityID});
    }
  
</script>

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 04 Aug 2011, 03:49 PM
Hello Sheryl Stoller,

 This is actually not a bug. You are using initially server binding which renders Html.DisplayFor (the dropdownlist). After ajax paging the display template no longer works - it renders as string true / false. We have documented this behavior albeit for regular boolean fields here.

All the best,
Atanas Korchev
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

Tags
Grid
Asked by
Sheryl Stoller
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or