Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
65 views

Hi Everyone,

I am using RadEditor, and I am trying to create an insert/upload image dialog. It works great in FF, Chrome, IE7/8 and before, but in IE9 it throws JavaScript error

“Line: 792

Error: DOM Exception: INVALID_CHARACTER_ERR (5)”  

Built in debugger is throwing error at

}}else{var o=($telerik.isIE)?document.createElement("<iframe name='"+c+"'>"):document.createElement("iframe");

o.name=c;

 

And console is showing:

SCRIPT5022: DOM Exception: INVALID_CHARACTER_ERR (5)
ScriptResource.axd?d=rJkSr8ttpP52D876ZF1WeNxnHE6aTSXEyuHB1Xl6uJ1zBgTteHkHuv7Y2iAt9aZv9uah5nKxT6ylXPwwQHwgyljpNIHN3Q0-kSVosKQoQ2uPIfQme2LiD3_reNMfI8mZGncmOhVbL4j51EIh2kStPmT25r81&t=ffffffff987f999b, line 792 character 8

This is JavaScript used

<script type="text/javascript">

                Telerik.Web.UI.Editor.CommandList["InsertCustomImage"] = function(commandName, editor, args) {

                    var myCallbackFunction = function(sender, args) {

                        editor.pasteHtml(String.format("<img src='{0}' border='0' align='middle' alt='Custom Image' /> ", args.image));

                    }

                    editor.showExternalDialog(

                                        "UploadEmailImage.aspx",

                                        {},

                                        400,

                                        310,

                                        myCallbackFunction,

                                        null,

                                        "Insert Image",

                                        true,

                                        Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,

                                        false,

                                        true);

                };

           </script>

And aspx is:

<telerik:RadEditor ID="txtEmailMessage" runat="server" Width="99%" Height="300px">

                                    <Tools>

                                        <telerik:EditorToolGroup>

                                            <telerik:EditorTool Name="InsertCustomImage" Text="Insert Image" />

                                        </telerik:EditorToolGroup>

                                    </Tools>

                                </telerik:RadEditor>

Any help welcome

If you need anything else, please ask. 

Cheers

S

Rumen
Telerik team
 answered on 05 Jun 2012
7 answers
180 views
Hi,

 I am using  Rad Scheduler and rad calender to display Appointment .I want to restrict the user for particular time slot.please let me know how can i restrict to add appointment  at that time.
for example today at 12 am i don't want to access the user to add appointment how can i do this let me know how can resolve this issue

regards,
venkateswararao
Plamen
Telerik team
 answered on 05 Jun 2012
1 answer
96 views
Hello,

I want the Grid to be collapsed when it is initialized the first time. So I set 
MasterTableView.GroupsDefaultExpanded = false;
But if the user expands one group and sorts or reorders a column, all groups are collapsed, even the node the user just expanded.
Do I have to keep track myself which nodes were expanded by the user?

Shinu
Top achievements
Rank 2
 answered on 05 Jun 2012
1 answer
87 views
For reasons not worth going into, I'm stuck on ASP.Net 2.0 with Ajax Extensions v1.0.61025, so I'm also stuck using RadControls 2010 Q3.  And I've also only been using Telerik for a couple months, so I'm still pretty green.

I'd like to get some kind of support working for browser history with Ajax.  I've been banging my head against it for a few days now and not making much progress.  The only moderate success I've had is using Nikhil's old UpdateHistory control, although it has some issues with RadGrid.

So as just a sanity check, given my ASP.Net 2.0 constraint, what's the best way to get history working?
Maria Ilieva
Telerik team
 answered on 05 Jun 2012
0 answers
94 views
Hi friends ,

In our application we are binding grid on client side.
On binding the grid the records are not displying.I am not getting what's wrong in our code.
Bellow is the code i have written,

-----------------test.aspx -----------------------
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">      
 function pageLoad(sender, eventArgs) {          
          
           var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
           $find("<%= RadAjaxLoadingPanel1.ClientID %>").show("<%= RadGrid1.ClientID %>");
           PageMethods.GetData(0, tableView.get_pageSize(),
                tableView.get_sortExpressions().toString(), tableView.get_filterExpressions().toList(),
                    updateGrid);
                   
           PageMethods.GetCount(tableView.get_filterExpressions().toList(), updateVirtualItemCount);
       }
function updateGrid(result) {          
           var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
           tableView.set_dataSource(result);
           tableView.dataBind();          
 
           $find("<%= RadAjaxLoadingPanel1.ClientID %>").hide("<%= RadGrid1.ClientID %>");
          
        }
 function updateVirtualItemCount(result)
        {
           var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
           tableView.set_virtualItemCount(result);
        }
  function RadGrid1_Command(sender, args) {         
            args.set_cancel(true);                       
            var pageSize = sender.get_masterTableView().get_pageSize();
            var sortExpressions = sender.get_masterTableView().get_sortExpressions();
            var filterExpressions = sender.get_masterTableView().get_filterExpressions();           
            var currentPageIndex = sender.get_masterTableView().get_currentPageIndex();               
            if (args.get_commandName() == "Filter")
                currentPageIndex = 0;
            var sortExpressionsAsSQL = sortExpressions.toString();
            var filterExpressionsAsSQL = filterExpressions.toString();
            $find("<%= RadAjaxLoadingPanel1.ClientID %>").show("<%= RadGrid1.ClientID %>");
            PageMethods.GetData(currentPageIndex * pageSize, pageSize, sortExpressionsAsSQL, filterExpressions.toList(), updateGrid);         
          
        }
</script>

    </telerik:RadCodeBlock>

<telerik:RadScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server" />
<telerik:RadGrid ID="RadGrid1" EnableViewState="false" runat="server" AllowPaging="true"
            AllowSorting="True" AllowFilteringByColumn="true" GridLines="None">
            <ItemStyle Wrap="false" />
            <MasterTableView AllowMultiColumnSorting="true" TableLayout="Fixed">
                <Columns>
                    <telerik:GridBoundColumn DataField="EmployeeID" HeaderText="EmployeeID" HeaderStyle-Width="100px"
                        FilterControlWidth="50px" />
                    <telerik:GridBoundColumn DataField="ENAME" HeaderText="ENAME" />
                    <telerik:GridBoundColumn DataField="SALARY" HeaderText="SALARY" />
                </Columns>
            </MasterTableView>
            <PagerStyle AlwaysVisible="true" Mode="NumericPages" />
            <ClientSettings>
                <ClientEvents OnCommand="RadGrid1_Command"  />
            </ClientSettings>
        </telerik:RadGrid>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
-----------------test.aspx.cs -----------------------
[WebMethod]
    public static int GetCount(List<GridFilterExpression> filterExpressions)
    {
        int count = 0;

        using (SqlConnection connection =
            new SqlConnection(
                ConfigurationManager.ConnectionStrings["sqlConstr"].ConnectionString))
        {           

            StringBuilder sqlBuilder = new StringBuilder();
            sqlBuilder.Append("SELECT COUNT(*) FROM Employee");        
          
            SqlCommand command = new SqlCommand(sqlBuilder.ToString(),
                    connection);

            parameters.ForEach(
                delegate(DbParameter parameter) { if (parameter != null) command.Parameters.Add(parameter); });

            connection.Open();

            SqlDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                count = reader.GetInt32(0);
            }

            reader.Close();

        }
        return count;
    }

    [WebMethod]
    public static List<Employee> GetData(int startIndex, int maximumRows,
        string sortExpressions, List<GridFilterExpression> filterExpressions)
    {

        List<Employee> list = new List<Employee>();
        StringBuilder sqlBuilder = new StringBuilder();
        sqlBuilder.AppendLine(" SELECT * FROM Employee");     
        sqlBuilder.AppendLine(" Order By EID ASC");
        using (SqlConnection connection =
            new SqlConnection(
                ConfigurationManager.ConnectionStrings["sqlConstr"].ConnectionString))
        {
            SqlCommand command = new SqlCommand(sqlBuilder.ToString(), connection);           
            connection.Open();
            SqlDataReader reader = command.ExecuteReader();
            try
            {
                while (reader.Read())
                {
                    Employee newEmployee = new Employee();
                    for (int i = 0; i < reader.FieldCount; i++)
                    {
                        switch (reader.GetName(i))
                        {
                            case "SALARY":
                                newEmployee.SALARY  = reader.GetInt32(i);
                                break;
                            case "ENAME":
                                newEmployee.ENAME  = reader.GetString(i);
                                break;
                            case "EID":
                                newEmployee.EID  = reader.GetString(i);
                                break;                           
                            default:
                                break;
                        }
                    }
                    list.Add(newEmployee);
                }
            }
            finally
            {
                reader.Close();
            }
        }
        return list;
    }

public class Employee
    {
        private string _EID;
        private string _ENAME;
        private int _SALARY;  

        public Employee()
        {

        }
        public string EID
        {
            get
            {
                return this._EID;
            }
            set
            {
                if ((this._EID != value))
                {
                    this._EID = value;
                }
            }
        }

        public string ENAME
        {
            get
            {
                return this._ENAME;
            }
            set
            {
                if ((this._ENAME != value))
                {
                    this._ENAME = value;
                }
            }
        }

        public int SALARY
        {
            get
            {
                return this._SALARY;
            }
            set
            {
                if ((this._SALARY != value))
                {
                    this._SALARY = value;
                }
            }
        }
    
    }

 

 Thanks in advance
  Anwar


Anwar
Top achievements
Rank 2
 asked on 05 Jun 2012
0 answers
77 views

I have custom page in SP2010 where I have used RadEditor Control which is working in IE 8.0  but not working in IE 9.0.

In IE 9.0, its thowing error following error.

Error 1: When page load
Webpage error details

Message: Unable to get value of the property 'addEventListener': object is null or undefined

Error 2: When trying to choose option of custom context menu.
Message: Unable to get value of the property 'set_activePopup': object is null or undefined

Please reply as early as possible. Due to this issue, product release is on hold.

Please see the Telerik version detail in attached file.

Thanks in advance.

Regards,
Hitendra


Hitendra
Top achievements
Rank 1
 asked on 05 Jun 2012
1 answer
172 views
Hi,

I have a radcombobox which gets bind on the prerender event of the update panel which is its parent.

I have these properties set on the combobox
EnableLoadOnDemand="True"
ShowMoreResultsBox="True"
MarkFirstMatch="true"
EnableVirtualScrolling="true"
EmptyMessage="--- Choose ---"

After the initial load of the combobox the showmoreresultsbox does not show anything but just a dropdown arrow. After i type something in the combobox and when it filters it shows "Items 1-2 out of 2"

How can i get the text on the showmoreresultsbox on the initial load. I have these methods in my code behind file:

    Private Function GetData(ByVal test As String) As DataView
        Dim NewDataview As DataView

        NewDataview = DataViewTest

        NewDataview.RowFilter = "ElementName LIKE '" + test + "%'"

        Return NewDataview
    End Function

    Private Shared Function GetStatusMessage(ByVal offset As Integer, ByVal total As Integer) As String
        If total <= 0 Then
            Return "No matches"
        End If

        Return [String].Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", offset, total)
    End Function

    Protected Sub ddlElements_ItemsRequested(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs) Handles ddlElements.ItemsRequested

        Dim data As DataTable = GetData(e.Text).ToTable

        Dim itemOffset As Integer = e.NumberOfItems
        Dim endOffset As Integer = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count)
        e.EndOfItems = endOffset = data.Rows.Count

        ddlElements.Items.Clear()


        For i As Integer = itemOffset To endOffset - 1
            ddlElements.Items.Add(New RadComboBoxItem(data.Rows(i)("ElementName").ToString(), data.Rows(i)("GroupID").ToString()))
        Next

        e.Message = GetStatusMessage(endOffset, data.Rows.Count)
    End Sub
Ivana
Telerik team
 answered on 05 Jun 2012
2 answers
97 views
Hi,
I am using latest Telerik.Web.UI.dll (version 2012.1.501.40)
I have a RadScheduler and i set Height=100%
<telerik:RadScheduler ID="RadScheduler1" runat="server" Height="100%" OverflowBehavior="Scroll">
</telerik:RadScheduler>

the scroll bar is showing on IE8
but not showing on Chrome and Safari Browsers.
Am i missing anything?
Please find the screenshot attachments.

Ivana
Telerik team
 answered on 05 Jun 2012
5 answers
124 views
I have inserted a scheduler within a multipage which is associated with the radtabstrip.

Although the scheduler will come on to the screen when I click on the second tab, the scheduler is only showing approximatley 100px of height, even though I have manually set the scheduler to have a height of 500px .  Because my document background is formated in grey I can see a large portion of white space where the whole scheduler should be being displayed(which would make up the 500px).

 When I click on the "24 hour" / "day" / "Month" views the scheduler then fills in the white space.

If I drag and drop the calendar out of the Multipage it works fine so is there a problem with the UI or is there further configuration that I am missing?

Thanks,

JK
Justin
Top achievements
Rank 1
 answered on 05 Jun 2012
3 answers
545 views
Hi Telerik,

In my case, I want to show or hide any rows by clicking the link in template column in rad grid, click '+' to show the current row and '-' to hdie the current row.  And whatever the user chooses show or hide, keep the column that contians sign '+' and '-' to re-show and re-hide the current row. ( the UI is as shown below) How to achieve it? Look forward to your reply.

Thanks in advance.
Princy
Top achievements
Rank 2
 answered on 05 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?