Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
199 views
I just upgraded to the latest release of the AJAX tools and have run into an issue with the Org Chart control, the nodes are not being displayed correctly.  Please see attached images for the issues that I am having.  Also here is the code that creates the Org Charts for the respective images.

OrgChart align issue.png Code:
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);
       }
   }


OrgChart align issue2.png Code: 
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;
        }
    }
OrgChart align issue2.png Markup:
<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>
 
 

Peter Filipov
Telerik team
 answered on 11 Jul 2012
1 answer
93 views
hi,
We have enabled SSL on our firewall which now truncates packets and stops the Ajax from working.
When investigating this issue,  our team and sonicwall support determined that indeed we are losing packets.
The suggestion from sonicwall was that we needed to low the packet size as the firewall is seeing to large of packets and dropping some of them.

The firewall limit in SSL is 1500 MTU's  

It appears that the Telerik control is much larger than that and we need help on fixing this problem
How can we get the telerik controls to work within the packet maximum of 1500 MTU?



Genady Sergeev
Telerik team
 answered on 11 Jul 2012
2 answers
193 views
I have radgrid and radtoolbar. To filter grid based on column I have added radtoolbar items viz filter:on, off and clear.

When I enter some text in filter column text area and try to clear it using "clear" button from tool bar my code behind code is doing it but its taking time to clear the text. The loading panel is shown and then it goes off and after sometime the filter text areas gets cleared.

"That mean there is delay in actual render (cleared text areas) and loading panel show time"

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?


Radoslav
Telerik team
 answered on 11 Jul 2012
2 answers
265 views
Hi,

i have a problem, i recently found a solution to add my custom routes into Sitefinity tables.
my route url is like this ("Catalogue/{category}").

My problem is now my main menu treats the "catalogue" as a sub category in the link e.g. i have a news menu item which is supposed to redirect me to www.domain.com/news, but instead i get here www.domain.com/Catalogue/news, and that doesn't exist.

is there a way to force sitefinity menu to resolve urls to read from root?

Thanks.


Kwena
Top achievements
Rank 1
 answered on 11 Jul 2012
2 answers
295 views
Hello,

I have a RadGrid data bound using an EntityDataSource.

Functionality I am attempting to accomplish: The user should only be able to select a row if a column in that row contains a specific value. 

The column unique name which contains the value is PrpAnswerType.
When this rows' databound value is 6 for 'PrpAnswerType', that row should be selectable. Otherwise, there should be no select button.

I can't figure out how to hide/show the SELECT LinkButton based on another columns value for each row.

Here is my grid

<telerik:RadGrid ID="grdProperties" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
    AllowAutomaticUpdates="True" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"
    AutoGenerateHierarchy="True" CellSpacing="0" DataSourceID="edsProps" GridLines="None"
    SkinID="FewColumnsFewRecords">
    <ClientSettings>
        <Selecting CellSelectionMode="None"></Selecting>
    </ClientSettings>
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="PrpID" DataSourceID="edsProps">
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridBoundColumn DataField="PrpID" DataType="System.Int32" FilterControlAltText="Filter PrpID column"
                HeaderText="PrpID" ReadOnly="True" SortExpression="PrpID" UniqueName="PrpID"
                Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PrpName" FilterControlAltText="Filter PrpName column"
                HeaderText="Prop. Name" SortExpression="PrpName" UniqueName="PrpName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PrpQuestion" FilterControlAltText="Filter PrpQuestion column"
                HeaderText="Question Text" SortExpression="PrpQuestion" UniqueName="PrpQuestion">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn DataField="PrpAnswerType" FilterControlAltText="Filter PrpAnswerType column"
                HeaderText="Answer Type" SortExpression="PrpAnswerType" UniqueName="PrpAnswerType">
                <EditItemTemplate>
                    <telerik:RadComboBox ID="RadComboBox1" runat="server" SelectedValue='<%# Bind("PrpAnswerType") %>'>
                        <Items>
                            <telerik:RadComboBoxItem runat="server" Text="Integer" Value="1" />
                            <telerik:RadComboBoxItem runat="server" Text="Decimal" Value="2" />
                            <telerik:RadComboBoxItem runat="server" Text="Currency" Value="3" />
                            <telerik:RadComboBoxItem runat="server" Text="Boolean" Value="4" />
                            <telerik:RadComboBoxItem runat="server" Text="Text" Value="5" />
                            <telerik:RadComboBoxItem runat="server" Text="Custom Options" Value="6" />
                        </Items>
                    </telerik:RadComboBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="PrpAnswerTypeLabel" runat="server" OnDataBinding="PrpAnswerTypeLabel_DataBinding"
                        Text='<%# Eval("PrpAnswerType") %>'></asp:Label>
                      
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridButtonColumn CommandName="Select" FilterControlAltText="Filter AddColumnOption column"
                Text="Add Column Option" UniqueName="AddColumnOption">
            </telerik:GridButtonColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
</telerik:RadGrid>
<asp:EntityDataSource ID="edsProps" runat="server" ConnectionString="name=kdEntities"
    DefaultContainerName="kdEntities" EnableDelete="True" EnableFlattening="False"
    EnableInsert="True" EnableUpdate="True" EntitySetName="Properties">
</asp:EntityDataSource>

Thank you
Kevin

Shinu
Top achievements
Rank 2
 answered on 11 Jul 2012
1 answer
249 views
I'm currently going through our application and replacing all instances of ajaxtoolkit popups with Telerik popups and I've run into an issue.

I have a setup page that has an updatepanel on it and within that panel is a button. This button then calls a control. Inside this control is a method that calls a Launch method in the code behind of another control that contains my popup. It's a strange way of going about it I know but there were reasons for it. Anyways, the code behind of my control containing the popup had the .show() method for the ajaxtoolkit popup. I need to replicate the .show() functionality in the codebehind and make it work inside this updatepanel.

The reason for me being clear about the updatepanel is that on another page that doesn't contain an updatepanel and calls this same control I can get it to work by simply replacing the .show() line with a visibleOnPageLoad = true for the radwindow, however inside of an updatepanel this doesn't work.....umm why?

Window code in ascx file of my control AlertGroupEditor.ascx
<%--<ajaxToolkit:ModalPopupExtender ID="modalEditor" BackgroundCssClass="modalBackground" PopupControlID="pnlEditorPopup" TargetControlID="mpLauncher" runat="server"></ajaxToolkit:ModalPopupExtender>--%>
<telerik:RadWindow ID="winEditorPopup" Modal="true" runat="server" VisibleStatusbar="true" Title="Edit Alert Group" AutoSize="true" Behaviors="None">
    <ContentTemplate>
<!-- Insert Content Here -->
    </ContentTemplate>
</telerik:RadWindow>

Launch method in code behind of AlertGroupEditor.ascx.vb
Public Sub Launch(ByVal groupLauncherID As StringByVal groupEmailAddressIDs As ArrayListByVal groupEmailGroupIDs As ArrayListByVal groupFaxNumberIDs As ArrayList)
            LoadAlertGroup(groupLauncherIDgroupEmailAddressIDsgroupEmailGroupIDsgroupFaxNumberIDs)
            'modalEditor.Show()
            winEditorPopup.VisibleOnPageLoad = True
            lstShowType.SelectedValue = 0
            cbxGroupsOnly.Checked = False
        End Sub

Calling the Launch method from the AlertGroupEditorLauncher.ascx.vb
groupEditor.Launch(IDAlertGroup.EmailAddressIDsAlertGroup.EmailGroupIDsAlertGroup.FaxNumberIDs)
Princy
Top achievements
Rank 2
 answered on 11 Jul 2012
1 answer
245 views
I have two date picker control in the command template.

How to find those two controls from client side. I haven't found any demo for that.

sample code
 <CommandItemTemplate>
      From <telerik:RadDatePicker ID="RadDatePickerFrom" runat="server" ZIndex="30001" ShowPopupOnFocus="true" DatePopupButton-Visible="false" Width="80px" DateInput-DateFormat="M/dd/yyyy" ClientEvents-OnDateSelected="DateRangechanged"/>

     To  <telerik:RadDatePicker ID="RadDatePickerTo" runat="server" ZIndex="30001" ShowPopupOnFocus="true" DatePopupButton-Visible="false" Width="80px" DateInput-DateFormat="M/dd/yyyy" ClientEvents-OnDateSelected="DateRangechanged" />

</CommandItemTemplate>


On the clientside, i wish to use two variables
   datepickerfrom =
   datepickerto =

Thanks for help
Shinu
Top achievements
Rank 2
 answered on 11 Jul 2012
4 answers
314 views
Hi,

Is there a way to get a loading panel to display the seconds that has elapsed while it is being displayed.   For example, if I have a radgrid that displays a loading panel when a row is saved.  The save process may take 10 - 15 seconds and I would like to display the seconds as they go by in the loading panel. 

I know I can display a label on a page and attach a timer to it but I want to display the time elapsed in the loading panel.

Is there a way to do this?

Thank you for your help.
Tracy
Top achievements
Rank 1
 answered on 11 Jul 2012
2 answers
151 views
Hell Telerik,

I have recently updated to ASP.NET AJAX Q2 2012 update (previously on Q3 2011)
We have used the Scheduler and specified Advanced form attributes on our application.

After the update (mentioned above) I found that when a New Appointment is created, (double clicking on a timeslot on the calendar) it should show "PM" instead of the "AM" time that was chosen.
(see attached screenshot)

I had found that the update had appended TimeZoneID, TimeZoneOffset into the <telerik: RadScheduler> tag and also inserted EnableTimeZoneEditing into the <AdvancedForm> tag.

To work around this problem I found that once the above 3 tags were removed the scheduler would pick up the time correctly
i.e. 9.00 AM intead of 9.00 PM

The values for the above attributes were:
  • TimeZoneID = "New Zealand Standard Time"
  • TimeZoneOffset = "12:00:00"
  • EnableTimeZoneEditing = "True"

Am I missing something in configuration? (or possibly a bug?)

Thanks.







MfE_Developer
Top achievements
Rank 1
 answered on 10 Jul 2012
8 answers
232 views
We have a web app using the rad ajax controls that is deployed to the Azure platform.

We are experiencing an intermittent but frequent problem where the rad controls wont work after new deployments.
No errors are displayed but the controls dont render any skin elements eg a radwindow will show the internal content but the titlebars, frames etc and not rendered.

If I repeatedly deploy the same package to azure it will eventually work. Given each deployment can take 40 minutes this is extremely frustrating.

Has anyone come across this sort of problem?
ruben
Top achievements
Rank 1
 answered on 10 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?