Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
167 views

I'm using a client-side API to start the spell check process.

I'm using onchange client-side event to launch the SpellCheck dialog.

However, the SpellCheck dialog still appears & says "The spell check is complete!" even there are no misspelled words.

How can I suppress the SpellCheck dialog when there are no mispelled words ?

-JScript-

 

function MultipleTextSource(sources) {
    this.sources = sources;
    this.get_text = function () {
        var texts = [];
        for (var i = 0; i < this.sources.length; i++) {
            texts[texts.length] = this.sources[i].get_text();
        }
        return texts.join("<controlSeparator><br/></controlSeparator>");
    }
    this.set_text = function (text) {
        var texts = text.split("<controlSeparator><br/></controlSeparator>");
        for (var i = 0; i < this.sources.length; i++) {
            this.sources[i].set_text(texts[i]);
        }
    }
}

function spellCheck(obj, field) {
    var sources =
               [
               new Telerik.Web.UI.Spell.HtmlElementTextSource($get(field))
               ];
    var spell = GetRadSpell(obj);
    spell.set_textSource(new MultipleTextSource(sources));
    spell.startSpellCheck();
}

 

-ASPX-

<telerik:RadSpell ID="RadSpell1" runat="server"  />

<asp:TextBox ID="TextBox1" runat="server" />


-Code Behind-

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 TextBox1.Attributes.Add("onchange", "spellCheck('" & RadSpell1.ClientID & "','" & TextBox1.ClientID & "')")

End Sub

 

Martha
Top achievements
Rank 1
 answered on 11 Sep 2012
2 answers
47 views
I run the attached sample and add one expression, then I click the dropdown menu item to switch to select another item, it will throw exception. I cannot find the root cause.

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            DataTable dt = new DataTable();


            dt.Columns.Add("AA");
            dt.Columns.Add("BB");


            for (int i = 0; i < 10; i++)
            {
                DataRow row = dt.NewRow();
                row["AA"] = "AA" + i.ToString();
                row["BB"] = "BB" + i.ToString();


                dt.Rows.Add(row);
            }


            for (int i = 0; i < 10; i++)
            {
                RadFilterDropDownEditor dropDownFieldEditor = new RadFilterDropDownEditor();
                RadFilter.FieldEditors.Add(dropDownFieldEditor);
                dropDownFieldEditor.DataTextField = "AA";
                //dropDownFieldEditor.DataValueField = "BB";
                dropDownFieldEditor.DataSource = dt;
                dropDownFieldEditor.FieldName = "PV Field:[" + dt.Rows[i]["BB"].ToString() + "]";


                //RadFilterTextFieldEditor textFieldEditor = new RadFilterTextFieldEditor();
                //RadFilter.FieldEditors.Add(textFieldEditor);
                //textFieldEditor.FieldName = "Code Field:[" + dt.Rows[i]["AA"].ToString() + "]";
            }
        }
    }


    protected void RadFilter_FieldEditorCreating(object sender, RadFilterFieldEditorCreatingEventArgs e)
    {
        if (e.EditorType == "RadFilterDropDownEditor")
        {
            e.Editor = new RadFilterDropDownEditor();
        }
    }


    protected void RadButton1_Click(object sender, EventArgs e)
    {
        


    }


    public class RadFilterDropDownEditor : RadFilterDataFieldEditor
    {
        private RadComboBox _combo;


        protected override void CopySettings(RadFilterDataFieldEditor baseEditor)
        {
            base.CopySettings(baseEditor);
            var editor = baseEditor as RadFilterDropDownEditor;
            if (editor != null)
            {
                DataSource = editor.DataSource;
                DataTextField = editor.DataTextField;
                DataValueField = editor.DataValueField;
            }
        }


        public override System.Collections.ArrayList ExtractValues()
        {
            ArrayList list = new ArrayList();
            list.Add(_combo.Text);
            return list;
        }


        public override void InitializeEditor(System.Web.UI.Control container)
        {
            _combo = new RadComboBox();
            _combo.ID = "RadComboBoxField";
            _combo.DataTextField = DataTextField;            
            _combo.DataSource = DataSource;
            _combo.DataBind();
            container.Controls.Add(_combo);
        }


        public override void SetEditorValues(System.Collections.ArrayList values)
        {
            if (values != null && values.Count > 0)
            {
                if (values[0] == null) return;


                _combo.Text = values[0].ToString();
            }
        }




        public string DataTextField
        {
            get
            {
                return (string)ViewState["DataTextField"] ?? string.Empty;
            }
            set
            {
                ViewState["DataTextField"] = value;
            }
        }
        public string DataValueField
        {
            get
            {
                return (string)ViewState["DataValueField"] ?? string.Empty;
            }
            set
            {
                ViewState["DataValueField"] = value;
            }
        }
        public DataTable DataSource
        {
            get
            {
                return (DataTable)ViewState["DataSource"] ?? new DataTable();
            }
            set
            {
                ViewState["DataSource"] = value;
            }
        }
    }
}

Tsvetina
Telerik team
 answered on 11 Sep 2012
13 answers
925 views

I am using telerik grid internal sorting functionality.

 

I have set following properties -

AllowNaturalSort="false"

radGrid.MasterTableView.AllowSorting = true;

 

Issue -

If I click on header text of column, data get sorted but if I try to click on image for sorting, sorting is not working only page get postbacks.

Pavlina
Telerik team
 answered on 11 Sep 2012
1 answer
79 views
I'm getting some really slow performance from one radWindow and normal performance from another that is basically doing the same thing with a similar amount of items? 

They both are loading the same list and one is showing Available and the other Assigned.

Here's what I'm doing:
Grid NeedDataSource Call
1. Load a list from our database
2. Filter data from list and populate a dataset
3. Set dataset as the grid.datasource

I've added debug.writelines to the beginning of both NeedDataSource calls and i'm getting a 12 second lag from the time the Available grid finished to when it starts to work on the Assigned grid? HEre's my output data:

TOP Page_Load 9/11/2012 11:06:01 AM
--- TOP: PopulateRegionFilter() 9/11/2012 11:06:01 AM
--- BOTTOM: PopulateRegionFilter() 9/11/2012 11:06:01 AM
BOTTOM Page_Load 9/11/2012 11:06:01 AM
TOP of  grdAvblServiceAreas_NeedDataSource 9/11/2012 11:06:01 AM
BOTTOM of  grdAvblServiceAreas_NeedDataSource 9/11/2012 11:06:01 AM
TOP of  grdAsgdServiceAreas_NeedDataSource 9/11/2012 11:06:13 AM
BOTTOM of  grdAsgdServiceAreas_NeedDataSource 9/11/2012 11:06:13 AM


Now the crazy thing is that I have another RadWindow using almost the exact same code, but a different list and I'm getting super snappy results?
My parent page is using 2 different RadWindows, is that a problem?
I've been troubleshooting this for a day and half now and I'm completely stuck.
Jay
Top achievements
Rank 1
 answered on 11 Sep 2012
13 answers
3.9K+ views
Hello,

can you help me find resolve my following problem..?

I have RadGrid with Numeric Columns and one GridButtonColumn for automatic deletes. This is markup of one of my columns:

<telerik:GridNumericColumn DataField="HoursAmount" HeaderText="hrs." DataFormatString="{0:### ##0.0}"
  ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" />

When I click on delete link on column where value is bigger then 1000, grid write this error: Failed to set one or more properties on type Arcon.Web.ServiceJobHour. 1 000,00 is not a valid value for Decimal.

Now I'm finding way to use DecimalDigits property of GridNumericColumn but this doesn't do anything...

<telerik:GridNumericColumn DataField="HoursAmount" HeaderText="hrs." DataFormatString="{0:### ##0.0}"
  ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right"  DecimalDigits="2" />

Can you help me find to resolve it?

Thanks
Kavitha
Top achievements
Rank 1
 answered on 11 Sep 2012
4 answers
77 views
Hello,

I have an MVC 3.0 project which uses a Telerik MVC editor, for which we wanted to add spell checking.  Since MVC doesn't include RadSpell, I followed the instructions on these forums and elsewhere to integrate the Asp.Net AJAX spell check control.

From my Razor view I render a partial ascx view with the spell check control, and add a custom tool to the editor which calls this control via javascript.  The Javascript function finds the spell check control, sets it's controltocheck property to the appropriate value, and then starts the spell checking.

This works great in IE8, however in Chrome or Firefox it fails because the command I use to find the control returns null in those browsers (BUT finds the correct control in IE).

function checkSpelling(id) {
    var spell = $telerik.findSpell('<%= RadSpell1.ClientID %>');
    spell.set_controlToCheck(id+"Iframe");
    spell.startSpellCheck();
}


I've attached a small demo project that shows this problem.  I've seen some suggestions that this maybe a timing issue with the function running before the control is initialized, though this seems unlikely, and besides the suggested solutions to that (e.g. Sys.Application.add_load()  don't fix the issue. Please help me resolve this problem.
Martha
Top achievements
Rank 1
 answered on 11 Sep 2012
3 answers
31 views
HI,

I am using Telerik Rad Spliiter with Rad Tree control inside (Web Application has simple web page withh Rad splitter and tree with 10 nodes).

Sometimes on slower network and from remote location , page is not displayed (nont rendered completely). However if i just click on intenet explorer maximum button and all is visible(rendered). This is a random behaviour and is not reproducable  always and from all locations/networks.

I have noticed that this is a behavior specific to pages where we have RadSplitter control.  I tried to repaint the  Radspliter contol but no luck.

Please suggest.

Thanks and regards,
Manishkumar Patel

Vessy
Telerik team
 answered on 11 Sep 2012
1 answer
221 views
Hello, 

I have a grid that loads the data through a web-service. This is my code:

Grid:
<telerik:RadGrid runat="server" ID="rgOverzicht" Width="690px" PageSize="10"
                AllowPaging="true" AllowSorting="false" ClientSettings-Scrolling-AllowScroll="false" ClientSettings-Scrolling-UseStaticHeaders="true" AllowFilteringByColumn="false" AllowMultiRowSelection="false" EnableLinqExpressions="false">
                <GroupingSettings CaseSensitive="false" />
                <MasterTableView NoMasterRecordsText="Geen artikelen om te tonen." DataKeyNames="Artikel_Id" ClientDataKeyNames="Artikel_Id" TableLayout="Fixed">
                    <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="<b>{4}</b>  Pagina <b>{0}</b> van <b>{1}</b> | Item <b>{2}</b> t/m <b>{3}</b> van de <b>{5}</b>. " ShowPagerText="True" />
                    <Columns>
                        <telerik:GridBoundColumn DataField="IndexNr" UniqueName="IndexNr" HeaderText="Index" HeaderStyle-Width="65px"  />
                        <telerik:GridBoundColumn DataField="Omschrijving" UniqueName="Omschrijving" HeaderText="Omschrijving" />
                        <telerik:GridBoundColumn DataField="Afmeting" UniqueName="Afmeting" HeaderText="Afmeting" HeaderStyle-Width="65px"  />
                        <telerik:GridBoundColumn DataField="Drukklasse" UniqueName="Drukklasse" HeaderText="Drukklasse" HeaderStyle-Width="65px"  />
                        <telerik:GridBoundColumn DataField="Eenheidstarief" UniqueName="Eenheidstarief" HeaderText="Prijs (in €)" HeaderStyle-Width="75px"  />
                    </Columns>
                    <PagerStyle Mode="NumericPages" />
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true">
                    <DataBinding SelectMethod="GetDataAndCount"
                    Location="~/CalculatieGrid.asmx"
                        SortParameterType="Linq" FilterParameterType="Linq" >
                    </DataBinding>
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
            </telerik:RadGrid>

Web-service:
var data = RadGrid.GetBindingData(source, startRowIndex, maximumRows, sortExpression, filterExpression);
 
result.Data = data.Data.ToList();
result.Count = data.Count;
 
return result;

JavaScript filter function:
<script type="text/javascript">
                $("#Search").click(function (e) {
                    if ($('#txtFilterOmschrijving').val() != "" && $('#txtFilterOmschrijving').val() != $('#txtFilterOmschrijving').attr("defaultValue")) {
                        filterExpression = new Telerik.Web.UI.GridFilterExpression();
                        filterExpression.set_fieldName("Omschrijving");
                        filterExpression.set_columnUniqueName("Omschrijving");
                        filterExpression.set_dataTypeName("System.String");
                        filterExpression.set_filterFunction(Telerik.Web.UI.GridFilterFunction.Contains);
                        ItemIdentifier = $('#txtFilterOmschrijving').val();
                        filterExpression.set_fieldValue(ItemIdentifier);
 
                        vFilterExpressions.add(filterExpression);
                    }
                    tableView.rebind();
                    tableViewPlan.rebind();
                });
            </script>

The problem is that the filters are case sensitive. I tried setting the case sensitive option in groupsettings in the grid, but that has no effect. Does anyone have a solution?

Thanks in advance!
Tsvetina
Telerik team
 answered on 11 Sep 2012
4 answers
225 views
Hello,
I faced an issue in Find and Replace functionality.
This can be reproduced on RadEditor demo
1. Switch to HTML mode.
2. Press 'Find And Replace' button. Select 'Replace' tab.
3. Specify
  Find: <td>
  Replace with: <th>
4. Press Replace button.

<td> is replaced with &lt;th&gt;

Few more issues with Find&Replace:
'Replace All' does not seem to work at all.
When "find" string is not found it replace all the text.

Could you please reply if it can be fixed?
Vessy
Telerik team
 answered on 11 Sep 2012
1 answer
74 views
Hi,

we use HTML format for exporting to Excel.

In principle, we are ok with "pseudo-excel" format of file (HTML), except that popup warning about inconsistency of extension and actual format of the file and - as result of this? - inability to open it in GoogleDocs.

is it possible to fix somehow?
Daniel
Telerik team
 answered on 11 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?