Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
305 views
Hi,

I need to open my site in Iframe where domain of my site and parent site is different.
i'm getting access denied cross domain error which is obvious ,but when i'm opening RAD Demo site in IFrame its working fine.
There must be some extra configuration you guys have done in your demo site which makes it working fine in different domains. please let me know the same so that i can add that in my site

i have gone through with the following link
Access Denied - Scripting Error
http://www.telerik.com/community/forums/aspnet-ajax/combobox/access-denied-scripting-error.aspx

also
How to work around the access denied cross-domain frame issue in ASP.NET Ajax 1.0

http://weblogs.asp.net/bleroy/archive/2007/01/31/how-to-work-around-the-quot-access-denied-quot-cross-domain-frame-issue-in-asp-net-ajax-1-0.aspx

But i can't use the above solution as it requires me to replace the RadScriptManager's with the normal ScriptManager
which is not possible in our case as Rad Color Picker is not working properly with normal script manager
also in RAD Demo site you have used RadScriptManger.

I'm attaching sample code i'm using





Veenu
Top achievements
Rank 1
 answered on 28 Jan 2010
8 answers
375 views
Hi,

I'm using the regular Rad Calendar.  I default the selected date to today when my page loads.  Is there a way to not allow the user to unselect a date in the calendar so nothing is selected so I don't have to put in extra validation.
Daniel
Telerik team
 answered on 28 Jan 2010
1 answer
95 views
Hi,

I've created a SharePoint web part for WSS 3.0 that displays a panel bar similar to one i created in an aspx page.  The problem I'm having is that after I've registered a client script block, the script I was using previously to capture what panel was selected, and then close all the others no longer works.  Previously I had the script triggered using OnClientItemClicked on the client side in the aspx page.  Since web parts are only server side, I've added an attribute to the RadPanelbar of onclick to trigger the script below.  Does anyone know why the script below doesn't work?
<script> 
    function onclick(sender, args) {  
        var selectedtext = args.get_item().get_text();  
          
        var panelBar = $find("<%= RadPanelBar1.ClientID %>");  
        //close all other panels when item is clicked  
        var panelItem = panelBar.findItemByText("panel1");  
        panelItem.collapse();  
        panelItem.blur();  
      
        panelItem = panelBar.findItemByText("panel2");  
        panelItem.collapse();  
        panelItem.blur();  
          
        panelItem = panelBar.findItemByText("panel3");  
        panelItem.collapse();  
        panelItem.blur();  
          
        panelItem = panelBar.findItemByText("panel4");  
        panelItem.collapse();  
        panelItem.blur();  
                  
        panelItem = panelBar.findItemByText(selectedtext);  
        panelItem.expand();  
        panelItem.focus();  
        }                         
</script> 
 
Thanks!
Veselin Vasilev
Telerik team
 answered on 28 Jan 2010
2 answers
181 views
Hi all!
I am developing a Required Field Validator for a RadCombobox. The RadCombobox appears when I am modifying an item of a RadGrid, so when the CreateColumnEditor event fires.
My problem is: when I add a new item to my table, there a re no problem, while when I am editing ad existing item the value of the RadComboBox is not taken, so it gives a database exception of violation of integrity contraints.
Here there is the most significative part of my class.
When debugging I can see that the value of the radcomboboxes are wrong, even if the right item is selected.
The validation is done clientside with a javascript, because the RequiredFieldValidator wasn't working (could you please explain me why it wan't? It is in the commented code).

public class ComboEditor : GridDropDownListColumnEditor
{
    private RadComboBox combo;
    private String _datafield;
    private bool _mandatory;
    private bool _enableChange;
    private Unit _width;
    //private RequiredFieldValidator _reqValidator;
    private CustomValidator _reqValidator;

    public ComboEditor(GridDropDownColumn owner, bool mandatory, String datafield, bool enableChange, Unit width)
        : base(owner)
    {
        this._datafield = datafield;
        this._mandatory = mandatory;
        this._enableChange = enableChange;
        this._width = width;
    }


    public RadComboBox ComboControl
    {
        get
            return base.ComboBoxControl;
    }

    [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public override int SelectedIndex
    {
        get
            return base.SelectedIndex;
        set
            base.SelectedIndex = value;
    }

    [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public override string SelectedValue
    {
        get
            return base.SelectedValue;
        set
            base.SelectedValue = value;
    }

    [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public override string SelectedText
    {
        get
            return base.SelectedText;
        set
            base.SelectedText = value;
    }

    protected override void LoadControlsFromContainer()
    {
        this.combo = this.ContainerControl.Controls[0] as RadComboBox;
    }

    protected override void AddControlsToContainer()
    {
        HtmlGenericControl divCombo = new HtmlGenericControl("DIV");
        divCombo.Attributes.Add("style", "padding-bottom: 3px;");

        if (this.ContainerControl.Parent != null)
        {
            foreach (GridTableRow row in this.ContainerControl.Parent.Parent.Controls)
                (row.Controls[0] as GridEditFormItem.EditFormTableCell).VerticalAlign = VerticalAlign.Top;
        }

        this.combo.NoWrap = false;
        this.combo.MarkFirstMatch = true;
        this.combo.AllowCustomText = false;
        this.combo.Skin = "WebBlue";
        this.combo.CausesValidation = true;
        this.combo.Width = this._width;
        this.combo.ToolTip = "Select " + this._datafield + "...";
        this.combo.ID = "cmb" + this._datafield.Replace(" ", "");
        divCombo.Controls.Add(this.combo);
        this.ContainerControl.Controls.Add(divCombo);

        if (this._mandatory)
        {
            this._reqValidator = new CustomValidator();
            this._reqValidator.ID = "req" + this._datafield.Replace(" ", "");
            this._reqValidator.ErrorMessage = "  This field is required.";
            this._reqValidator.ControlToValidate = this.combo.ID;
            this._reqValidator.ClientValidationFunction = "ValidateComboBox";
            this._reqValidator.EnableClientScript = true;
            this.ContainerControl.Controls.Add(this._reqValidator);
            
            /*this._reqValidator = new RequiredFieldValidator();
            this._reqValidator.ID = "pippo";
            this._reqValidator.ErrorMessage = "This field is required.";
            this._reqValidator.ControlToValidate = this.combo.ID;
            this._reqValidator.InitialValue = "";
            this.ContainerControl.Controls.Add(this._reqValidator);  */
        }       
    }

    protected override void CreateControls()
    {
        base.CreateControls();
        base.ControlsCreated = true;
        this.combo = base.ComboBoxControl;
    }

}
Dario Zanelli
Top achievements
Rank 1
 answered on 28 Jan 2010
1 answer
99 views
When I create a new VB.NET Website using Telerik template, the following error thrown:
-----------------
Error: this template attempted to load an untrusted component 'Telerik.Web.UI.VSX, Version=2009.03.1313.0, Culture=neutral, PublicKeyToken=0dfdc51bd06071b4'. For more information on this problem and how to enable this template, please see documentation on Customizing Project Templates.
-----------------
RadControls version is 2009.3.1314
Erjan Gavalji
Telerik team
 answered on 28 Jan 2010
3 answers
189 views
My code as I see it is exactly the same as the demo explaining this (I think).
Hope someone can find out why mt Radtree is not displaying any data.

This is my code:

    <telerik:RadTreeView ID="RadTreeView1" runat="server" Width="100%" Height="250px" 
          DataFieldID="code" DataFieldParentID="parentcode" 
        DataTextField="absencereasonname" DataValueField="code"   
        DataSourceID="LinqDataSource1">  
        <DataBindings> 
            <telerik:RadTreeNodeBinding Depth="0" Expanded="true" /> 
        </DataBindings> 
    </telerik:RadTreeView> 
    <asp:LinqDataSource ID="LinqDataSource1" runat="server"    
        ContextTypeName="Orbit.Benjamin.DB.PartyDataContext"   
        TableName="AbsenceReasons"   
        Select="new (code, absencereasonname, parentcode)">  
    </asp:LinqDataSource> 
 

and this is my DB table structure

    [code] [nvarchar](10) NOT NULL,  
    [absencereasonname] [nvarchar](100) NULL,  
    [parentcode] [nvarchar](10) NULL, 

I am calling DataBind() on PageLoad but my tree returns with 0 nodes.
This looks simple enough but I can not find out what I am doing wrong.

reg.
Axel
Axel
Top achievements
Rank 2
 answered on 28 Jan 2010
4 answers
353 views
When searching, I was able to find this http://www.telerik.com/community/forums/aspnet-ajax/grid/time-calculation-in-rad-grid.aspx

This is the solution I had initially implemented on my own, however i've since changed the format string and it can no longer be readily parsed by using DateTime.Parse().

Rather than doing some obscure string manipulation I'm wondering how I can access the raw data used when filling a specific cell. To clarify, I want to be able to access the data source used to build the cell, having only the GridDataItem to start.

Martin
Telerik team
 answered on 28 Jan 2010
1 answer
79 views
I am trying to figure out how to make my RadTreeView update after one of its RadTreeViewContextMenu in clicked. I have tried adding the control to the RadAjaxManager:

            <telerik:AjaxSetting AjaxControlID="treeGroupsContextMenu"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="treeGroups" LoadingPanelID="LoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting>   

That's doesn't work.. I have also looked for a AutoPostback property and see none. How can i accomplish this?

Duncan


Vesko
Top achievements
Rank 2
 answered on 28 Jan 2010
4 answers
157 views
hi please see attachment, here i used checkbox column where the check box is checked by default when ther is no records in the grid. please help to remove the default check.

<telerik:GridClientSelectColumn UniqueName="CheckboxSelectColumn" HeaderStyle-HorizontalAlign="Center" 
                                HeaderStyle-Width="25px" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="Center" 
                                HeaderStyle-CssClass="radgridleftmostColumn" HeaderStyle-VerticalAlign="Middle" /> 
Saran kumar
Top achievements
Rank 1
 answered on 28 Jan 2010
13 answers
149 views
Have a problem with the context menu on the radmenucontrol
The contextmenu works fine but here is the scenario

MENU ITEM 1         MENU ITEM 2              MENU ITEM 3
                                   - SUBMENU ITEM 2-1        -SUBMENU ITEM 3-1
                                                                                             - SUBMENU ITEM 3-2

Ok, the context menu will work on the lowerst item in the tree
In this case it will work on
- MENU ITEM 1
- SUBMENU ITEM 2-1
- SUBMENU ITEM 3-2

But all other items the context menu is disabled for some reason.

Here is the code.
ASPX :
<telerik:RadContextMenu ID="RadContextTopMenu" runat="server" OnClientShowing="topmenuShowing" OnItemClick="RadTopMenu1_ItemClick" Skin="Windows7">  
   <Items> 
       <telerik:RadMenuItem runat="server" Text="Menupagina toevoegen">  
       </telerik:RadMenuItem> 
       <telerik:RadMenuItem runat="server" Text="SubPagina Toevoegen">  
       </telerik:RadMenuItem> 
       <telerik:RadMenuItem runat="server" Text="Pagina Wijzigen">  
       </telerik:RadMenuItem> 
       <telerik:RadMenuItem runat="server" Text="Pagina Verwijderen">  
       </telerik:RadMenuItem> 
   </Items> 
   <Targets> 
       <telerik:ContextMenuControlTarget ControlID="RadTopMenu1" /> 
   </Targets> 
</telerik:RadContextMenu>   
 
<telerik:RadScriptBlock runat="server" ID="RadScriptBlock2">  
 
    <script type="text/javascript">  
        function topmenuShowing(sender, args) {  
            var target = args.get_targetElement();  
            if (target.className != "rmText") {  
                args.set_cancel(true);  
            }  
            else {  
                var panelBarItem = $find("<%=RadTopMenu1.ClientID %>").findItemByText(target.innerHTML);  
                sender.trackChanges();  
                sender.get_items().getItem(0).get_attributes().setAttribute("mItem", panelBarItem.get_attributes().getAttribute("PageID"));  
                sender.commitChanges();  
            }  
            sender.hide();  
        }  
   
    </script> 
 
</telerik:RadScriptBlock> 
 <telerik:RadWindowManager ID="topMenuradwindow" EnableViewState="false" runat="server" Skin="Windows7">  
</telerik:RadWindowManager>      
 
<telerik:RadMenu ID="RadTopMenu1" runat="server" OnItemClick="Click" Style="z-index: 2;" /> 
  

VB, just for info but this works
Protected Sub RadTopMenu1_ItemClick(ByVal sender As ObjectByVal e As RadMenuEventArgs)  
       Private Sub BindToDataSet()  
 
        Dim adapter As New SqlDataAdapter("SELECT * FROM TblPages where MenuID = " + MenuIDvalue, _  
            ConfigurationManager.ConnectionStrings("Varodb").ConnectionString)  
 
        Dim Menu As New DataSet()  
 
        adapter.Fill(Menu)  
        RadTopMenu1.DataTextField = "Pagename" 
        RadTopMenu1.DataFieldID = "ID" 
        RadTopMenu1.DataFieldParentID = "PageID" 
 
        RadTopMenu1.DataSource = Menu  
        RadTopMenu1.DataBind()  
    End Sub 
 
 Protected Sub RadMenu1_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadMenuEventArgs) Handles RadTopMenu1.ItemDataBound  
        Dim dataRow As DataRowView = DirectCast(e.Item.DataItem, DataRowView)  
        e.Item.Attributes("PageID") = dataRow("ID").ToString()  
    End Sub 
 
        Dim MenuitemValue As String = RadContextTopMenu.Items(0).Attributes("mItem").ToString()  
 
        Select Case e.Item.Text  
            Case "Menupagina toevoegen" 
 
              'some code  
            Case "SubPagina Toevoegen" 
 
                'some code  
                Exit Select 
 
            Case "Pagina Wijzigen" 
 
               'some code  
 
                Exit Select 
 
 
            Case "Pagina Verwijderen" 
 
                'some code  
                Exit Select 
 
        End Select 
 
 
    End Sub 


But i think there is something wrong with this line :

sender.get_items().getItem(0).get_attributes().setAttribute(

"mItem", panelBarItem.get_attributes().getAttribute("PageID"));

Anyone has an idea ?

 

Veselin Vasilev
Telerik team
 answered on 28 Jan 2010
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?