Dear Support team
I wanted to create a RadGrid with self-referencing hierarchy so i did what ever was written in documentation. now the table shows up with collapse/expand column but it doesn't show chid hierarch.
Please help me to solve the issue.
I wanted to create a RadGrid with self-referencing hierarchy so i did what ever was written in documentation. now the table shows up with collapse/expand column but it doesn't show chid hierarch.
Please help me to solve the issue.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
telerik:RadStyleSheetManager
id
=
"RadStyleSheetManager1"
runat
=
"server"
/>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
EnableTheming
=
"True"
>
<
Scripts
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
>
</
asp:ScriptReference
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
>
</
asp:ScriptReference
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
>
</
asp:ScriptReference
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
>
</
asp:ScriptReference
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
>
</
asp:ScriptReference
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
>
</
asp:ScriptReference
>
</
Scripts
>
</
telerik:RadScriptManager
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [Parts] WHERE [PartID] = @PartID"
InsertCommand="INSERT INTO [Parts] ([Part Name], [ParentID]) VALUES (@Part_Name, @ParentID)"
SelectCommand="SELECT * FROM [Parts]"
UpdateCommand="UPDATE [Parts] SET [Part Name] = @Part_Name, [ParentID] = @ParentID WHERE [PartID] = @PartID">
<
DeleteParameters
>
<
asp:Parameter
Name
=
"PartID"
Type
=
"Int32"
/>
</
DeleteParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"Part_Name"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"ParentID"
Type
=
"Int32"
/>
</
InsertParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"Part_Name"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"ParentID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"PartID"
Type
=
"Int32"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AutoGenerateHierarchy
=
"True"
CellSpacing
=
"0"
DataSourceID
=
"SqlDataSource1"
GridLines
=
"None"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataKeyNames
=
"PartID,ParentID"
DataSourceID
=
"SqlDataSource1"
>
<
SelfHierarchySettings
KeyName
=
"PartID"
ParentKeyName
=
"`"
/>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"PartID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter PartID column"
HeaderText
=
"PartID"
ReadOnly
=
"True"
SortExpression
=
"PartID"
UniqueName
=
"PartID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Part Name"
FilterControlAltText
=
"Filter Part Name column"
HeaderText
=
"Part Name"
SortExpression
=
"Part Name"
UniqueName
=
"Part Name"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ParentID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter ParentID column"
HeaderText
=
"ParentID"
SortExpression
=
"ParentID"
UniqueName
=
"ParentID"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
></
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
></
FilterMenu
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Default"
></
HeaderContextMenu
>
</
telerik:RadGrid
>
<
script
type
=
"text/javascript"
>
//Put your Java Script code here.
</
script
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
</
telerik:RadAjaxManager
>
<
telerik:RadSkinManager
ID
=
"RadSkinManager1"
Runat
=
"server"
Skin
=
"WebBlue"
>
</
telerik:RadSkinManager
>
<
div
>
</
div
>
</
form
>
</
body
>
</
html
>