Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
102 views
Hi All,

I'm looking for a sample application which implements ISpellCheckProvider; I'm planning to use it to customize the spell checker to validade a comma separated domain user list against ActiveDirectory.

I'm considering this problem similar to validade words against a static dictionary. That's the correct approach?
If yes, do you have an example of this implementation?

TIA,

Rubens
Rumen
Telerik team
 answered on 02 Jul 2009
2 answers
97 views
Hello,

this is my control code:

<telerik:raddatepicker ID="RadDatePicker1" Style="display" MinDate="2009-01-01" runat="server"
          Width="110px" Culture="es-ES" Calendar-CultureInfo="Spanish (Spain)" DateInput-Culture="es-ES" DateInput-DateFormat="dd/MM/yyyy" DateInput-DisplayDateFormat="dd/MM/yyyy">
          <Calendar ID="Calendar1" runat="server" CultureInfo="Spanish (Spain)" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"
            TitleStyle-CssClass="CalendarioBarraTitulo" FastNavigationStyle-CssClass="CalendarioBarraTitulo" CalendarTableStyle-VerticalAlign="NotSet"
            EnableViewState="False">
          </Calendar>
          <DateInput ID="DateInput1" runat="server" Culture="es-ES"  ReadOnly="False" DateFormat="dd/MM/yyyy" DisplayDateFormat="dd/MM/yyyy">
          </DateInput>
        </telerik:raddatepicker>

I have defined a culture and i want the control not to validate a date format that is correct in other culture but not in mine. For example, the format "MM/dd/yyyy" is wrong for my culture, so "21/12/2009" is a correct date and "12/21/2009" should not. But if I type "12/21/2009", the control accepts that date and changes it to "21/12/2009".

Is there a way to solve this problem?

Luis
Top achievements
Rank 1
 answered on 02 Jul 2009
2 answers
224 views
Hi,
Is it possible to trigger the popup of date or time selectors to pop-up from the codebehind?
Thanks
Holly
Top achievements
Rank 1
 answered on 02 Jul 2009
1 answer
117 views
Is it possible to use Rad Grid and its Insert/Update/Delete functionality such that the Insert/Update/Deletes done on the client side are only temporary and any changes (Insert/Update/Deletes) are not persisted to the server, e.g. to a database, until the user clicks a Submit button on the same page which contains the Grid? 
Princy
Top achievements
Rank 2
 answered on 02 Jul 2009
12 answers
388 views
Hi

We are trying to hook a toolbar through to an XML file that we are also using for Context Menus on a Rad Tree View as well.

To do this, we cant use the LoadContentFile method because the XML structure we are using is not the same as the expected structure for this control.  Instead, we are populating an XML Data Source with the XML and then binding the Toolbar to the Data Source.

When we trying to evaluate e.Button.DataItem in the ButtonDataBound event, .Net is reporting that the dataItem type is a System.Web.UI.WebControls.XmlDataSourceNodeDescriptor.

I've seen elsewhere in the forums that someone had a similar problem when trying to use LoadContentFile here but im wondering if this is a different spin on the same problem?

For your information, we are currently using Q1 2009 Bulid 527

Below is a cut down sample of what we are trying to do:

XML File
<?xml version="1.0" encoding="utf-8" ?> 
 
<Menu> 
 
  <Reports> 
    <Item Value="Preview" Text="Preview" ImageName="Preview" /> 
    <Item Value="Print" Text="Print" ImageName="Print" /> 
    <Item Value="Export" Text="Export" ImageName="Export">  
      <Item Value="ExportCSV" Text="CSV Format" ImageName="Export"  /> 
      <Item Value="ExportPDF" Text="PDF Format" ImageName="Export" /> 
    </Item> 
 
  </Reports> 
 
</Menu> 

Populate Toolbar
           Public Shared Function GetToolbar(ByVal Type As MenuType) As RadToolBar  
 
                Dim FilePath As String = "~/App_Data/Menus.xml" 
                Dim xPath As String = "/Menu/Reports/Item"
 
                Dim xmlMenu As New XmlDataSource  
                With xmlMenu  
                    .DataFile = FilePath 
                    .XPath = xPath 
                    .DataBind()  
                End With  
 
                tlb = New RadToolBar  
                With tlb  
                    .DataSource = xmlMenu 
                    .DataBind()  
                End With  
 
                Return tlb  
 
            End Function 

Button Data Bound Event
 
            Private Shared Sub tlb_ButtonDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarButtonEventArgs) Handles tlb.ButtonDataBound  
 
                With e.Button  
 
                    Dim element As XmlElement = DirectCast(.DataItem, XmlElement)  
 
                    If element.HasAttribute("Value") Then .Value = element.Attributes("Value").Value  
                    If element.HasAttribute("Text") Then .Text = element.Attributes("Text").Value
                    If element.HasAttribute("ImageName") Then .ImageUrl = GetImageURL(element.Attributes("ImageName").Value)
 
                End With  
 
            End Sub 

I hope I haven't missed something obvious!
Paul Mc
Top achievements
Rank 1
 answered on 02 Jul 2009
2 answers
259 views
I am getting a javascript error after setting up my RadScheduler on a new webserver.
The error is "Page_Validators is undefined"

The RadScheduler is loading two different javascript files. One through the "WebResource.axd" and one through "Telerik.Web.UI.WebResource.axd" (Something like _TSM_HiddenField_=RadScriptManager1_HiddenField&amp...)

The error ocurs in the second one.
The error ocurs in the line by my arrow under here.

_initializeAdvancedFormValidators:function(){
var _67=this._createValidatorToolTip();
if(!Page_Validators){ <====
return;
}
...


How is this possible? It is working fine locally. Do I need to set up something on the webserver?

Regards
Rune



Rune
Top achievements
Rank 2
 answered on 02 Jul 2009
1 answer
350 views
Hi,
I am currently converting a web application written in ASP.NET 1.1 and Infragistics into ASP.NET 2.0 and Telerik..
In the web application there is a grid with 4 columns:
1. Read only column (non editable)
2. Integer column (editable)
3. Double column (editable)
4. String column (editable)
and a submit button.
When the web page is displayed, the business object is loaded into the grid and displayed.
The editable columns Integer, Double and String will always be displayed in edit mode.
The following client validation will take place when the user enters any value on the editable columns:
1. The Integer column will only accept an integer value (within a valid range)
2. The Double column will only accept a double value (within a valid range)
3. The String column will accept a string value of a certain length (of a certain length)
When the user clicks the submit button, the following server processing will take place:
fetches each value on the grid and stores the value into the corresponding location on the business object.

Can you please tell me how to :
1. to perform the client validation as mentioned above, i.e.
    - the integer column will accept an integer value only (within a valid range)
    - the double column will accept a double value only (within a valid range)
    - the string column will accept a string value only (of a certain length)
2. to fetch the each value of the grid (iteratively) so that it can be stored into the business object?

Thanks & regards,
Herman Gouw
Skype: hermangouw


The source code for the web page is as follows:
ASPX:
=====
<form id="form1" runat="server">
<div>
    <telerik:RadScriptManager ID="radScriptManager" runat="server" />
    <telerik:RadGrid ID="radGrid" AutoGenerateColumns="false" AllowMultiRowEdit="true" AllowMultiRowSelection="true" GridLines="Vertical" OnNeedDataSource="radGrid_NeedDataSource" OnPreRender="radGrid_PreRender" runat="server">
     <ClientSettings>
            <Scrolling UseStaticHeaders="true" />
        </ClientSettings>
        <MasterTableView DataKeyNames="Read" EditMode="InPlace" TableLayout="Fixed">
            <Columns>
                <telerik:GridBoundColumn DataField="Read" DataType="System.String" HeaderText="Read Only" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ReadOnly="true" UniqueName="Read" />
                <telerik:GridBoundColumn DataField="Integer" DataFormatString="{0:N0}" DataType="System.Int32" HeaderText="Integer Only" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ReadOnly="false" UniqueName="Integer" />
                <telerik:GridBoundColumn DataField="Dbl" DataFormatString="{0:#,##0.#0}" DataType="System.Double" HeaderText="Double Only" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ReadOnly="false" UniqueName="Dbl" />
                <telerik:GridBoundColumn DataField="Str" DataType="System.String" HeaderText="String" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" ReadOnly="false" UniqueName="Str" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</div>
<div align="left">
    <asp:Button ID="button" OnClick="button_Click" Text="Submit" runat="server" />
</div>
</form>

ASPX.CS:
========
public partial class ClientGridEdit : System.Web.UI.Page
{
    private ArrayList _data = new ArrayList();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            this._data = (ArrayList)Session["DATA"];
        }
        else
        {
            this._data = Data.Load();
            Session["DATA"] = this._data;
        }
    }

    protected void radGrid_PreRender(object sender, System.EventArgs e)
    {
        foreach (GridDataItem item in this.radGrid.Items)
        {
            item.Edit = true;
        }
        this.radGrid.Rebind();
    }

    protected void radGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        this.radGrid.DataSource = this._data;
    }

    protected void button_Click(object sender, EventArgs e)
    {
        // To fetch the value entered in each grid and to store into the business object
    }
}
public class Data
{
    public string Read { get; set; }
    public int Integer { get; set; }
    public double Dbl { get; set; }
    public string Str { get; set; }

    public Data() : this(0, 0, 0.0, String.Empty) {}

    public Data(int read, int integer, double dbl, string str)
    {
        this.Read = ((DateTime)DateTime.Today).AddMinutes(240 + (30 * read)).ToString("HH:mm");
        this.Integer = integer;
        this.Dbl = dbl;
        this.Str = str;
    }

    public static ArrayList Load()
    {
        ArrayList arrayList = new ArrayList();
        for (int i = 1; i <= 6; i++)
        {
            arrayList.Add(new Data(i, 0, 0.00, String.Empty));
        }
        return arrayList;
    }
}
Tsvetoslav
Telerik team
 answered on 02 Jul 2009
1 answer
206 views
Hi,

I am using web user control (.ascx) in SharePoint Web part.
I am using two panels in web user control.
I have many controls in two panels.

I want to update some controls of second panel on event of contols in first panel and vice versa.

I also looked at the example given at 
http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/usercontrol/defaultcs.aspx
but, it not working.

Please help me.

ASCX CODE:

<%@ Control Language="C#" AutoEventWireup="true" Inherits="EIMS.RadTest, EIMS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2009.1.311.0, Culture=neutral, PublicKeyToken=29ac1a93ec063d92"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1">
    <Tabs>
        <telerik:RadTab Text="First" ID="RadTabFirst" runat="server" >
           
        </telerik:RadTab>
       
        <telerik:RadTab Text="Second" ID="RadTabSecond" runat="server" >
           
        </telerik:RadTab>
       
        <telerik:RadTab Text="Third" ID="RadTabThird" runat="server" >
           
        </telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server">
   
    <telerik:RadPageView ID="RadPageView1" runat="server" Selected="true">                
           
           
        <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" >
       
        <telerik:RadComboBox ID="RadComboBox1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged" >
            <Items>
                <telerik:RadComboBoxItem Text="Rajesh1" Value="1"/>
                <telerik:RadComboBoxItem Text="Rajesh2" Value="2"/>
                <telerik:RadComboBoxItem Text="Rajesh3" Value="3"/>
            </Items>
        </telerik:RadComboBox>
 <p/>
           
            <asp:Label ID="Lable1" runat="server" Text="Lable1"></asp:Label>
            <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
           
        </telerik:RadAjaxPanel>
    </telerik:RadPageView>
   
    <telerik:RadPageView ID="RadPageView2" runat="server">
       
        RadPageView2
       
    </telerik:RadPageView>
   
    <telerik:RadPageView ID="RadPageView3" runat="server">
    RadPageView3
       
    </telerik:RadPageView>
   
</telerik:RadMultiPage>

<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadComboBox1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />               
            </UpdatedControls>
        </telerik:AjaxSetting>       
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>


Code Behind:

 

using

System;

 

 

 

using

System.Collections.Generic;

 

 

 

using

System.Web;

 

 

 

using

System.Web.UI;

 

 

 

using

System.Web.UI.WebControls;

 

 

 

using

Telerik.Web.UI;

 

 

 

namespace

EIMS

 

{

 

public class RadTest : System.Web.UI.UserControl

 

 

 

{

 

protected RadTab RadTabSecond;

 

 

protected RadTab RadTabThird;

 

 

protected RadTab RadTabFirst;

 

 

protected Label Lable1;

 

 

protected Button Button1;

 

 

protected RadComboBox RadComboBox1;

 

 

 

protected RadAjaxManager RadAjaxManager1;

 

 

protected RadMultiPage RadMultiPage1;

 

 

 

protected RadPageView RadPageView1;

 

 

protected RadPageView RadPageView2;

 

 

protected RadPageView RadPageView3;

 

 

 

protected RadTabStrip RadTabStrip1;

 

 

protected RadAjaxManagerProxy AjaxManagerProxy1;

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

RadTabThird.Visible =

false;

 

RadTabSecond.Visible =

false;

 

}

 

protected void Button1_Click(object sender, EventArgs e)

 

{

Lable1.Text =

"in second panel";

 

RadComboBox1.Items.Add(

new Telerik.Web.UI.RadComboBoxItem(Convert.ToString("Rajesh" + (RadComboBox1.Items.Count + 1)), Convert.ToString(RadComboBox1.Items.Count + 1)));

 

}

 

protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)

 

{

Lable1.Text = RadComboBox1.Text;

RadTabThird.Visible =

true;

 

RadTabSecond.Visible =

true;

 

 

}

}

}

Web Part Code:

 

using

System;

 

 

 

 

using

System.Runtime.InteropServices;

 

 

 

 

using

System.Web.UI;

 

 

 

 

using

System.Web.UI.WebControls;

 

 

 

 

using

System.Web.UI.WebControls.WebParts;

 

 

 

 

using

System.Xml.Serialization;

 

 

 

 

using

Microsoft.SharePoint;

 

 

 

 

using

Microsoft.SharePoint.WebControls;

 

 

 

 

using

Microsoft.SharePoint.WebPartPages;

 

 

 

 

using

Telerik.Web.UI;

 

 

 

 

namespace

EIMS

 

{

[

Guid("2a14a7a4-4ef6-4b1a-b698-4d0f66719d34")]

 

 

public class RadPanelTest : System.Web.UI.WebControls.WebParts.WebPart

 

 

 

 

{

 

private Control _childControl = null;

 

 

private ScriptManager _AjaxManager;

 

 

private RadAjaxManager RadAjaxManager1;

 

 

public RadPanelTest()

 

{

}

 

protected override void OnInit(EventArgs e)

 

{

 

base.OnInit(e);

 

_AjaxManager =

ScriptManager.GetCurrent(this.Page);

 

 

if (_AjaxManager == null)

 

{

_AjaxManager =

new ScriptManager();

 

_AjaxManager.EnablePartialRendering =

true;

 

_AjaxManager.AsyncPostBackTimeout = 120;

Page.ClientScript.RegisterStartupScript(

typeof(RadPanelTest), this.ID, "_spOriginalFormAction = document.forms[0].action;", true);

 

 

if (this.Page.Form != null)

 

{

 

string formOnSubmitAtt = this.Page.Form.Attributes["onsubmit"];

 

 

if (!string.IsNullOrEmpty(formOnSubmitAtt) && formOnSubmitAtt == "return _spFormOnSubmitWrapper();")

 

{

 

this.Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();";

 

}

 

this.Page.Form.Controls.AddAt(0, _AjaxManager);

 

 

}

}

RadAjaxManager1 =

RadAjaxManager.GetCurrent(this.Page);

 

 

if (RadAjaxManager1 == null)

 

{

RadAjaxManager1 =

new RadAjaxManager();

 

 

this.Page.Form.Controls.AddAt(0, RadAjaxManager1);

 

}

}

 

protected override void CreateChildControls()

 

{

 

base.CreateChildControls();

 

_childControl = Page.LoadControl(

"/UserControl/RadTest.ascx");

 

 

if (_childControl != null)

 

Controls.AddAt(0, _childControl);

 

}

}

}

Georgi Krustev
Telerik team
 answered on 02 Jul 2009
1 answer
144 views
Since I can not add attachments? I will describe the issue. 
I am getting a javascript error when  attempting to select a CSS Class from the table wizard dialog. Debugging the javascript error leads to the ScriptResource.axd file with the error in bold below




if(null!=elem.style.cssText){
 elem.style.cssText = _300;
}
elem.setAttribute("style",_300);
elem.innerHTML=_302;
elem.style.visibility="visible";
Tervel
Telerik team
 answered on 02 Jul 2009
1 answer
85 views
I am using Ajax Q2 controls (beta) and when displaying a RadEditor inside of a MultiPage/Pageview set to 800 pixels (and the Editor is also set to 800 pixels), the editor displays at runtime at about 100 pixels wide. This problem occurs in IE, Chrome and Safari. Even though, the Safari and Chrome are the worst. Interestingly, I have a couple of instances where the Editors do appear with the correct width.

Actually, after some more testing I realize this this problem even exists in the designer, not just runtime. If the editor is set to resizable, you can stretch the width to the correct size, then it will not let you shrink it past the pixel width set in designer.

For some reason, I have one editor control that is not affected by this anomoly. Not sure why. I even tried copying and pasting the "good" control onto another page, thinking that maybe there was a property set differently, but the editor still does not render correctly.

Any ideas?
Tervel
Telerik team
 answered on 02 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?