RadGrid - Columns Missing After Upgrade

6 posts, 0 answers
  1. Linda
    Linda avatar
    7 posts
    Member since:
    Jul 2014

    Posted 18 Oct 2017 Link to this post

    I'm in the process of updating to use the newest version of UI for ASP.NET AJAX.  We were using Q2 2014.  

    One of our pages had a RadGrid with 12 visible columns.  After upgrading to 2017_9_913 3 of the columns no longer display.  The only update we made to the .aspx file was to reference the new Telerik DLL.  

    See attached images showing screen shot and code.

  2. Eyup
    Admin
    Eyup avatar
    3818 posts

    Posted 23 Oct 2017 Link to this post

    Hi Linda,

    Please make sure you are not using DataBind() method to bind the grid. Performing complex grid operations such as Inserting, Deleting, Updating, Hierarchy relations, Grouping, Exporting, Paging, Sorting, Filtering, etc. require accommodating appropriate database operations.  Therefore, we suggest you to avoid Simple Databinding and strongly recommend the use of more advanced databinding methods, which automatically handle the aforementioned functions:

    Declarative DataSource (DataSourceID property)
    Programmatic Data Binding (NeedDataSource event, + DetailTableDataBind for hierarchy). You should set the DataSource property ONLY within these event handlers.


    Looking forward to your reply.


    Regards,
    Eyup
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Linda
    Linda avatar
    7 posts
    Member since:
    Jul 2014

    Posted 23 Oct 2017 Link to this post

    I compared the rendering through browser debugger of both the old and the new DLL.  See attached file.  They do not render the same.

  4. Linda
    Linda avatar
    7 posts
    Member since:
    Jul 2014

    Posted 24 Oct 2017 in reply to Linda Link to this post

    After removing the 3 GridBoundColumns having Display = False the columns displayed.

    Now I just need to figure out how to have these 3 hidden data elements available to the code behind. 

  5. Linda
    Linda avatar
    7 posts
    Member since:
    Jul 2014

    Posted 24 Oct 2017 in reply to Linda Link to this post

    I got this to work by placing the 3 GridBoundColumn elements having Display=False at the end of the <Columns> element of the RadGrid.  If I placed these 3 Display=False elements at the beginning the first 3 columns would not display.  If I placed them between other columns the subsequent columns would not display.

     

    <telerik:RadGrid ID="PartAvailabilityGrid" runat="server"
        OnItemDataBound="PartAvailabilityGrid_ItemDataBound"
        OnItemCommand="PartAvailabilityGrid_ItemCommand"
        Width="995px">
        <MasterTableView
            AutoGenerateColumns="False"
            DataKeyNames="Id"
            ShowHeadersWhenNoRecords="True"
            NoMasterRecordsText="Please add a part."
            Width="995px">
            <Columns>                                               
                <telerik:GridTemplateColumn
                    HeaderText="Part Number"
                    HeaderStyle-Width="100px"
                    ItemStyle-Width="100px">
                    <ItemTemplate>
                        <asp:Label ID="PartNumber" runat="server"></asp:Label>
                        <telerik:RadToolTip ID="PartNumberToolTip" runat="server"
                            TargetControlID="PartNumber"
                            RelativeTo="Element"
                            Position="BottomCenter"
                            RenderInPageRoot="true"
                            BackColor="White"
                            BorderColor="Black"
                            HideEvent="LeaveToolTip"
                            Text="" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
     
                <telerik:GridBoundColumn
                    DataField="ServiceObjectSerialModel"
                    HeaderText="Serial: Model"
                    ReadOnly="True"
                    HeaderStyle-Width="100px"
                    ItemStyle-Width="100px" />
                <telerik:GridBoundColumn
                    DataField="UnitPrice"
                    HeaderText="List Price"
                    ReadOnly="True"
                    DataFormatString="{0:C}"
                    HeaderStyle-Width="80px"
                    ItemStyle-Width="80px" />
                <telerik:GridBoundColumn
                    DataField="MinOrderQuantity"
                    HeaderText="Min Qty"
                    DataFormatString="{0:F0}"
                    HeaderStyle-Width="55px"
                    ItemStyle-Width="55px" />
                <telerik:GridTemplateColumn
                    HeaderText="Qty To Order"
                    UniqueName="QtyToOrder"
                    HeaderStyle-Width="65px"
                    ItemStyle-Width="65px">
                    <ItemTemplate>
                        <telerik:RadNumericTextBox
                            ID="QtyToOrder"
                            runat="server"
                            Enabled="False"
                            AutoPostBack="True"
                            OnTextChanged="QtyToOrder_OnTextChanged"
                            MaxLength="3"
                            NumberFormat-DecimalDigits="0"
                            MinValue="0"
                            MaxValue="999"
                            Width="60px">
                        </telerik:RadNumericTextBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                                                                                                                 
                <telerik:GridTemplateColumn
                    HeaderText="Replaced By"
                    HeaderStyle-Width="100px"
                    ItemStyle-Width="100px">
                    <ItemTemplate>
                        <asp:Label ID="ReplacedBy" runat="server"></asp:Label>
                        <telerik:RadToolTip ID="ReplacedByToolTip" runat="server"
                            TargetControlID="ReplacedBy"
                            RelativeTo="Element"
                            Position="BottomCenter"
                            RenderInPageRoot="true"
                            BackColor="White"
                            BorderColor="Black"
                            HideEvent="LeaveToolTip"
                            Text="Part is not superceded" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn
                    HeaderText="Truck Qty"
                    HeaderStyle-Width="55px"
                    ItemStyle-Width="55px">
                    <ItemTemplate>
                        <asp:Label ID="TruckQty" runat="server"></asp:Label>
                        <telerik:RadToolTip ID="TruckQtyToolTip" runat="server"
                            TargetControlID="TruckQty"
                            RelativeTo="Element"
                            Position="BottomCenter"
                            RenderInPageRoot="true"
                            BackColor="White"
                            BorderColor="Black"
                            HideEvent="LeaveToolTip"
                            Text="" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn
                    DataField="BranchQuantity"
                    HeaderText="Branch Qty"
                    DataFormatString="{0:F0}"
                    HeaderStyle-Width="55px"
                    ItemStyle-Width="55px" />
                <telerik:GridBoundColumn
                    DataField="PiquaQuantity"
                    HeaderText="Piqua Qty"
                    DataFormatString="{0:F0}"
                    HeaderStyle-Width="55px"
                    ItemStyle-Width="55px" />
                <telerik:GridTemplateColumn
                    HeaderText="Source"
                    UniqueName="SourceWhse">
                    <ItemTemplate>
                        <telerik:RadDropDownList runat="server"
                            ID="SourceWhse"
                            Enabled="False"
                            AutoPostBack="True"
                            OnSelectedIndexChanged="SourceWhse_SelectedIndexChanged">
                        </telerik:RadDropDownList>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn
                    HeaderText="Delivery Method"
                    UniqueName="DeliveryMethod">
                    <ItemTemplate>
                        <telerik:RadDropDownList runat="server"
                            ID="DeliveryMethod"
                            Enabled="False">
                        </telerik:RadDropDownList>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridButtonColumn
                    ConfirmText="Remove this part?"
                    ConfirmDialogType="RadWindow"
                    ConfirmTitle="Remove"
                    HeaderText="Remove"
                    HeaderStyle-Width="50px"
                    ItemStyle-Width="50px"
                    ButtonType="ImageButton"
                    ImageUrl="~/_imgs/16_l_remove.gif"
                    CommandName="Delete"
                    Text="Remove"
                    UniqueName="RemoveColumn">
                </telerik:GridButtonColumn>
     
                <telerik:GridBoundColumn
                    DataField="ServiceObjectServiceOrderResourceId"
                    Display="False" />
     
                <telerik:GridBoundColumn
                    DataField="UseAltItemId"
                    Display="False" />
     
                <telerik:GridBoundColumn
                    DataField="ItemStatusID"
                    Display="false" />
     
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
  6. Eyup
    Admin
    Eyup avatar
    3818 posts

    Posted 26 Oct 2017 Link to this post

    Hello Linda,

    Another possible approach to achieve this requirement would be to use the DataKeyNames collection provided by the MasterTableView tag:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-raw-field-data-and-key-values

    You can find further information about the new Lightweight RenderMode here:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/mobile-support/render-modes

    Regards,
    Eyup
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top