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

Problem with DetailTables in RadGrid

5 Answers 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Prakash
Top achievements
Rank 1
Prakash asked on 07 Jan 2010, 05:44 AM
hi,

i have used two detail tables in my radgrid.
The problem i am facing is the values with in the two detail tables are displaying in the same row.
I want that values to be displayed in two rows.below is the code in the aspx page

<

 

telerik:RadGrid ID="rgOrderItem" DataSourceID="dsOrderItem" AutoGenerateColumns="False"

 

 

GridLines="None" AllowPaging="True" PageSize="30" runat="server" CellPadding="0"

 

 

Skin="" EnableEmbeddedSkins="False" ImagesPath="~\Images\Grid\" CssClass="grid"

 

 

CellSpacing="0" OnItemDataBound="rgOrderItem_ItemDataBound" Height="305px" Width="676px"

 

 

OnPreRender="rgOrderItem_PreRender" OnItemCommand="rgOrderItem_ItemCommand" OnDetailTableDataBind="rgOrderItem_DetailTableDataBind">

 

 

<PagerStyle Position="Bottom" Mode="NextPrevAndNumeric" PagerTextFormat="{4} Showing {2}-{3} of {5}"

 

 

CssClass="gridpager" />

 

 

<MasterTableView AllowPaging="true" CommandItemDisplay="Top" ExpandCollapseColumn-Display="false"

 

 

HierarchyDefaultExpanded="true" HierarchyLoadMode="ServerBind" NoDetailRecordsText="No records found">

 

 

<ItemStyle CssClass="gridstyle"></ItemStyle>

 

 

<HeaderStyle CssClass="gridheaderstyle"></HeaderStyle>

 

 

<CommandItemTemplate>

 

 

<div style="padding: 3px 5px; background-color: #efeded;">

 

 

<asp:CheckBox ID="CheckBox1" runat="server" Text="SELECT ALL" onclick="SelectAll(this);" />

 

 

</div>

 

 

</CommandItemTemplate>

 

 

<DetailTables>

 

 

<telerik:GridTableView HorizontalAlign="Right" HierarchyDefaultExpanded="true" ShowHeader="false"

 

 

DataKeyNames="SkuId,WarehouseId" Name="Notes">

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="ItemNotes" ItemStyle-Width="400px">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:CheckBox ID="chkNotesSelect" runat="server" />

 

 

<asp:Label ID="lblSkuId" runat="server" Text='<%# Bind("SkuId") %>' Visible="false"></asp:Label>

 

 

<asp:Label ID="lblWarehouseId" runat="server" Text='<%# Bind("WarehouseId") %>' Visible="false"></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

</telerik:GridTableView>

 

 

</DetailTables>

 

 

<DetailTables>

 

 

<telerik:GridTableView HorizontalAlign="Right" HierarchyDefaultExpanded="true" ShowHeader="false"

 

 

Name="DeliveryNotes" >

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="DeliveryDaysString" ItemStyle-Width="400px">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:CheckBox ID="chkDNotesSelect" runat="server" />

 

 

<asp:Label ID="lblSkuId" runat="server" Text='<%# Bind("SkuId") %>' Visible="false"></asp:Label>

 

 

<asp:Label ID="lblWarehouseId" runat="server" Text='<%# Bind("WarehouseId") %>' Visible="false"></asp:Label>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

</telerik:GridTableView>

 

 

</DetailTables>

 

 

<Columns>

 

 

<telerik:GridTemplateColumn HeaderText="TOOLS">

 

 

<ItemTemplate>

 

 

<asp:ImageButton ID="imgDelete" runat="server" ImageUrl="~/Images/icons/delete.png"

 

 

CommandName="cmdDelete" OnClientClick="return confirm('Are you sure want to delete this item?');"

 

 

Width="16px" Height="16px" />

 

 

<asp:ImageButton ID="imgAdd" runat="server" ImageUrl="~/Images/icons/add_16.gif"

 

 

CommandName="cmdAdd" />

 

 

<asp:ImageButton ID="imgNotes" runat="server" ImageUrl="~/Images/icons/notes.gif"

 

 

CommandName="cmdShowNotes" Width="16px" Height="16px" />

 

 

<asp:ImageButton ID="imgDNotes" runat="server" ImageUrl="~/Images/icons/DeliveryNotes.png"

 

 

CommandName="cmdShowDeliveryNotes" Width="20px" Height="20px" />

 

 

</ItemTemplate>

 

 

<HeaderStyle Width="120px" />

 

 

<ItemStyle Width="120px" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="QTY">

 

 

<ItemTemplate>

 

 

<telerik:RadNumericTextBox ID="txtQty" runat="server" MaxLength="4" MaxValue="9999"

 

 

MinValue="0" Text='<%#Bind("Quantity") %>' Width="40px">

 

 

<IncrementSettings InterceptArrowKeys="False" InterceptMouseWheel="False" />

 

 

<NumberFormat AllowRounding="False" DecimalDigits="1" DecimalSeparator="," KeepNotRoundedValue="False" />

 

 

</telerik:RadNumericTextBox>

 

 

</ItemTemplate>

 

 

<HeaderStyle Width="50px" />

 

 

<ItemStyle Width="50px" />

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn HeaderText="QA" DataField="QuantityAvailable" Visible="false">

 

 

<HeaderStyle Width="40px"></HeaderStyle>

 

 

<ItemStyle Width="40px"></ItemStyle>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn HeaderText="ORD" Visible="false">

 

 

<ItemTemplate>

 

 

<asp:LinkButton ID="lnkQuantityPending" runat="server" Text='<%# Bind("QuantityPending") %>'

 

 

CommandName="cmdShowStockDetails"></asp:LinkButton>

 

 

</ItemTemplate>

 

 

<HeaderStyle Width="40px"></HeaderStyle>

 

 

<ItemStyle Width="40px"></ItemStyle>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn HeaderText="PN" DataField="PartNumber" Visible="false">

 

 

<HeaderStyle Width="50px"></HeaderStyle>

 

 

<ItemStyle Width="50px"></ItemStyle>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn HeaderText="WHSE" DataField="WarehouseId" Visible="false">

 

 

<HeaderStyle Width="50px"></HeaderStyle>

 

 

<ItemStyle Width="50px"></ItemStyle>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn HeaderText="WHSE">

 

 

<ItemTemplate>

 

 

<asp:LinkButton ID="lnkWarehouseId" runat="server" Text='<%# Bind("WarehouseId") %>'

 

 

CommandName="cmdShowPartsInfo"></asp:LinkButton>

 

 

</ItemTemplate>

 

 

<HeaderStyle Width="60px"></HeaderStyle>

 

 

<ItemStyle Width="60px"></ItemStyle>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="PN">

 

 

<ItemTemplate>

 

 

<asp:LinkButton ID="lnkPartNumber" runat="server" Text='<%# Bind("PartNumber") %>'

 

 

CommandName="cmdShowPartsDetails"></asp:LinkButton>

 

 

</ItemTemplate>

 

 

<HeaderStyle Width="60px"></HeaderStyle>

 

 

<ItemStyle Width="60px"></ItemStyle>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn HeaderText="DESC" DataField="Description">

 

 

<HeaderStyle Width="120px"></HeaderStyle>

 

 

<ItemStyle Width="120px"></ItemStyle>

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings>

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="true" ScrollHeight="133" />

 

 

</ClientSettings>

 

 

<SortingSettings SortToolTip="" />

 

 

<CommandItemStyle BorderColor="White" HorizontalAlign="Right" />

 

 

</telerik:RadGrid>

Any help on this will be greatly appreciated.

 

5 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 07 Jan 2010, 02:24 PM
Hello Prakash,

Please, have in mind that you need to define the ParentTableRelations/DataKeyNames for the MasterTableView/GridTableViews according to the database relations conventions.

For more information, please refer to this help article and let  me know if it helps:
Hierarchical data-binding using declarative relations

All the best,

Pavlina
the Telerik team

 


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Prakash
Top achievements
Rank 1
answered on 11 Jan 2010, 05:30 AM
hi Pavlina,

thanks for your reply.

my problem is i have two detailtable section with in my mastertableview. i have to display the two detailtables in a seperate row in runtime.currently it displays in a same row. 

waiting for your reply.


0
Pavlina
Telerik team
answered on 11 Jan 2010, 04:20 PM
Hi Prakash,

Attached to this message is a simple working project with three level hierarchy. Please check it out and let me know what is the difference in your scenario.

All the best,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Prakash
Top achievements
Rank 1
answered on 12 Jan 2010, 05:25 AM

hi Pavlina,

for ex. consider an object which contains 7 fields, let us name the object as orderItems and the fields as productname, describtion, quantity, costprice,discount, notes and delivery notes.

each row in the object orderitems should be displayed in the radgrid as below

productname    describtion    quantity    costprice    discount
                         notes                        
                         delivery notes
 
to implement this i have created two detail tables under my mastertableview for notes & delivery notes. now the row in the grid is displaying as below

 

productname    describtion    quantity    costprice    discount
                         notes                 delivery notes
 
can you provide me a suggestion on how to display the notes & delivery notes in a seperate line.      
                        

 

 

0
Pavlina
Telerik team
answered on 12 Jan 2010, 02:51 PM
Hello Prakash,

In this case we will need more details about your setup. Can you please open a new support ticket and send us a small runnable project where the problem can be reproduced? Once we have a better view over your scenario, we will do our best to provide a solution.

Greetings,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Prakash
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Prakash
Top achievements
Rank 1
Share this question
or