Radgrid Detail Table showing blank rows

8 posts, 0 answers
  1. amal raj t
    amal raj t avatar
    8 posts
    Member since:
    Mar 2015

    Posted 12 Oct 2015 Link to this post

    Dear Sir\Madam,

     

    Telerik radgrid gridbound column is showing all the selected columns,but the detail table showing few blank column and then the details.how to avoid that blank rows which are showing in detail table.Please help.

  2. amal raj t
    amal raj t avatar
    8 posts
    Member since:
    Mar 2015

    Posted 12 Oct 2015 in reply to amal raj t Link to this post

    Dear Sir\Madam,

    Telerik radgrid gridbound column is showing all the selected columns,but the detail table showing few blank rows and then the details.how to avoid that blank rows which are showing in detail table.Please help.
  3. amal raj t
    amal raj t avatar
    8 posts
    Member since:
    Mar 2015

    Posted 12 Oct 2015 Link to this post

    here am mentioning the code also; 

     

     

    <telerik:RadGrid ID="Radgrid1" runat="server" OnNeedDataSource="Radgrid1_NeedDataSource" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" CellSpacing="0" GridLines="None" Skin="WebBlue" AutoGenerateColumns="False" OnDetailTableDataBind="Radgrid1_DetailTableDataBind" >
                                                <ExportSettings ExportOnlyData="True">
                                                </ExportSettings>
                                                <ClientSettings EnableRowHoverStyle="true" >
                                                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                                                </ClientSettings>
    <MasterTableView AutoGenerateColumns="false" ShowHeadersWhenNoRecords="true" >
        <CommandItemSettings ExportToPdfText="Export to PDF" />
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridBoundColumn DataField="p_order" HeaderText="OrderNo" AllowFiltering="true" UniqueName="p_order" >

            </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="name" HeaderText="SupplierName" AllowFiltering="true" >

            </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="location" HeaderText="Location" AllowFiltering="true" >

            </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="entry_date" HeaderText="EntryDate" AllowFiltering="true" >

            </telerik:GridBoundColumn>

        </Columns>
        <DetailTables>
            <telerik:GridTableView  NoDetailRecordsText="" ShowHeadersWhenNoRecords="false" PageSize="20" >
                <CommandItemSettings ExportToPdfText="Export to PDF" />
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="order_no" HeaderText="OrderNo" AllowFiltering="true" UniqueName="p_order" >

            </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="barcode" HeaderText="Barcode" AllowFiltering="true" >

            </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="supp_ref" HeaderText="Supplier Reference" AllowFiltering="true" >

            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="prod_desc" HeaderText="Description" AllowFiltering="true" >

            </telerik:GridBoundColumn>
                             <telerik:GridBoundColumn DataField="brand" HeaderText="Brand" AllowFiltering="true" >

            </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="unit_cost" HeaderText="Unit Cost" AllowFiltering="true" >

            </telerik:GridBoundColumn>
                      <telerik:GridBoundColumn DataField="order_qtypc" HeaderText="Order Qty" AllowFiltering="true" >

            </telerik:GridBoundColumn>
                      <telerik:GridBoundColumn DataField="rec_qty" HeaderText="Received Qty" AllowFiltering="true" >

            </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </telerik:GridTableView>

        </DetailTables>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
        </MasterTableView>
                                                <FilterMenu EnableImageSprites="False">
                                                </FilterMenu>
                                                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Black">
                                                </HeaderContextMenu>
                                    </telerik:RadGrid>

  4. amal raj t
    amal raj t avatar
    8 posts
    Member since:
    Mar 2015

    Posted 13 Oct 2015 Link to this post

    Any help???
  5. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2357 posts

    Posted 15 Oct 2015 Link to this post

    Hello Amal,

    The behavior you describe seems rather strange. By default there should be no empty rows in the detail table. This could happen if there are some rows with empty values in the data source. Would you check the data source and ensure that there are no null or empty values there?


    Regards,
    Viktor Tachev
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  6. Kiran
    Kiran  avatar
    40 posts
    Member since:
    Oct 2018

    Posted 22 Apr Link to this post

    Hi,

    My detail table looks as attached. My radgrid does not show the detail table. Please help me. 

    Attached is my code.

    Thank you.

  7. Kiran
    Kiran  avatar
    40 posts
    Member since:
    Oct 2018

    Posted 22 Apr in reply to Kiran Link to this post

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
             <ContentTemplate>
               <telerik:RadGrid ID="RG_OPERATORS" AutoGenerateColumns="false" AllowSorting="TRUE" runat="server" Skin="Black" ShowFooter="True" OnNeedDataSource="RG_OPERATORS_NeedDataSource">
             <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Black">
                        </HeaderContextMenu>
            <MasterTableView DataKeyNames="SYS_ID,EMP_ID,SORT_PRIORITY, OPERATOR" EnableHierarchyExpandAll="true" Name="Master" AutoGenerateColumns="false" >
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column" />
                </EditFormSettings>
                <CommandItemSettings ExportToPdfText="Export to Pdf" />
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="False" />
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Created="True" />   
                <DetailTables>
                    <telerik:GridTableView DataKeyNames="OPERATOR" DataSourceID="SqlDataSource1" Width="100%" AllowSorting="true" EnableHierarchyExpandAll="true"  Name="DETAIL">
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="USER_ID" MasterKeyField="OPERATOR" ></telerik:GridRelationFields>
                        </ParentTableRelation>
                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"   /> 
                        <Columns>
                            <telerik:GridBoundColumn DataField="SYS_DT_TM" DefaultInsertValue="" HeaderText="TRANS DATE" ReadOnly="True" SortExpression="SYS_DT_TM" UniqueName="TRANS_SYS_DT_TM" Visible="True">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="TRANS_ID" DefaultInsertValue="" HeaderText="TRANS ID" ReadOnly="True" SortExpression="TRANS_ID" UniqueName="TRANS_ID" Visible="True">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="START_LOC" DefaultInsertValue="" HeaderText="START LOC" ReadOnly="True" SortExpression="START_LOC" UniqueName="START_LOC" Visible="True">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="END_LOC" DefaultInsertValue="" HeaderText="END LOC" ReadOnly="True" SortExpression="END_LOC" UniqueName="END_LOC" Visible="True">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="LOAD_ID" DefaultInsertValue="" HeaderText="LOAD ID" ReadOnly="True" SortExpression="LOAD_ID" UniqueName="LOAD_ID" Visible="True">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="USER_ID" DefaultInsertValue="" HeaderText="USER ID" ReadOnly="True" SortExpression="USER_ID" UniqueName="USER_ID" Visible="True">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
                <Columns>
      
                    <telerik:GridBoundColumn DataField="SYS_ID" DefaultInsertValue="" 
                        HeaderText="SYS_ID" ReadOnly="True" SortExpression="SYS_ID" UniqueName="SYS_ID" Visible="FALSE">
                    <ItemStyle Font-Size="12pt" ForeColor="White" HorizontalAlign="LEFT" />
                    </telerik:GridBoundColumn>  

                     <telerik:GridBoundColumn DataField="OPERATOR" DefaultInsertValue=""  Aggregate="Count"
                        HeaderText="OPERATOR" ReadOnly="False" SortExpression="OPERATOR" UniqueName="OPERATOR" Visible="TRUE">
                        <ItemStyle  ForeColor="White" Font-Size="10pt" HorizontalAlign="LEFT" />
                    </telerik:GridBoundColumn>  

                    <telerik:GridBoundColumn DataField="DOCK_STATUS" DefaultInsertValue="" 
                        HeaderText="DOCK_STATUS" ReadOnly="False" SortExpression="DOCK_STATUS" UniqueName="DOCK_STATUS" Visible="TRUE">
                     <ItemStyle  ForeColor="White" Font-Size="10pt" HorizontalAlign="LEFT" />
                    </telerik:GridBoundColumn>
                    
                           <telerik:GridBoundColumn DataField="IB_ROUTES"   DefaultInsertValue="" 
                        HeaderText="IB_ROUTES" ReadOnly="False" SortExpression="IB_ROUTES" 
                        UniqueName="IB_ROUTES" Visible="TRUE">
                        <ItemStyle  ForeColor="WHITE" Font-Size="10pt" HorizontalAlign="LEFT" />
                    </telerik:GridBoundColumn> 

                    <telerik:GridBoundColumn DataField="PUNCH_STATUS" DefaultInsertValue="" 
                        HeaderText="PUNCH_STATUS" ReadOnly="False" SortExpression="PUNCH_STATUS" UniqueName="PUNCH_STATUS" Visible="TRUE">
                       <ItemStyle  ForeColor="White" Font-Size="10pt" HorizontalAlign="LEFT" />
                    </telerik:GridBoundColumn>  

                    <telerik:GridBoundColumn DataField="PUNCH_TIME" DefaultInsertValue="" 
                        HeaderText="PUNCH_TIME" ReadOnly="False" SortExpression="PUNCH_TIME" UniqueName="PUNCH_TIME" Visible="TRUE">
                        <ItemStyle ForeColor="White" Font-Size="10pt" HorizontalAlign="LEFT" />
                    </telerik:GridBoundColumn>  
      

                </Columns> 
            </MasterTableView>
        </telerik:RadGrid>

             </ContentTemplate>
         </asp:UpdatePanel>


        <br />
        
        <asp:Label ID="Label11" runat="server" Visible="false" Text='<%# Eval("OPERATOR")%>'></asp:Label>
           <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:FCSConnectionString %>" SelectCommand="SELECT TOP (20) SYS_DT_TM, TRANS_ID, START_LOC, END_LOC, LOAD_ID, USER_ID FROM TRANS WHERE USER_ID = @OPERATOR order by SYS_DT_TM DESC">
                <SelectParameters>
                     <asp:ControlParameter Name ="OPERATOR" ControlID="Label11"  PropertyName ="Text"/>
                </SelectParameters>
                </asp:SqlDataSource>
  8. Eyup
    Admin
    Eyup avatar
    3819 posts

    Posted 25 Apr Link to this post

    Hi Kiran,

    This is probably related to the binding of the grid. I'm afraid using programmatic NeedDataSource and declarative DataSourceID is not supported for the same grid hierarchy. You should use either only the programmatic (with DetailTableDataBind event handler) or the declarative approach:
    https://www.telerik.com/support/kb/aspnet-ajax/grid/details/how-to-bind-radgrid-properly-on-server-side

    If you decide to use the DataSourceID approach, pay attention to the SelectParameters of the SqlDataSource controls. You will notice in the following live sample that they are of type SessionParameter and with different names, i.e. CustomerID and OrderID:
    https://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/declarative-relations/defaultcs.aspx

    Also, you can temporarily disable AJAX while developing and troubleshooting your application:
    https://www.telerik.com/support/kb/aspnet-ajax/ajaxmanager/details/get-more-descriptive-errors-by-disabling-ajax

    I hope this will prove helpful.


    Regards,
    Eyup
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top