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

Radgrid Detail Table showing blank rows

7 Answers 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
amal raj t
Top achievements
Rank 1
amal raj t asked on 12 Oct 2015, 11:56 AM

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.

7 Answers, 1 is accepted

Sort by
0
amal raj t
Top achievements
Rank 1
answered on 12 Oct 2015, 12:01 PM
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.
0
amal raj t
Top achievements
Rank 1
answered on 12 Oct 2015, 12:36 PM

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>

0
amal raj t
Top achievements
Rank 1
answered on 13 Oct 2015, 07:37 AM
Any help???
0
Viktor Tachev
Telerik team
answered on 15 Oct 2015, 08:52 AM
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
0
Kiran
Top achievements
Rank 2
answered on 22 Apr 2019, 07:34 PM

Hi,

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

Attached is my code.

Thank you.

0
Kiran
Top achievements
Rank 2
answered on 22 Apr 2019, 07:35 PM
<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>
0
Eyup
Telerik team
answered on 25 Apr 2019, 04:29 PM
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.
Tags
Grid
Asked by
amal raj t
Top achievements
Rank 1
Answers by
amal raj t
Top achievements
Rank 1
Viktor Tachev
Telerik team
Kiran
Top achievements
Rank 2
Eyup
Telerik team
Share this question
or