or
8481.10.00,8481.20.00 etc .I got this from the storedprocedures.I am binding this storedprocedures value to the Treelist first.
Also I should show the 'Schedule 5 -Us Orginating Goods','Schedule 6 -Thai Orginating Goods' when expanding the code 8481.How is it possible?
8481,8481.10.00,8481.20.00 etc will get from the StoredProcedure.
'Schedule 5 -Us Orginating Goods' will get from the another storedProcedure.So how to bind 'Schedule 5 -Us Orginating Goods','Schedule 6 -Thai Orginating Goods'under the same tree node '8481'.
Test.aspx
<
telerik:RadAjaxPanel
ID
=
"ClientViewAjaxPanel"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
div
class
=
"clientviewmaindiv"
>
<
center
>
<
asp:UpdatePanel
runat
=
"server"
ID
=
"UpdatePanel1"
ChildrenAsTriggers
=
"false"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<
telerik:RadDockLayout
runat
=
"server"
ID
=
"RadDockLayout1"
EnableEmbeddedSkins
=
"true"
Skin
=
"Office2007"
Visible
=
"true"
>
<
div
id
=
"clientviewlayout"
style
=
"width:99%"
>
<
table
cellpadding
=
"0"
cellspacing
=
"0"
class
=
"tblClientViewLayout"
style
=
"width:99%"
>
<
tr
>
<
td
class
=
"tdClientViewleftcol"
>
<
telerik:RadDockZone
MinHeight
=
"200px"
BorderStyle
=
"None"
BorderWidth
=
"0"
runat
=
"server"
ID
=
"RadDockZoneV1"
Orientation
=
"Vertical"
></
telerik:RadDockZone
>
</
td
>
<
td
class
=
"tdClientViewrightcol"
>
<
telerik:RadDockZone
MinHeight
=
"200px"
BorderStyle
=
"None"
BorderWidth
=
"0"
runat
=
"server"
ID
=
"RadDockZoneV3"
Orientation
=
"Vertical"
></
telerik:RadDockZone
>
</
td
>
</
tr
>
</
table
>
</
div
>
</
telerik:RadDockLayout
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
</
center
>
</
div
>
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
ShowContentDuringLoad
=
"false"
VisibleStatusbar
=
"false"
ReloadOnShow
=
"true"
Modal
=
"true"
Skin
=
"GIRadWindow"
EnableEmbeddedBaseStylesheet
=
"false"
EnableEmbeddedSkins
=
"false"
>
<
Windows
>
<
telerik:RadWindow
runat
=
"server"
ID
=
"NewsWindow"
Width
=
"600"
Height
=
"450"
BackColor
=
"White"
Behaviors
=
"Close,Move,Resize"
></
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
</
telerik:RadAjaxPanel
>
protected
override
void
OnInit(EventArgs e)
{
base
.OnInit(e);
UserContext = (Context)Session[
""
];
_ctx =
new
GBMDataContext();
int
userChartsCount = 0;
DataSet userCharts =
new
DataSet(
"userCharts"
);
using
(SqlConnection connection =
new
SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings[
""
].ConnectionString))
{
SqlCommand command =
new
SqlCommand(
""
, connection);
command.CommandTimeout = 3000;
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(
new
SqlParameter(
""
, ));
command.Parameters.Add(
new
SqlParameter(
""
, ));
command.Parameters.Add(
new
SqlParameter(
""
, ));
SqlDataAdapter da =
new
SqlDataAdapter();
da.SelectCommand = command;
try
{
command.Connection.Open();
da.FillSchema(userCharts, SchemaType.Source);
da.Fill(userCharts);
}
catch
{
userChartsCount = 0;
}
finally
{
command.Connection.Close();
}
}
userChartsCount = userCharts.Tables[0].Rows.Count;
if
(userChartsCount > 0)
{
RadDock dockWidget;
Control ctrlWidget;
double
rowCount = 1;
int
widgetCount = 0;
if
(userChartsCount > 1)
{
rowCount = Math.Ceiling(Convert.ToDouble(userChartsCount) / 2);
}
for
(
int
x = 0; x < rowCount; x++)
{
for
(
int
y = 0; y <= 1; y++)
{
if
(widgetCount < userChartsCount)
{
dockWidget =
new
RadDock();
dockWidget.ID = (
string
)(userCharts.Tables[0].Rows[widgetCount][
"DockId"
]) + widgetCount.ToString();
dockWidget.Tag = (
string
)(userCharts.Tables[0].Rows[widgetCount][
"DockId"
]) + widgetCount.ToString();
dockWidget.DockMode = DockMode.Docked;
dockWidget.Skin =
"Office2007"
;
dockWidget.Width = Unit.Pixel((
int
)userCharts.Tables[0].Rows[widgetCount][
"DockWidth"
]);
dockWidget.DockHandle = DockHandle.TitleBar;
dockWidget.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.All;
dockWidget.Title = _ctx.fn_GetTextLabelTranslationByLabelName((
string
)userCharts.Tables[0].Rows[widgetCount][
"Name"
], UserContext.Language_RecordID);
ctrlWidget = LoadControl((
string
)userCharts.Tables[0].Rows[widgetCount][
"ControlURL"
]);
ctrlWidget.ID = (
string
)userCharts.Tables[0].Rows[widgetCount][
"ControlId"
];
RadDockLayout1.Controls.Add(dockWidget);
if
(userCharts.Tables[0].Rows[widgetCount][
"Zone"
] ==
null
)
{
if
(y == 0)
{
RadDockZoneV1.Controls.Add(dockWidget);
}
else
{
RadDockZoneV3.Controls.Add(dockWidget);
}
}
else
{
if
((
int
)userCharts.Tables[0].Rows[widgetCount][
"Zone"
] == 1)
{
RadDockZoneV1.Controls.Add(dockWidget);
}
else
if
((
int
)userCharts.Tables[0].Rows[widgetCount][
"Zone"
] == 2)
{
RadDockZoneV3.Controls.Add(dockWidget);
}
}
dockWidget.ContentContainer.Controls.Add(ctrlWidget);
}
widgetCount++;
}
}
}
}
<
telerik:RadAjaxPanel
ID
=
"ClientViewControlRadAjaxPanel"
runat
=
"server"
>
<
asp:Timer
ID
=
"ClientViewControlTimer"
Interval
=
"1"
runat
=
"server"
></
asp:Timer
>
<
asp:MultiView
ID
=
"ClientViewControlMultiView"
runat
=
"server"
ActiveViewIndex
=
"0"
>
<
asp:View
ID
=
"ClientViewControlLoadingView"
runat
=
"server"
>
<
div
id
=
"loadingdiv"
style
=
"height:75px; margin-top:0px; margin-bottom:0px; padding:0px; background-repeat:no-repeat; background-position:center; background-image:url('../Skins/GIRadWindow/GIRadWindow/Window/loading.gif');"
></
div
>
</
asp:View
>
<
asp:View
ID
=
"ClientViewControlView"
runat
=
"server"
>
<
asp:LinqDataSource
ID
=
"dsNews"
runat
=
"server"
OnSelecting
=
"dsNews_Selecting"
/>
<
asp:ListView
ID
=
"lvNews"
runat
=
"server"
DataKeyNames
=
"RecordID"
DataSourceID
=
"dsNews"
>
<
LayoutTemplate
>
<
div
id
=
"itemPlaceholderContainer"
runat
=
"server"
>
<
div
id
=
"itemplaceholder"
runat
=
"server"
></
div
>
</
div
>
<
div
style
=
"clear: left; text-align:center; vertical-align: middle; float:none; width:100%;"
>
<
asp:DataPager
ID
=
"pageTopics"
runat
=
"server"
PageSize
=
"3"
PagedControlID
=
"lvNews"
>
<
Fields
>
<
asp:NextPreviousPagerField
ButtonCssClass
=
"pagerbuttons"
ShowFirstPageButton
=
"true"
ButtonType
=
"Image"
ShowPreviousPageButton
=
"false"
ShowNextPageButton
=
"false"
FirstPageImageUrl
=
"../Images/PagingFirst.gif"
/>
<
asp:NextPreviousPagerField
ButtonCssClass
=
"pagerbuttons"
ShowFirstPageButton
=
"false"
ButtonType
=
"Image"
ShowPreviousPageButton
=
"true"
ShowNextPageButton
=
"false"
PreviousPageImageUrl
=
"../Images/PagingPrev.gif"
/>
<
asp:NumericPagerField
CurrentPageLabelCssClass
=
"pagerbuttons"
NumericButtonCssClass
=
"pagerbuttons"
ButtonCount
=
"9"
/>
<
asp:NextPreviousPagerField
ButtonCssClass
=
"pagerbuttons"
ShowFirstPageButton
=
"false"
ButtonType
=
"Image"
ShowPreviousPageButton
=
"false"
ShowNextPageButton
=
"true"
ShowLastPageButton
=
"false"
NextPageImageUrl
=
"../Images/PagingNext.gif"
/>
<
asp:NextPreviousPagerField
ButtonCssClass
=
"pagerbuttons"
ShowFirstPageButton
=
"false"
ButtonType
=
"Image"
ShowPreviousPageButton
=
"false"
ShowNextPageButton
=
"false"
ShowLastPageButton
=
"true"
LastPageImageUrl
=
"../Images/PagingLast.gif"
/>
</
Fields
>
</
asp:DataPager
>
</
div
>
</
LayoutTemplate
>
<
ItemTemplate
>
<
div
>
<
ul
id
=
"newsul"
>
<
li
id
=
"newstitle"
><
asp:HyperLink
runat
=
"server"
ID
=
"titleNav"
NavigateUrl='<%# Eval("OpenNewsURL")%>'><%# Eval("Name")%></
asp:HyperLink
>
<
li
id
=
"newspub"
>
<
div
style
=
"width:100%;margin:0;padding:0;"
>
<
div
style
=
"text-align:left;float:left;"
>Published: <%# Eval("PublishDate")%></
div
>
<
div
style
=
"text-align:right;"
><
asp:HyperLink
runat
=
"server"
ID
=
"newNav"
ImageUrl
=
"../Images/clientview/Globe.gif"
NavigateUrl='<%# Eval("URL")%>' Target="_blank" /></
div
>
</
div
>
</
li
>
<
li
id
=
"newsdesc"
><%# Eval("Description").ToString()%></
li
>
</
ul
>
</
div
>
</
ItemTemplate
>
<
EmptyDataTemplate
><
div
id
=
"emptylist"
class
=
"emptylist"
>No news found</
div
></
EmptyDataTemplate
>
</
asp:ListView
>
</
asp:View
>
</
asp:MultiView
>
</
telerik:RadAjaxPanel
>
protected
override
void
OnLoad(EventArgs e)
{
base
.OnLoad(e);
if
(IsPostBack)
{
ClientViewControlTimer.Enabled =
false
;
if
(ClientViewControlMultiView.ActiveViewIndex == 0)
{
ClientViewControlMultiView.SetActiveView(ClientViewControlView);
}
}
}
protected
void
dsNews_Selecting(
object
sender, LinqDataSourceSelectEventArgs args)
{
args.Result = LoadData();
}
private
IList LoadData()
{
UserContext = (Context)Session[
""
];
_userCulture = System.Globalization.CultureInfo.GetCultureInfo(UserContext.Locale);
GBMDataContext ctx =
new
GBMDataContext();
var NewsProfiles = from tmp2
in
ctx.ApplicationProfileNewsRoomIntersects
where tmp2.ApplicationProfile_RecordID == UserContext.ApplicationProfile_RecordID
select tmp2.NewsRoom_RecordID;
var q = from tmp
in
ctx.NewsRooms
where
(!(tmp.RecordExpiration.HasValue) || tmp.RecordExpiration.Value >= DateTime.UtcNow)
&& tmp.LookupNewsCategory.Name !=
"Health and Benefits"
&& NewsProfiles.Contains(tmp.RecordID) && (tmp.Tenant_RecordID == UserContext.TenantId || tmp.Tenant_RecordID ==
null
)
orderby tmp.PublishDate descending
select
new
{
tmp.RecordID,
Name = tmp.Name.Substring(0, 75),
PublishDate = tmp.PublishDate.ToString(
"d"
, _userCulture),
Description = tmp.Description !=
null
? tmp.Description.Substring(0, 175) :
""
,
URL = tmp.URL,
OpenNewsURL =
"javascript:openNews('"
+ tmp.RecordID +
"');"
};
return
q.ToList();
}
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
language
=
"javascript"
type
=
"text/javascript"
>
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
alert(oWindow);
return oWindow;
}
function windowClose() {
GetRadWindow().close();
}
</
script
>
</
telerik:RadCodeBlock
>
<
script
type
=
"text/javascript"
>
function onRequestStart(sender, args) {
//alert(args.get_eventTarget().toString())
if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0) {
args.set_enableAjax(false);
}
else {
args.set_enableAjax(true);
}
}
</
script
>
<
br
/>
<
br
/>
<
asp:Table
runat
=
"server"
ID
=
"table1"
Width
=
"873px"
>
<
asp:TableHeaderRow
>
<
asp:TableHeaderCell
ColumnSpan
=
"2"
>Accounts By Risk Level</
asp:TableHeaderCell
>
</
asp:TableHeaderRow
>
<
asp:TableRow
>
<
asp:TableCell
ColumnSpan
=
"2"
>
To narrow down the report by risk level, select an option in the box below. To see more than one risk level, press and hold the "Ctrl" key on your keyboard while selecting the levels you wish to view. To see all levels, click the "View All Risk Levels" button.
</
asp:TableCell
>
</
asp:TableRow
>
<
asp:TableRow
>
<
asp:TableCell
Width
=
"20%"
>
<
telerik:RadListBox
ID
=
"RadListBox1"
runat
=
"server"
Skin
=
"WebBlue"
Width
=
"100px"
SelectionMode
=
"Multiple"
AutoPostBack
=
"true"
>
<
Items
>
<
telerik:RadListBoxItem
runat
=
"server"
Text
=
"Low"
Value
=
"Low"
/>
<
telerik:RadListBoxItem
runat
=
"server"
Text
=
"Medium"
Value
=
"Medium"
/>
<
telerik:RadListBoxItem
runat
=
"server"
Text
=
"High"
Value
=
"High"
/>
<
telerik:RadListBoxItem
runat
=
"server"
Text
=
"Reimbursement"
Value
=
"Reimbursement"
/>
<
telerik:RadListBoxItem
runat
=
"server"
Text
=
"Unassigned"
Value
=
"Unassigned"
/>
</
Items
>
</
telerik:RadListBox
>
<
br
/>
<
telerik:RadButton
ID
=
"RadButton1"
runat
=
"server"
Text
=
"View All Risk Levels"
Skin
=
"WebBlue"
>
</
telerik:RadButton
>
</
asp:TableCell
>
</
asp:TableRow
>
<
asp:TableRow
>
<
asp:TableCell
ColumnSpan
=
"2"
>
<
br
/><
br
/>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
GridLines
=
"None"
Skin
=
"WebBlue"
width
=
"100%"
CellSpacing
=
"0"
PageSize
=
"10"
>
<
ExportSettings
Excel-Format
=
"ExcelML"
ExportOnlyData
=
"True"
FileName
=
"AccountsByRiskLevel"
></
ExportSettings
>
<
MasterTableView
CommandItemDisplay
=
"Top"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
ShowAddNewRecordButton
=
"False"
ShowRefreshButton
=
"False"
ShowExportToExcelButton
=
"True"
></
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
=
"name"
FilterControlAltText
=
"Filter Muni_Name column"
HeaderText
=
"Name"
UniqueName
=
"Name"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Account"
FilterControlAltText
=
"Filter Account column"
HeaderText
=
"CID"
UniqueName
=
"Account"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Accountant"
FilterControlAltText
=
"Filter Accountant column"
HeaderText
=
"FEAD Accountant"
UniqueName
=
"Accountant"
>
</
telerik:GridBoundColumn
>
<
telerik:GridDateTimeColumn
DataField
=
"end_date"
FilterControlAltText
=
"Filter end_date column"
HeaderText
=
"End Date"
UniqueName
=
"end_date"
DataFormatString
=
"{0:d}"
PickerType
=
"DatePicker"
FilterControlWidth
=
"125px"
>
<
HeaderStyle
Width
=
"160px"
/>
<
ItemStyle
Width
=
"160px"
/>
</
telerik:GridDateTimeColumn
>
<
telerik:GridBoundColumn
DataField
=
"risk_level"
FilterControlAltText
=
"Filter risk column"
HeaderText
=
"Risk Level"
UniqueName
=
"risk"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
></
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
></
FilterMenu
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_WebBlue"
></
HeaderContextMenu
>
</
telerik:RadGrid
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
Skin
=
"WebBlue"
width
=
"873px"
>
</
telerik:RadAjaxLoadingPanel
>
</
asp:TableCell
>
</
asp:TableRow
>
</
asp:Table
>
<
br
/>
<
asp:Panel
ID
=
"Panel1"
runat
=
"server"
Visible
=
"false"
>
<
telerik:RadFilter
ID
=
"RadFilter1"
runat
=
"server"
FilterContainerID
=
"RadGrid1"
Enabled
=
"false"
ShowApplyButton
=
"false"
>
</
telerik:RadFilter
>
</
asp:Panel
>
<
br
/>
<
telerik:RadAjaxManager
runat
=
"server"
>
<
ClientEvents
OnRequestStart
=
"onRequestStart"
/>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadListBox1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadListBox1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadListFilter1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadButton1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadButton1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadListBox1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadListFilter1"
/>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
Private
Sub
RadGrid1_NeedDataSource(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridNeedDataSourceEventArgs)
Handles
RadGrid1.NeedDataSource
connSql.ConnectionString = sqlConn.ToString()
Dim
poSqlCom
As
New
SqlCommand(
"dbo.AccountRiskLevel"
, connSql)
poSqlCom.CommandType = CommandType.StoredProcedure
Dim
adapter
As
New
SqlDataAdapter(poSqlCom)
Try
adapter.Fill(dtRisk)
Catch
ex
As
Exception
'lblResult.Text = ex.Message
If
connSql.State = ConnectionState.Open
Then
connSql.Close()
End
If
End
Try
RadGrid1.DataSource = dtRisk
End
Sub
Protected
Sub
RadGrid1_ItemDataBound(sender
As
Object
, e
As
GridItemEventArgs)
Handles
RadGrid1.ItemDataBound
If
TypeOf
e.Item
Is
GridFilteringItem
Then
Dim
filteringItem
As
GridFilteringItem = TryCast(e.Item, GridFilteringItem)
filteringItem.Cells(8).Controls(0).Visible =
False
filteringItem.Cells(8).Controls(1).Visible =
False
End
If
End
Sub
Private
Sub
RadListBox1_SelectedIndexChanged(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
RadListBox1.SelectedIndexChanged
RadFilter1.RootGroup.GroupOperation = RadFilterGroupOperation.
Or
Dim
count
As
Integer
= 0
RadFilter1.RootGroup.Expressions.Clear()
For
Each
item
In
RadListBox1.SelectedItems
If
count = 0
Then
Dim
expr1
As
New
RadFilterEqualToFilterExpression(Of
String
)(
"risk_level"
)
expr1.Value = item.Value
RadFilter1.RootGroup.AddExpression(expr1)
ElseIf
count = 1
Then
Dim
expr2
As
New
RadFilterEqualToFilterExpression(Of
String
)(
"risk_level"
)
expr2.Value = item.Value
RadFilter1.RootGroup.AddExpression(expr2)
ElseIf
count = 2
Then
Dim
expr3
As
New
RadFilterEqualToFilterExpression(Of
String
)(
"risk_level"
)
expr3.Value = item.Value
RadFilter1.RootGroup.AddExpression(expr3)
ElseIf
count = 3
Then
Dim
expr4
As
New
RadFilterEqualToFilterExpression(Of
String
)(
"risk_level"
)
expr4.Value = item.Value
RadFilter1.RootGroup.AddExpression(expr4)
ElseIf
count = 4
Then
Dim
expr5
As
New
RadFilterEqualToFilterExpression(Of
String
)(
"risk_level"
)
expr5.Value = item.Value
RadFilter1.RootGroup.AddExpression(expr5)
End
If
count = count + 1
Next
RadFilter1.FireApplyCommand()
End
Sub
Private
Sub
RadButton1_Click(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
RadButton1.Click
RadFilter1.RootGroup.Expressions.Clear()
RadFilter1.FireApplyCommand()
RadListBox1.ClearSelection()
End
Sub
#End Region