Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
195 views
hello, i can't seem to get this working correctly.  Maybe you'll have more insight on this problem.
I have a user control which contains a button,label,and radwindow.  I then programmatically add this usercontrol to the main page.  I run the page and click on the button (which is set to open the window).  I have placed the javascript functions inside the usercontrol to call the ajax requests.  My goal is to make an ajax postback when the window opens, and another one when the window closes.  This all works fine when i'm not using a usercontrol and all the controls are placed within the main page,  But, when I place the controls inside the usercontrol, only the first ajax request triggers, and everything afterwards doesn't get called.
I have attached a simple scenerio which should help show you what i'm trying to accomplish:
1) usercontrol (ascx): contains a button, label, radwindow, and ajaxmanager (along with the js functions to call the requests)
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> 
       <script type="text/javascript"> 
           function onClose() { 
               $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("closed"); 
           } 
           function onOpen() { 
               $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("opened"); 
           } 
       </script> 
   </telerik:RadCodeBlock> 
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  
    onajaxrequest="RadAjaxManager1_AjaxRequest"> 
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> 
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="Label1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 
        
        <telerik:RadWindow ID="RadWindow1" runat="server" 
        OpenerElementID="<%# Button1.ClientID %>"  
        OnClientClose="onClose" OnClientShow="onOpen" 
        > 
         
        </telerik:RadWindow> 
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> 
        <asp:Button ID="Button1" runat="server" Text="Button" /> 
 

2) usercontrol (.cs):
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
public partial class WebUserControl : System.Web.UI.UserControl 
{ 
    protected void Page_Load(object sender, EventArgs e) 
    { 
 
    } 
 
    protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) 
    { 
        switch (e.Argument) 
        { 
            case "closed": 
                Label1.Text = "Closed"; 
                break; 
            case "opened": 
                Label1.Text = "Opened"; 
                break; 
        } 
    } 
} 
 
2) main aspx/cs page (with MasterPage): programmatically loads the usercontrol onto the content page.
Content Page (aspx): 
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> 
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 
<asp:PlaceHolder ID="holder" runat="server"></asp:PlaceHolder> 
</asp:Content> 
 
Content Page (.cs): 
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
public partial class _Default : System.Web.UI.Page 
{ 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        Control ucControl = LoadControl("~/WebUserControl.ascx"); 
        ucControl.ID = "MyUserControl"; 
        holder.Controls.Add(ucControl); 
    } 
} 

What I've been trying to accomplish:
When I open the window, that should trigger an ajax request (which works).  And, when I close the window, that should trigger another ajax request (doesn't work).  I am passing arguments as well.  For simplicity, I've placed a label that outputs if the window has been opened or closed.  I actually just want to rebind a list when the window closes.  It seems to only work for the first ajax request, and not any more afterwards.

Thanks for your help,
Iana Tsolova
Telerik team
 answered on 11 Feb 2010
1 answer
162 views
I have a grid with an edit column and have the edit for set to popup.  When edit is clicked and the window pops open, the html edit fields are not displaying correctly.  The row with the design/html/preview is in the middle of the window and the content of the field isn't displayed.  If HTML is selected the text appears.  When design is clicked, it stay and looks as I would expect.  But it doesn't look right and isn't editable when it is opened.  The first attachment is before clicking html, then design.  The second isafter clicking the sequence.  Any ideas what is going on with this?  I have the most recent service patch of DLLs.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="adminnomaster.aspx.vb" Inherits="Test_adminnomaster" %> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"> 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
    </telerik:RadScriptManager> 
    <div> 
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"  
        AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"  
        DataSourceID="AccessDataSource" GridLines="None" Skin="Hay"  
        AllowAutomaticUpdates="True" 
        AllowAutomaticinserts="True" 
        AllowAutomaticDeletes="True"  
        AutoGenerateColumns="False"> 
        <MasterTableView datakeynames="EventID" EditMode="popup"  
            datasourceid="AccessDataSource" 
            AllowAutomaticUpdates="true" 
            AllowAutomaticinserts="true" 
            AllowAutomaticDeletes="true"  
            > 
<EditFormSettings InsertCaption="Add new item" CaptionFormatString="Edit ProductID: {0}" 
                CaptionDataField="ProductID" PopUpSettings-Modal="true" > 
                <PopUpSettings width="700" /> 
                </EditFormSettings> 
                 
                 
 
            <EditFormSettings InsertCaption="Add new item"  
                CaptionFormatString="Edit Event: {0}" 
                CaptionDataField="EventID" PopUpSettings-Modal="True" > 
<PopUpSettings Modal="True"></PopUpSettings> 
            </EditFormSettings> 
 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridBoundColumn DataField="EventID" DataType="System.Int32"  
                    HeaderText="EventID" ReadOnly="True" SortExpression="EventID"  
                    UniqueName="EventID"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="EventName" HeaderText="EventName"  
                    SortExpression="EventName" UniqueName="EventName"> 
                </telerik:GridBoundColumn> 
                <telerik:GridHTMLEditorColumn DataField="EventDescription"  
                    HeaderText="Description" UniqueName="EventDescription"> 
                </telerik:GridHTMLEditorColumn> 
                <telerik:GridDateTimeColumn DataField="EventDate" HeaderText="Date"  
                    UniqueName="EventDate"> 
                </telerik:GridDateTimeColumn> 
                <telerik:GridDateTimeColumn DataField="EventStartTime" HeaderText="Start Time"  
                    MinDate="1899-01-29" PickerType="TimePicker" UniqueName="EventStartTime"> 
                </telerik:GridDateTimeColumn> 
                <telerik:GridDateTimeColumn DataField="EventEndTime" HeaderText="End Time"  
                    MinDate="1800-01-01" PickerType="TimePicker" UniqueName="EventEndTime"> 
                </telerik:GridDateTimeColumn> 
                <telerik:GridHTMLEditorColumn DataField="EventLocation" HeaderText="Location"  
                    UniqueName="EventLocation"> 
                </telerik:GridHTMLEditorColumn> 
            </Columns> 
        </MasterTableView> 
    </telerik:RadGrid> 
    <asp:AccessDataSource ID="AccessDataSource" runat="server"  
        DataFile="~/App_Data/Events.mdb"  
        DeleteCommand="DELETE FROM [tbEvents] WHERE [EventID] = ?"  
        InsertCommand="INSERT INTO [tbEvents] ([EventID], [EventName], [EventDescription], [EventDate], [EventStartTime], [EventEndTime], [EventLocation]) VALUES (?, ?, ?, ?, ?, ?, ?)"  
        SelectCommand="SELECT * FROM [tbEvents] ORDER BY [EventDate] DESC"  
        UpdateCommand="UPDATE [tbEvents] SET [EventName] = ?, [EventDescription] = ?, [EventDate] = ?, [EventStartTime] = ?, [EventEndTime] = ?, [EventLocation] = ? WHERE [EventID] = ?"> 
        <DeleteParameters> 
            <asp:Parameter Name="EventID" Type="Int32" /> 
        </DeleteParameters> 
        <UpdateParameters> 
            <asp:Parameter Name="EventName" Type="String" /> 
            <asp:Parameter Name="EventDescription" Type="String" /> 
            <asp:Parameter Name="EventDate" Type="DateTime" /> 
            <asp:Parameter Name="EventStartTime" Type="DateTime" /> 
            <asp:Parameter Name="EventEndTime" Type="DateTime" /> 
            <asp:Parameter Name="EventLocation" Type="String" /> 
            <asp:Parameter Name="EventID" Type="Int32" /> 
        </UpdateParameters> 
        <InsertParameters> 
            <asp:Parameter Name="EventID" Type="Int32" /> 
            <asp:Parameter Name="EventName" Type="String" /> 
            <asp:Parameter Name="EventDescription" Type="String" /> 
            <asp:Parameter Name="EventDate" Type="DateTime" /> 
            <asp:Parameter Name="EventStartTime" Type="DateTime" /> 
            <asp:Parameter Name="EventEndTime" Type="DateTime" /> 
            <asp:Parameter Name="EventLocation" Type="String" /> 
        </InsertParameters> 
    </asp:AccessDataSource> 
     
    </div> 
    <telerik:RadAjaxManager runat="server"> 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadGrid1"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    </form> 
</body> 
</html> 
 

Daniel
Telerik team
 answered on 11 Feb 2010
1 answer
167 views
I'm using the built-in advanced edit forms created by the Scheduler control. I am using SqlDataSource controls for my resources and for scheduler insert/update/deletes. I have one resource where I would like the user to be able to enter a custom value, while also being able to select from existing items (i.e. The resource is a list of buyers. I want them to be able to enter a new buyer and save the task with the newly created buyer).

I've made the RadComboBox control for the Buyer list to allow custom text and I handle the AppointmentCommand event checking if an insert/update command was raised and I then check if it's a new buyer and save it. I then add the new buyer to the list and select it.

Like so:
Protected Sub rsTasksNew_AppointmentCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.AppointmentCommandEventArgs) Handles rsTasksNew.AppointmentCommand 
        Try 
            'check if insert command 
            If e.CommandName = "Insert" Or e.CommandName = "Update" Then 
                Dim ddlBuyer As RadComboBox = CType(e.Container.FindControl("ResAssigned-To"), RadComboBox) 
                'check for existing buyer with same name and set them as the selected index 
                ddlBuyer.SelectedIndex = ddlBuyer.FindItemIndexByText(ddlBuyer.Text.Trim(), True) 
 
                'hold buyer id 
                Dim BuyerId As Integer = IIf(ddlBuyer.SelectedIndex > -1, ddlBuyer.SelectedValue, 0) 
 
                'if new buyer being entered 
                If BuyerId = 0 Then 
                    'save new buyer 
                    BuyerId = SaveBuyer(ddlBuyer.Text.Trim(), Session(SessionVariables.Cur_Client_ID)) 
 
                    'add buyer to list and set as selected 
                    ddlBuyer.Items.Add(New RadComboBoxItem(ddlBuyer.Text, BuyerId)) 
                    ddlBuyer.SelectedValue = BuyerId 
                End If 
            End If 
        Catch ex As Exception 
 
        End Try 
    End Sub 
 
This isn't working for some reason. It keeps throwing this error:
Server Error in '/GoRentPro' Application. 
 
Invalid length for a Base-64 char array. 
 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.  
 
Exception Details: System.FormatException: Invalid length for a Base-64 char array. 
 
Source Error:  
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
 
Stack Trace:  
 
 
[FormatException: Invalid length for a Base-64 char array.] 
   System.Convert.FromBase64String(String s) +0 
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +72 
   System.Web.UI.LosFormatter.Deserialize(String input) +11 
   Telerik.Web.UI.AdvancedTemplate.ExtractResourceValues(IDictionary target) +598 
   Telerik.Web.UI.AdvancedTemplate.ExtractValues(Control container) +362 
   Telerik.Web.UI.RadScheduler.InsertAppointmentInline() +34 
   Telerik.Web.UI.RadScheduler.OnBubbleEvent(Object source, EventArgs args) +326 
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37 
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118 
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135 
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175 
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 
 
Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016 

If you could tell if this even possible to do or if I'm doing it wrong. I am using the latest version of the controls, 2010.3.1314.

Thanks.
Peter
Telerik team
 answered on 11 Feb 2010
6 answers
151 views
Hi everyone,

I have this problem while scrolling down the web page.
combo box will seperate with combo box item.
I want to upload the screen shot but attach file not support .bmp format.
Thank you for any reply to guide me.


Best regards,
Nasri
Arteta Sam
Top achievements
Rank 1
 answered on 11 Feb 2010
3 answers
193 views
Hello,

I have a webpage with a radTabStrip in it which is fully wrapped by an ajax panel.  What I want is for the whole tab strip to do its partial postbacks using that ajax except for the last tab.  If the user clicks on that specific tab, I do not want the ajax to kick in, rather I want to do a full postback and then load that last time.

Using the article found here (http://www.telerik.com/help/aspnet-ajax/ajxexclude.html) I was able to make a button that is displayed on my second last tab to be excluded from the ajax (that button is a "Next" button which correctly calls for a full postback and then the final tab and its info is loaded).  I tried applying the same principle to the tab itself when it gets clicked, but when I debug I can clearly see that the ajax panel kicks in because I can then see the loading panel for a split second and then when the page is done processing, I am looking at the same thing I was before. Neither the tab or the content changes.

Here is the code I used to try to have my tab menu item excluded from the ajax panel:
tabScheduleQueryWizard.Tabs[13].Attributes.Add("onclick", string.Format("realPostBack(\"{0}\", \"\"); return false;", tabScheduleQueryWizard.Tabs[13].UniqueID));

And this is the code I have for the previously described button which works as desired:
btnNextCriteria.Attributes.Add("onclick", string.Format("realPostBack(\"{0}\", \"\"); return false;", btnNextCriteria.UniqueID));

Any ideas?

Yana
Telerik team
 answered on 11 Feb 2010
3 answers
283 views
Hi
I have installed RadControls for ASP.NET AJAX Q3 2009 and also addred reference to the project solution 'Telerik.Web.UI.dll' version 2009.3.1314.35. I can see my controls in design view. I can build and debug the solution to run it fiine.

In the source code ,while I type <te I should be viewing the drop down to list Telerik controls,which I cant view.
Also I get the following warning.

Element 'RadAjaxLoadingPanel' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.

I have my solution in C:\Data\VS8\Source Code\StaffNet. My web.config file is in the right place.

Can you please suggest?

Thank you in advance.
Suchi
Pavlina
Telerik team
 answered on 11 Feb 2010
2 answers
242 views
I have a bar chart that I have dynamically (programatically) bound to a hash table. The binding works ok, but it is putting the Key on the Y axis and the Item on the X axis. Does anyone know how I can reverse the axis?
Velin
Telerik team
 answered on 11 Feb 2010
1 answer
184 views
I would like to be able to dynamically hide and show dock titlebars from client javascript.  Is there any way that I can accomplish this?

Thanks,
--nick
Pero
Telerik team
 answered on 11 Feb 2010
2 answers
156 views

Hi,

 

I am using RadScheduler in my project to display events. I have to display two events per day in month view and I have set VisibleAppointmentsPerDay property to 2 for the same. Now if any day in month has more than two events then it should show it in format +<No. of additional events> more.

e.g. +2more.

RadScheduler has property called ShowMore, but all the days in month shared this property i.e, if I set this property then the text is same accross all the days in month. Is there any way to customize this property, so that it should show different text for different days in month?

Thanks...

Amit Vaidya
Top achievements
Rank 1
 answered on 11 Feb 2010
1 answer
199 views
radopen() function does't work..
undefined is null or not an object 
but when i call the same function in button's onclientclick it works..plz help me...
thx.

<form id="form1" runat="server">
    <div>
        <telerik:radscriptmanager id="RadScriptManager1" runat="server"></telerik:radscriptmanager>
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" OnClientClick="check();" />
        <telerik:radwindowmanager id="RadWindowManager1" runat="server">
        <Windows>
      
        </Windows>
        </telerik:radwindowmanager>
    <telerik:RadScriptBlock ID="scrblk" runat="server">
    <script type="text/javascript">

function check()
{
alert("check");
radopen("www.google.com","win1");
}

</script>
    </telerik:RadScriptBlock>
        <asp:Timer ID="Timer1" runat="server" Interval="3000" OnTick="Timer1_Tick">
        </asp:Timer>
    </div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        </asp:UpdatePanel>
    </form>

 protected void Button1_Click(object sender, EventArgs e)
    {
         string s = "check();";
         RadScriptManager.RegisterStartupScript(this, this.GetType(), "s", s, true);
        
    }


Georgi Tunev
Telerik team
 answered on 11 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?