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

rad grid Row selection not working on server

1 Answer 517 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 09 Aug 2017, 06:19 PM

Dev environment: Win10, VS2017, DNN Evoq Community 9.1.1, target framework = 4.5, SqlServer 2012, Telerik 2017.2.711.40

Production environment: Win Server 2012, DNN Evoq Basic 9.1.1, target framework = 4.5, SqlServer 2012, , Telerik 2017.2.711.40

 

My custom DNN module allows row selection on my dev PC, but when I copy it to the server it does not allow row selection.  I have tried client- and server-side tactics. Any thoughts?

 

This is my markup in server-side mode.

    <telerik:RadGrid ID="rgPlacements" runat="server"
        AllowSorting="True"
        AutoGenerateColumns="False"
        HeaderStyle-HorizontalAlign="Center"
        HeaderStyle-VerticalAlign="Top"
        ItemStyle-VerticalAlign="Top"
        AlternatingItemStyle-VerticalAlign="Top"
        Skin="WebBlue"
        RenderMode="Classic"
        AllowPaging="True"
        PageSize="50"
        AllowMultiRowSelection="True"
        DataSourceID="sdsArchive"
        AllowFilteringByColumn="True"
        OnInit="rgPlacements_Init">
  
<%--        <ClientSettings>
            <Selecting AllowRowSelect="True"/>
        </ClientSettings>--%>
        <ExportSettings
            FileName="Placements"
            ExportOnlyData="true"
            IgnorePaging="true"
            OpenInNewWindow="true"
            HideStructureColumns="true">
        </ExportSettings>

        <GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>
        <AlternatingItemStyle VerticalAlign="Top" />
        <MasterTableView CommandItemDisplay="Top" DataKeyNames="PK_ID" DataSourceID="sdsArchive" Name="Placements">
            <CommandItemSettings ShowAddNewRecordButton="false" ShowExportToExcelButton="true" ShowRefreshButton="false" />
            <Columns>
                <telerik:GridBoundColumn AllowFiltering="true" DataField="DisplayName" FilterControlAltText="Filter DisplayName column" HeaderText="Name" SortExpression="DisplayName" UniqueName="DisplayName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn AllowFiltering="false" DataField="HoursCompleted" DataType="System.Decimal" FilterControlAltText="Filter HoursCompleted column" HeaderText="Hours completed" SortExpression="HoursCompleted" UniqueName="HoursCompleted">
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn AllowFiltering="true" DataField="Supervisor" FilterControlAltText="Filter Supervisor column" HeaderText="Supervisor" SortExpression="Supervisor" UniqueName="Supervisor">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn AllowFiltering="true" DataField="DateSupervisorApproval" DataFormatString="{0:d}" DataType="System.DateTime" FilterControlAltText="Filter DateApproved column" HeaderText="Approved" SortExpression="DateApproved" UniqueName="DateApproved">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn AllowFiltering="true" DataField="Name" FilterControlAltText="Filter Name column" HeaderText="Org. name" SortExpression="Name" UniqueName="Name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn AllowFiltering="false" DataField="IsProBonoName" FilterControlAltText="Filter IsProBonoName column" HeaderText="Type" SortExpression="IsProBonoName" UniqueName="IsProBonoName">
                </telerik:GridBoundColumn>
<%--                <telerik:GridClientSelectColumn HeaderText="Archive" UniqueName="ClientSelectColumn">
                    <ItemStyle HorizontalAlign="Center" />
                </telerik:GridClientSelectColumn>--%>
            <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" AllowFiltering="false">
              <ItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged="ToggleRowSelection"
                  AutoPostBack="True" />
              </ItemTemplate>
              <HeaderTemplate>
                <asp:CheckBox ID="headerChkbox" runat="server" OnCheckedChanged="ToggleSelectedState"
                  AutoPostBack="True" />
              </HeaderTemplate>
            </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Top" />
        <ItemStyle VerticalAlign="Top" />
    </telerik:RadGrid>

</telerik:RadAjaxPanel>
<asp:SqlDataSource ID="sdsArchive" runat="server" ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>"
    SelectCommand="sp_tlsGetPlacementsForArchiving" SelectCommandType="StoredProcedure">
    <SelectParameters>
        <asp:ControlParameter ControlID="hfToggleState" DefaultValue="0" Name="Archived" PropertyName="Value" Type="Boolean" />
    </SelectParameters>
</asp:SqlDataSource>

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 10 Aug 2017, 02:32 PM

Hi David,

I have just answered your support ticket with this question and I am pasting my answer here as well.


I am assuming that the ClientSettings section that allows row selection is commented for the demo only and that it is present in your actual codebase. Nevertheless, I advise that you review the following demo and compare it with the problematic module: http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/selecting/row-selection/defaultcs.aspx.

What is also important is that the SelectedRows property should be used to get the selected rows.

The only other significant suggestion I can make is that you remove the .DataBind() calls for the grid. The .DataBind() method can be used only for a very simple case where you set the .DataSource of the grid before that. In such a scenario none of the complex features of the grid can be guaranteed to work.

When a declarative data source is used (like in your case) and you want the grid to fetch new data, you should use the .Rebind() method.

One other thing I can suggest is that you make sure the new Telerik version is used in the production environment.

Can you also confirm that there are no JavaScript errors when the issue manifests and that all network requests return successfully?

The last thing I can offer is that you test this outside of Evoq and once it works as expected on a "regular" web app, migrate the code to the DNN environment.

 

 

Regards,

 

Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or