Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
78 views
Hi,

I have written server side code to open a RadWindow using RADOpen method in a treeview's context menu event. its working fine but I have a problem that if I click the other node in the treeview after closing the RadWindow then I'm getting the same RadWindow again.
 
the below is the code behind,

string

 

 

jsNewSection = "function btnNewClick(){ ";
jsNewSection +=
"var oWnd = radopen('Sample.aspx?ID=" + id + "&name=" + strName+ ', 'RadWindow1'); ";
jsNewSection +=
" oWnd.SetSize (800, 280); oWnd.center(); return false; ";
jsNewSection +=
"Sys.Application.remove_load(btnNewClick); }; Sys.Application.add_load(btnNewClick); ";
RadScriptManager.RegisterStartupScript(this, this.GetType(), "btnNewClick", jsNewSection, true);

html,

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true" EnableViewState="false" VisibleOnPageLoad="false">
<Windows>
<telerik:RadWindow ID="RadWindow1" runat="server" EnableViewState="false" ></telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>

Please provide me a solution to prevent from opening again.


Thanks...
Elangovan P

 

 

 

 

 

 

 

Elangovan
Top achievements
Rank 1
 answered on 08 Dec 2010
3 answers
84 views
Hi there,

Using the v5.8.1 of the MOSS 2007 RAD Editor - when we have multiple RAD Editor controls on a page, we observe very poor loading times in IE7. IE 8 is somewhat better, and of course the majority of this is presumably based on improved javascript engine and css handling. As an example, firefox 3.6 loads the page in under 3 seconds. IE8 takes just over 10, and IE7 takes over 30 (and becomes effectively unusable due to high CPU utilisation).
I have reviewed some of the performance tips and tried various options. As it stands, we now have as follows:
- no modules loading
- we are not using the CSS menus
- we have minimised the controls required on the toolbars.
- we have also tried using shared toolbar and the toolbar "showonfocus" property. Whilst these do help in loading time for the RAD objects in IE8 (as an example), the impact is minimal.

Using fiddler to trace the calls, we see that (as an example) the Sharepoint core.css is loaded for every RAD Editor instance on the page, with .4 to .5 second delay in between. Once all these have been called, it then proceeds to call editorcontentarea.css, htmleditortableformats.css and htmleditorcustomstyles.css (all 3 for each instance of the RAD Editor on the page).

The core.css have the longest delays between them - I'm assuming that for core.css this has to do with the javascript processing starting for each instance of the control?  - is there any way to stop it calling core.sss for every instance? it is cached, but the additional delay in getting the 304 response from a remote server to use the cached object all adds up to a significant percentage of (for IE8) the 10 seconds load time.

Would very much appreciate any tips or experiences around optimising these.

-IC
Stanimir
Telerik team
 answered on 08 Dec 2010
3 answers
169 views
How to set a delay before showing dropdown div? When I press a key in combobox field, an empty div appears without delay.
Kalina
Telerik team
 answered on 08 Dec 2010
3 answers
324 views
Hello,

I'm having trouble removing the border from RadListBoxes inside of my RadGrid's GridTemplateColumn. If anybody knows how to achieve this, please let me know. The below code is what I have tried - it worked to alter the height of the listbox, but not the border style or color.

Any assistance would be appreciated!

Thanks,
Casey

GridTemplateColumn definitions:
<telerik:GridTemplateColumn HeaderText="Assigned Departments" UniqueName="TemplateColumn">  
                                <ItemTemplate> 
                                    <telerik:RadListBox ID="rlbMyDepts" runat="server" Width="250px" BorderStyle="None" 
                                        DataKeyField="DEPT_CD" DataTextField="DESC">  
                                    </telerik:RadListBox> 
                                    <br /> 
                                    <asp:LinkButton ID="lbChangeAssignedDepts" runat="server" CommandName="ChangeAssignedDepts" 
                                                    OnClientClick='<%#Eval("USER_ID", "return ShowDeptsForm(\"{0}\")")%>'>Change</asp:LinkButton> 
                                </ItemTemplate> 
                            </telerik:GridTemplateColumn> 
                            <telerik:GridTemplateColumn HeaderText="Assigned Object Classes" UniqueName="TemplateColumn1">  
                                <ItemTemplate> 
                                    <telerik:RadListBox ID="rlbMyObjects" runat="server" Width="250px" BorderStyle="None" 
                                        DataKeyField="OBCL_CD" DataTextField="OBCL_CD">  
                                    </telerik:RadListBox> 
                                    <br /> 
                                    <asp:LinkButton ID="lbChangeAssignedObjects" runat="server" CommandName="ChangeAssignedObjects" 
                                                    OnClientClick='<%#Eval("USER_ID", "return ShowObjectsForm(\"{0}\")")%>' EnableViewState="True" BorderStyle="None">Change</asp:LinkButton> 
                                </ItemTemplate> 
                            </telerik:GridTemplateColumn> 

Code Behind in RadGrid's ItemDataBound event:
if (e.Item is GridDataItem)  
        {    
            GridDataItem d = e.Item as GridDataItem;  
 
            RadListBox myDepts = d.FindControl("rlbMyDepts"as RadListBox;  
            myDepts.BorderStyle = BorderStyle.None;  
            myDepts.BorderColor = System.Drawing.Color.White;  
            myDepts.Height = Unit.Pixel(50);  
 
            RadListBox myObjects = d.FindControl("rlbMyObjects"as RadListBox;  
            myObjects.BorderStyle = BorderStyle.None;  
            myObjects.BorderColor = System.Drawing.Color.White;  
            myObjects.Height = Unit.Pixel(50);  
        }  
 
 

Phil
Top achievements
Rank 2
 answered on 08 Dec 2010
6 answers
393 views
Hi,

I have a RadGrid and i want to show aggregate 'Sum' for one particular column in the footer. This RadGrid's data source is a data table which pulls data from an excel file. Below is my aspx codes for the RadGrid.

<telerik:RadGrid ID="gvTestResult" runat="server" AllowSorting="true" 
            ShowFooter="true"> 
        <MasterTableView AutoGenerateColumns="false" EnableNoRecordsTemplate="true" >
                <Columns>
                    <telerik:GridBoundColumn DataField="SPEED" HeaderText="SPEED">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DEMAND" HeaderText="DEMAND">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="AFTER_UTS" HeaderText="AFTER_UTS" Aggregate="Sum">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>























 It gives me Sum is not supported for type "System.Object"'  (refer to SumError.jpg)  at my gvTestResult.DataBind() step.

I also tried to replace GridBoundColumn to GridNumericColumn and it gives me 'Specified cast is not valid' error(refer to InvalidCast.jpg).

Any advice?

										
Pavlina
Telerik team
 answered on 08 Dec 2010
1 answer
97 views
If we add a file with forbidden extension and next try to upload , the validator signals that the action is denied. However, when we delete this file, the error message keeps appearing. Supposingly, user adds now file with correct extension but he will still get the info about wrong extension (until click on upload button that fires validation). This can be a bit confusing for users. What we would like to do is to plug additional (only client-side) validation whenever users deletes a file - we could now check if the problematic file is still selected and if not - hide the error message. The problem is - we have no onclientdeleted event defined in radupload. There is onclientdeleting (during that event we see all selected files including the one being deleted), but how we can determine whether that row (that file) is actually being deleted? 
Genady Sergeev
Telerik team
 answered on 08 Dec 2010
3 answers
114 views
Hello,

We're using Telerik rich text control for Sharepoint, version 5.7.3.0.

We've created a custom CSS class to style the bullets of a unordered list. This class is to be applied on the UL tag.
To use this class, the customer uses the following steps:
  1. Type or copy/paste the list of items
  2. Select all and click on the unordered list button
  3. Select the UL tag in the hierarchy (below the editor)
  4. Apply the custom class
We've noticed that the 3rd step doesn't work in IE7 or IE8 when there is only one item in the list. Clicking on the UL link doesn't change the selection, which stays on the LI element. And since the UL tag cannot be selected, the custom class cannot be applied to it.
I've attached a picture showing the editor after I've clicked on the UL link. As you can see in the hierarchy, the LI tag is still selected.

The workaround we've found is to created second list item to be able to apply the class on the UL, and to remove it afterward. Although it's working fine, it is quite annoying, and the customer wants a content creation procedure as dummy-proof as possible.

An easy fix would be appreciated. Also, let me know if the problem has been fixed in a newer version.

Kind regards,
Xavier Stévenne
Rumen
Telerik team
 answered on 08 Dec 2010
3 answers
170 views
Hi all,

I have reviewed custom command help and I understand how to create a simple custom command -- e.g. something that would display an alert when the custom command is clicked.

I would like to extend this to running non-javascript code. I have some C# which toggles a Microsoft Chart Control's legend and resizes the graph accordingly. I would like to have this be a custom command.

Do I need to use regular AJAX for this? My basic thought process is this:

- Assign a new Command to my Dock named ToggleLegend:
<Commands>
  <telerik:DockCommand
    Text="Toggle Legend"
    OnClientCommand="ToggleLegend" />
</Commands>

- Create the corresponding JavaScript:
<script type="text/javascript">
        function ToggleLegend(dock, args) {
MyAjaxedClassHere.ToggleLegend(ToggleLegend_CallBack);
}
 </script>

- Over in my C# Class:
[Ajax.AjaxMethod()]
private void ToggleLegend()
{
    //Code Here
}

I haven't tested this and I suspect it is an incorrect way of achieving my desired goal. Could someone confirm that this is the correct way of achieving this while using RAD Controls, or is there a nicer way?

Regards,

Sean Anderson
Pero
Telerik team
 answered on 08 Dec 2010
3 answers
196 views
Hi,

I need the ComboBox to show the first item in the list when clicked, rather than automatically scrolling down to the first selected item.

How do I do this?

Thanks,

Rob
Robert
Top achievements
Rank 1
 answered on 08 Dec 2010
8 answers
119 views
I have a radgrid with several pages, and on each page there are hyperlinked row values that navigate the user away from the grid to another page (like Google).  What I would like to do is persist the last page viewed so that when the user clicks the back button, I return to the last page viewed and not the first page.  Here's a sample page.

<%@ Page Language="vb" AutoEventWireup="false" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<script runat="server">
 
    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
        Dim table As New System.Data.DataTable
        Dim i As Integer
        table.Columns.Add("ContactID")
        table.Columns.Add("FirstName")
        table.Columns.Add("LastName")
        table.Columns.Add("ContactType")
        table.Columns.Add("PostedDate")
        table.Columns.Add("Replied")
 
        For i = 1 To 50
            table.Rows.Add(i, i, i, i, DateTime.Now, i)
        Next
        RadGrid1.DataSource = table
         
    End Sub
     
    Protected Sub RadGrid1_PageIndexChanged(ByVal source As Object, ByVal e As Telerik.Web.UI.GridPageChangedEventArgs)
        RadScriptManager1.AddHistoryPoint("p", e.NewPageIndex)
    End Sub
 
    Protected Sub ScriptManager_Navigate(ByVal sender As Object, ByVal e As System.Web.UI.HistoryEventArgs) Handles RadScriptManager1.Navigate
        If e.State.Count <= 0 Then
            ' Default state
            RadGrid1.CurrentPageIndex = 0
        Else
            Dim key As String = e.State.AllKeys(0)
            If key = "p" Then
                Dim state As String = e.State(key)
                RadGrid1.CurrentPageIndex = CInt(state)
                RadGrid1.Rebind()
            End If
        End If
    End Sub
 
 
</script>
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1" EnableAJAX="true"
        runat="server">
        <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
             <UpdatedControls>  
                   <telerik:AjaxUpdatedControl ControlID="RadGrid1" />  
             </UpdatedControls>  
    </telerik:AjaxSetting>  
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
 
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" GridLines="None"
        AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"
        AllowMultiRowSelection="true" PageSize="25" PagerStyle-Mode="NextPrevAndNumeric" EnableViewState="true">
        <PagerStyle AlwaysVisible="True" Position="TopAndBottom" />
        <ClientSettings>
            <Selecting AllowRowSelect="true" />
        </ClientSettings>
        <GroupingSettings CaseSensitive="false" />
        <MasterTableView DataKeyNames="ContactID,Replied">
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <HeaderStyle Font-Bold="true" />
            <Columns>
                <telerik:GridBoundColumn DataField="ContactID" HeaderText="ContactID" Visible="false"
                    UniqueName="ContactID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" UniqueName="FirstName"
                    Visible="true">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn HeaderText="LastName" UniqueName="TemplateColumn">
                    <ItemTemplate>
                        <a href='http://www.google.com'>
                            <%#Eval("LastName")%></a>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="ContactType" HeaderText="Contact Type" Visible="true"
                    UniqueName="ContactType" AllowFiltering="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="PostedDate" HeaderText="Posted Date" Visible="true"
                    UniqueName="PostedDate" AllowFiltering="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Replied" HeaderText="Replied" Visible="true"
                    UniqueName="Replied">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn HeaderText="Delete" UniqueName="Delete" AllowFiltering="false">
                    <ItemTemplate>
                        <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="~/Images/deletes.gif" ToolTip="Delete"
                            CommandName="Deletes" Style="cursor: hand" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Reply/View" UniqueName="View" AllowFiltering="false">
                    <ItemTemplate>
                        <asp:ImageButton ID="btnView" runat="server" ImageUrl="~/Images/views.gif" ToolTip="Reply/View"
                            CommandName="Reply" Style="cursor: hand" />
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                </telerik:GridTemplateColumn>
                <telerik:GridClientSelectColumn ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                    UniqueName="Chk_DeleteAll">
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </telerik:GridClientSelectColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    </form>
</body>
</html>

I've tried turning viewstate off on the grid but that doesn't seem to change the behavior.  Rebinding in the Navigate event doesn't update the grid (because it's ajaxed).  Maybe I'm overlooking something pretty simple and I'm open to alternative means of accomplishing the same behavior.  If anyone has some suggestions, I'm grateful.  Thanks.
Sebastian
Telerik team
 answered on 08 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?