DirectCast
(
Me
.Page.FindControl(
"WindowManager"
), RadWindowManager).RadAlert(
"Endereço foi salvo com sucesso."
, 330, 100,
"Sucesso"
,
"alertCallBackFn"
)
<
telerik:RadWindowManager
ID
=
"WindowManager"
runat
=
"server"
EnableShadow
=
"true"
EnableViewState
=
"false"
ReloadOnShow
=
"true"
>
<
ConfirmTemplate
>
<
div
class
=
"rwDialogPopup radconfirm"
>
<
div
class
=
"rwDialogText"
>
{1}
</
div
>
<
div
>
<
a
onclick
=
"$find('{0}').close(true);"
class
=
"rwPopupButton"
href
=
"javascript:void(0);"
><
span
class
=
"rwOuterSpan"
><
span
class
=
"rwInnerSpan"
>Sim</
span
></
span
></
a
> <
a
onclick
=
"$find('{0}').close(false);"
class
=
"rwPopupButton"
href
=
"javascript:void(0);"
><
span
class
=
"rwOuterSpan"
><
span
class
=
"rwInnerSpan"
>Não</
span
></
span
></
a
>
</
div
>
</
div
>
</
ConfirmTemplate
>
</
telerik:RadWindowManager
>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock2"
runat
=
"server"
>
<
script
language
=
"javascript"
type
=
"text/javascript"
>
function alertCallBackFn(arg) {
CloseRadWindow();
}
function GetRadWindow() {
var oWindow = null;
if (window.radWindow)
oWindow = window.radWindow;
else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;
return oWindow;
}
function CloseRadWindow() {
var oWindow = GetRadWindow();
oWindow.argument = null;
oWindow.close();
return false;
}
</
script
>
</
telerik:RadCodeBlock
>
private
void
LoadEmployees()
{
Directory_BO.Collections.Employees tmpEmployees =
new
Directory_BLL.OfficeManager().GetOfficeEmployees(OfficeToDisplay.ID);
if
(tmpEmployees.Count > 0)
{
tblNoEmployees.Visible =
false
;
}
else
{
radTabEmployees.Enabled =
false
;
return
;
}
//Set the text of the tab
radTabEmployees.Text =
"Employees ("
+ tmpEmployees.Count +
")"
;
//Get the Distinct Ability Types
var distinctDivisions = tmpEmployees.Cast<Directory_BO.Employee>().GroupBy(c => c.DivisionName).Select(grp => grp.First()).OrderBy(o => o.ContactDivision.Code);
//Create the Tabs and MultiPage pageviews
foreach
(Directory_BO.Employee div
in
distinctDivisions)
{
var tmpDivEmployees = tmpEmployees.Cast<Directory_BO.Employee>().Where(c => c.ContactDivision.ID == div.ContactDivision.ID);
//Add Multipage for the Division
Telerik.Web.UI.RadPageView tmpPageView =
new
Telerik.Web.UI.RadPageView();
tmpPageView.ID =
"radPV"
+ div.ContactDivision.Code;
radMPEmployees.PageViews.Add(tmpPageView);
//Add Tab for the Divison
Telerik.Web.UI.RadTab tmpTab =
new
Telerik.Web.UI.RadTab((div.ContactDivision.Code !=
string
.Empty ? div.ContactDivision.Name :
"Not Listed"
) +
" ("
+ tmpDivEmployees.Count() +
")"
, div.ContactDivision.ID.ToString());
tmpTab.PageViewID = tmpPageView.ID;
radTSEmployees.Tabs.Add(tmpTab);
//Create and load the RadOrgChart
Telerik.Web.UI.RadOrgChart tmpOrgChart =
new
Telerik.Web.UI.RadOrgChart();
tmpOrgChart.ID =
"radOC"
+ div.ContactDivision.Code;
tmpOrgChart.EnableEmbeddedBaseStylesheet =
false
;
tmpOrgChart.EnableEmbeddedSkins =
false
;
tmpOrgChart.Skin =
"IntertekEmployee"
;
tmpOrgChart.GroupColumnCount = 3;
tmpOrgChart.DisableDefaultImage =
true
;
tmpOrgChart.ItemTemplate =
new
EmployeeItemTemplate();
//Table to hold the data for the items
DataTable itemsTable =
new
DataTable();
itemsTable.Columns.Add(
"NodeID"
);
itemsTable.Columns.Add(
"FullNameLink"
);
itemsTable.Columns.Add(
"Title"
);
itemsTable.Columns.Add(
"FullContactInfo"
);
itemsTable.Columns.Add(
"EmployeeID"
);
//Add the details of the employees to the itemTable
foreach
(Directory_BO.Employee tmpC
in
tmpDivEmployees)
itemsTable.Rows.Add(
new
string
[] {
"1"
, tmpC.FullNameLink, tmpC.Title, tmpC.FullContactInfo, tmpC.ID.ToString() });
//Bind the Employee List OrgChart
tmpOrgChart.DataSource = itemsTable;
tmpOrgChart.DataBind();
//Add a top border
Literal tmpLiteral =
new
Literal();
tmpLiteral.Text =
"<div style='border-top:solid 1px #AAAAAA;'></div>"
;
//Add the RadOrgChart to the Mulitpage
radMPEmployees.FindControl(tmpPageView.ID).Controls.Add(tmpLiteral);
radMPEmployees.FindControl(tmpPageView.ID).Controls.Add(tmpOrgChart);
}
}
private
void
LoadOrgChart()
{
Directory_BLL.EmployeeManager ContactMgr =
new
Directory_BLL.EmployeeManager();
//Table to define the nodes
DataTable nodeTable =
new
DataTable();
nodeTable.Columns.Add(
"ID"
);
nodeTable.Columns.Add(
"ManagerID"
);
//Table to hold the data for the items
DataTable itemsTable =
new
DataTable();
itemsTable.Columns.Add(
"NodeID"
);
itemsTable.Columns.Add(
"ID"
);
itemsTable.Columns.Add(
"FullName"
);
itemsTable.Columns.Add(
"Title"
);
itemsTable.Columns.Add(
"CityProvince"
);
itemsTable.Columns.Add(
"ImageURL"
);
//Get Contacts Manager
var tmpCM = ContactMgr.GetEmployeeByID(ContactToDisplay.ManagerID);
if
(tmpCM.ID != 1)
{
//Get Contacts Managers employees
var tmpCME = ContactMgr.GetEmployeesByManagerID(tmpCM.ID);
//Get Contacts Employees
var tmpCE = ContactMgr.GetEmployeesByManagerID(ContactToDisplay.ID);
//Add the nodes to the nodesTable
nodeTable.Rows.Add(
new
string
[] {
"1"
,
null
});
nodeTable.Rows.Add(
new
string
[] {
"2"
,
"1"
});
//Add the details of the employees to the itemTable
itemsTable.Rows.Add(
new
string
[] {
"1"
, tmpCM.ID.ToString(),
"<b>"
+ tmpCM.OrgChartFullNameLink +
"</b>"
, tmpCM.Title, tmpCM.City +
", "
+ tmpCM.Province,
"EmployeePhoto.ashx?img=thumb&id="
+ tmpCM.ID });
foreach
(Directory_BO.Employee tmpC
in
tmpCME)
{
itemsTable.Rows.Add(
new
string
[] {
"2"
, tmpC.ID.ToString(),
"<b>"
+ tmpC.OrgChartFullNameLink +
"</b>"
, tmpC.Title, tmpC.City +
", "
+ tmpC.Province,
"EmployeePhoto.ashx?img=thumb&id="
+ tmpC.ID });
}
if
(tmpCE.Count > 0)
{
nodeTable.Rows.Add(
new
string
[] {
"3"
,
"2"
});
foreach
(Directory_BO.Employee tmpC
in
tmpCE)
{
itemsTable.Rows.Add(
new
string
[] {
"3"
, tmpC.ID.ToString(),
"<b>"
+ tmpC.OrgChartFullNameLink +
"</b>"
, tmpC.Title, tmpC.City +
", "
+ tmpC.Province,
"EmployeePhoto.ashx?img=thumb&id="
+ tmpC.ID });
}
}
//Setup the relationships within the OrgChart
radOrgChart.GroupEnabledBinding.NodeBindingSettings.DataFieldID =
"ID"
;
radOrgChart.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID =
"ManagerID"
;
radOrgChart.GroupEnabledBinding.NodeBindingSettings.DataSource = nodeTable;
radOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataFieldNodeID =
"NodeID"
;
radOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataFieldID =
"ID"
;
radOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataImageUrlField =
"ImageURL"
;
radOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataSource = itemsTable;
//Bind the OrgChart
radOrgChart.DataBind();
}
else
{
radTabOrgChart.Enabled =
false
;
}
}
<
telerik:RadPageView
ID
=
"radPVOrgChart"
runat
=
"server"
>
<
telerik:RadOrgChart
ID
=
"radOrgChart"
runat
=
"server"
GroupColumnCount
=
"4"
DisableDefaultImage
=
"false"
ClientIDMode
=
"Static"
Skin
=
"Sitefinity"
OnGroupItemDataBound
=
"radOrgChart_GroupItemDataBound"
>
<
RenderedFields
>
<
ItemFields
>
<
telerik:OrgChartRenderedField
DataField
=
"FullName"
/>
<
telerik:OrgChartRenderedField
DataField
=
"Title"
/>
<
telerik:OrgChartRenderedField
DataField
=
"CityProvince"
/>
</
ItemFields
>
</
RenderedFields
>
</
telerik:RadOrgChart
>
</
telerik:RadPageView
>
foreach
(GridColumn column in grdA.MasterTableView.Columns)
{
column.CurrentFilterFunction =
GridKnownFunction.NoFilter;
column.CurrentFilterValue =
string.Empty;
}
grdA.MasterTableView.FilterExpression =
string.Empty;
grdA.DataSource = AccountSummaryList;
grdA.DataBind();
I tried to show the "loading panel" using RadAjaxManager request start and responce end but its not showing the loading panel. I did this on Master page;
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
<ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
</telerik:RadAjaxManager>
<script type="text/javascript">
var currentLoadingPanel = null;
var currentUpdatedControl = null;
function RequestStart(sender, eventArgs) {
if (eventArgs != undefined) {
var initControl = eventArgs.get_eventTarget();
if (initControl == 'ctl00$cph1$myToolBar') {
currentLoadingPanel = $find("<%= lp1.ClientID %>"); //ajax loading lanel
currentUpdatedControl = $find("<%= cph1.ClientID %>"); //content panel
if (currentLoadingPanel != null) {
currentLoadingPanel.hide(currentUpdatedControl);
}
currentLoadingPanel.show(currentUpdatedControl);
}
}
}
function ResponseEnd(sender, eventArgs) {
if (currentLoadingPanel != null) {
currentLoadingPanel.hide(currentUpdatedControl);
}
currentUpdatedControl = null;
currentLoadingPanel = null;
}
</script>
Even after doing this there is delay in actual clear and loading panel show.
other things I tried ; are I added autopostback on toolbar - no use.
One this which is working for me but has issue is;
On client click of toolbar I am calling client function and clearing like this -
<script type="text/javascript">
function OnClientButtonClicked(sender, args) {
var button = args.get_item();
var txt = button.get_text();
if (txt == 'Clear') {
var masterTable = $find("<%= grdA.ClientID %>").get_masterTableView();
var columns = masterTable.get_columns();
for (var i = 0; i < columns.length; i++) {
var column = columns[i];
masterTable.filter(column._data.UniqueName,
"", Telerik.Web.UI.GridFilterFunction.StartsWith, true);
}
}
}
</script>
The above function is doing well. The problem with above code is whenever I typr something in filter text area of one column and try to type something in other filter couln it throws JS error as attached in this post.
If I change above code to ;
masterTable.filter("Location", "", Telerik.Web.UI.GridFilterFunction.StartsWith, true); // coulmn name
it is not throwing any error., but doesn't work fine.
Please let me know what is the issue with this code?
And for my entire problem if there are any other ways to do it?