Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
246 views
Hello people,

I have a proble regarding RadAjaxManager.
I am using 2 RadComboBoxes on a page. The first one loads Locations and the second one loads Events. I use the SelectedIndexChange Event to fill the events comboBox with event according to the selected location and vice versa. ALthough I am using RAdAjaxManager, I am getting a full postback when I select either a location or an event. I should mention that I am using a master page where I have the RadScriptManager. Here is my code:

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<telerik:RadAjaxManager runat="server" id="RadAjaxManager1">
         <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="pnlSearchBox" >
                <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="pnlSearchBox"  LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
            </telerik:AjaxSetting>
         </AjaxSettings>
            <AjaxSettings >
                <telerik:AjaxSetting AjaxControlID="pnlScheduler" >
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="pnlScheduler" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
          <telerik:RadAjaxLoadingPanel id="RadAjaxLoadingPanel1" runat="server" transparency="60" Height="950px"
                    backcolor="White">
                     <br /><br /><br /><br /><br /><br /><br />
                <asp:Image ID="loadingPicture" runat="server" ImageUrl="../App_Themes/myOBIS/picts/loading.gif" />
        </telerik:RadAjaxLoadingPanel>
.
.
.
.
.
 <asp:Panel ID="pnlSearchBox" runat="server">
    <asp:Label ID="lblStandorte" runat="server" Text="<%$ Resources:GlobalLocalization, Standort_%>" />
    <telerik:RadComboBox ID="rcbLocations" runat="server"  AutoPostBack="true"
           EnableEmbeddedSkins="false" Skin="myOBIS" DataTextField="LocationName" DataValueField="LocationId"
                CssClass="field_long" onselectedindexchanged="Locations_SelectedIndexChange" ></telerik:RadComboBox>                                              
 <asp:Label ID="lblProdukte" runat="server" Text="<%$ Resources:GlobalLocalization, Produkt_%>" />
   <telerik:RadComboBox ID="rcbProducts" runat="server"  DataTextField="InternalProductName" DataValueField="ProductId"  EnableEmbeddedSkins="false" Skin="myOBIS"   CssClass="field_long" AutoPostBack="true"
    onselectedindexchanged="Products_SelectedIndexChange" ></telerik:RadComboBox>                                                  
          <asp:Panel/>  
                                              
...

I have also tried to put the locations ComboBox directly as AjaxControlId and updating the Events ComboBox directly but still I get a full postback. I am using the AjaxManager in almost all pages of our Business Application but it doesn't seem to work.
I'd be glad to get some help
Tsvetina
Telerik team
 answered on 02 Feb 2011
3 answers
78 views
I saw the demo from this link http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/clienteditbatchupdates/defaultcs.aspx that user can double click on the RadGridView cells to edit them. I tried to learn from the sample code to create the grid for cell editing, but it is not working.  See the code below.  What did I miss?  Thanks.

<telerik:RadGrid ID="DistributorRadGrid" runat="server" GridLines="Both" >
                <MasterTableView EditMode="InPlace" >
                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
  
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
  
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
  
                <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                </EditFormSettings>
                </MasterTableView>
  
                <FilterMenu EnableImageSprites="False"></FilterMenu>
  
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
            </telerik:RadGrid>

var varDistributors =
                 from d in MORContext.GetTable<Distributor>()
                 where (d.Active == true && d.Distributor_Type_id == 1 )
                 orderby d.Distributor_Name
                 select new {  Distributor_Name = d.Distributor_Name, 
                               DistributorID = d.Destributor_ID };
Tsvetina
Telerik team
 answered on 02 Feb 2011
1 answer
73 views
I have a RadTreeView where I enabled Drag and Drop using ClientSettings.  The RadTreeView uses a NodeTemplate, and within each node template I have a RadGrid with the idea of dragging a row from one grid to a grid in another node.  When I attempt to drag a RadGrid row, its also attempting to drag a RadTreeView node, is there anyway to prevent this?  

Thanks,
Neil
Pavlina
Telerik team
 answered on 02 Feb 2011
8 answers
379 views
Hi All,

Am facing the problem with ajax implementation in Telerik Rad Grid.

In my page i implement RadAjaxmanager and RadAjaxPanel and RadGrid. Inside RadGrid. I want to edit details so am using EditFormSettings to edit details. In this EditFormSettings am calling a user control form.

My problem is, i dont want to allow unsafe script inside my edit form.
  1. So i turn on in web config file <%@ page Validate Request=True %>
  2.  If user enters unsafe script in any text box am catching exception in my Global application_error event and redirecting to another normal aspx page.
  3. if i use RadGrid and Update details i use  <EditFormSettings UserControlName="~/editform.ascx" EditFormType="WebUserControl" >. And i type any unsafe script message "<b>example</b>" inside the textbox.
    Error was capturing in Global.aspx file, But not redirecting to Error page and throwing a javasscript error


Codes am using

  1. My Web config code :
    <pages validateRequest="true"
    My Global File Code :
    Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)  
            Dim ex As Exception = Server.GetLastError().GetBaseException()  
     
            If Not (ex.GetType Is GetType(HttpException)) Then  
                  
                If ex.Message.ToLower.Contains("a potentially dangerous request.form value was detected from the client") Then  
                    Try  
                        My.Log.WriteEntry("Global Error MESSAGE: " & ex.Message & "SOURCE: " & ex.Source & "STACKTRACE: " & ex.StackTrace, EventLogEntryType.Error)  
                    Catch ex1 As Exception  
                        My.Log.WriteEntry("Write event log got problem: " & ex1.Message, EventLogEntryType.Error)  
                    End Try  
                    Server.Transfer("~/UnsafeScriptErrorPage.aspx?returnURL=" & Server.UrlEncode(HttpContext.Current.Request.Url.ToString))  
                  
                ElseIf ex.Message.Trim.ToString <> "" Then  
                    Try  
                        My.Log.WriteEntry("Global Error MESSAGE: " & ex.Message & "SOURCE: " & ex.Source & "STACKTRACE: " & ex.StackTrace, EventLogEntryType.Error, False)  
                    Catch ex1 As Exception  
                        My.Log.WriteEntry("Write event log got problem: " & ex1.Message, EventLogEntryType.Error)  
                    End Try  
                    Server.Transfer("~/GenericErrorPage.aspx?errMsg=" & ex.Message & "&returnURL=" & Server.UrlEncode(HttpContext.Current.Request.Url.ToString), False)  
                End If  
                              
            End If  
              
            Server.ClearError()  
                End Sub 

    My First ASPX Code
  2. <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" 
        CodeFile="Inbox.aspx.vb" Inherits="Inbox" Title="Inbox" %> 
     
     
     
    <%@ Register assembly="RadAjax.Net2" namespace="Telerik.WebControls" tagprefix="radA" %> 
    <%@ Register src="../datagridControl.ascx" tagname="datagridControl" tagprefix="uc1" %> 
     
     
     
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">  
    <radA:RadAjaxPanel ID="RadAjaxPanelAppIn" runat="server" LoadingPanelID="AjaxLoadingPanelAppin" ClientEvents-OnRequestStart="pnlRequestStarted" 
            Width="100%">  
        <table border="0" cellpadding="0" cellspacing="0" class="HeaderBg" width="100%">  
            <tbody> 
                <tr> 
                    <td class="SideSpaceWidth">  
                    </td> 
                    <td class="SideSpaceHeight">  
                    <radA:AjaxLoadingPanel ID="AjaxLoadingPanelAppin" runat="server" IsSticky="True" 
                            MinDisplayTime="1000" Wrap="False">  
                            <asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="~/images/indicator.gif" /> 
                            <strong>Loading Content ...</strong></radA:AjaxLoadingPanel> 
                    </td> 
                    <td class="SideSpaceWidth">  
                    </td> 
                </tr> 
                <tr> 
                    <td > 
                    </td> 
                    <td> 
                        <uc1:datagridControl ID="DatagridControl1" runat="server" /> 
                    </td> 
                    <td> 
                    </td> 
                </tr> 
                <tr> 
                    <td> 
                    </td> 
                    <td class="SideSpaceHeight">  
                        &nbsp;</td> 
                    <td> 
                    </td> 
                </tr> 
                
            </tbody> 
        </table> 
        </radA:RadAjaxPanel> 
         
    </asp:Content> 
     
    Inside datagridControl.ascx down is the code for RadGrid
  3. <radG:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" AllowFilteringByColumn="False" 
                    AllowMultiRowSelection="false" AllowPaging="True" AllowSorting="True" BackColor="Transparent" 
                    DataSourceID="GridDataSource" EnableAJAX="false" EnableAJAXLoadingTemplate="false" 
                    EnableViewState="true" GridLines="None" LoadingTemplateTransparency="50" ShowGroupPanel="True" 
                    ShowStatusBar="False" AutoGenerateColumns="true" OnUpdateCommand="RadGrid1_UpdateCommand" 
                    SkinID="myGrid" OnColumnCreated="ColumnCheck" OnPreRender="ReduceFilter" Width="100%" 
                    OnItemDataBound="ColDatabind">  
                    <MasterTableView DataSourceID="GridDataSource" GroupLoadMode="Client">  
                        <Columns> 
                            <radG:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="~/Images/edit.gif" 
                                UniqueName="EditCommandColumn1" Resizable="False" Reorderable="False">  
                                <HeaderStyle Width="15px" /> 
                            </radG:GridEditCommandColumn> 
                            <radG:GridTemplateColumn UniqueName="AssignUser" AllowFiltering="False" Reorderable="False" 
                                Groupable="False" Resizable="False" Visible="false">  
                                <HeaderStyle Width="20px" /> 
                                <HeaderTemplate /> 
                                <ItemTemplate> 
                                    <asp:ImageButton runat="Server" ID="ibtnAssignMsg" ImageUrl="~/images/Asgn.gif" CommandName="AssignMsgToUser" 
                                        ToolTip="Assign SMS to User" Visible="false" /> 
                                </ItemTemplate> 
                            </radG:GridTemplateColumn> 
                            <radG:GridTemplateColumn UniqueName="myselect" AllowFiltering="False" Reorderable="False" 
                                Groupable="False" Resizable="False">  
                                <HeaderStyle Width="20px" /> 
                                <HeaderTemplate> 
                                    <asp:CheckBox ID="selectall" runat="Server" OnLoad="SelectAll" /> 
                                </HeaderTemplate> 
                                <ItemTemplate> 
                                    <asp:CheckBox runat="Server" ID="myselect" OnLoad="ClearSAll" /> 
                                </ItemTemplate> 
                            </radG:GridTemplateColumn> 
                        </Columns> 
                        <EditFormSettings UserControlName="~/editform.ascx" EditFormType="WebUserControl" > 
                            <EditColumn UniqueName="EditCommandColumn">  
                            </EditColumn>                          
                        </EditFormSettings> 
                        <NoRecordsTemplate> 
                            <table width="100%">  
                                <tr> 
                                    <td align="center">  
                                        There are no items to display. Please check your selection criteria and retry.  
                                    </td> 
                                </tr> 
                            </table> 
                        </NoRecordsTemplate> 
                        <FooterStyle Height="0px" /> 
                        <ExpandCollapseColumn Visible="False">  
                            <HeaderStyle /> 
                        </ExpandCollapseColumn> 
                        <RowIndicatorColumn Visible="False">  
                            <HeaderStyle /> 
                        </RowIndicatorColumn> 
                    </MasterTableView>                 
                    <ClientSettings AllowGroupExpandCollapse="True" AllowDragToGroup="True" AllowColumnsReorder="True" 
                        ColumnsReorderMethod="Reorder" ApplyStylesOnClient="True">  
                        <Selecting AllowRowSelect="True" /> 
                        <Resizing AllowColumnResize="True" ResizeGridOnColumnResize="True" />                     
                    </ClientSettings> 
                </radG:RadGrid> 
    My Third EditForm User Control code
    <tr> 
                                    <td nowrap="nowrap">  
                                        <asp:Label ID="Label3" runat="server" meta:resourcekey="Label3Resource2" Text="Recipient(s)"></asp:Label></td>  
                                    <td> 
                                        <asp:Label ID="Label5" runat="server" CssClass="tips" meta:resourcekey="Label5Resource1" 
                                            Text="use ; to separate multiple numbers"></asp:Label> 
                                        <asp:TextBox ID="txtRecipient" runat="server" Visible="False"></asp:TextBox><asp:RequiredFieldValidator  
                                            ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtRecipient" 
                                            ErrorMessage="RequiredFieldValidator" meta:resourcekey="ContactTextRequiredResource1" 
                                            ToolTip="Mobile Number is required." ValidationGroup="SaveSMS">*</asp:RequiredFieldValidator> 
                                        <asp:RegularExpressionValidator  
                                                ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtRecipient" 
                                                ErrorMessage="Please enter numbers only" meta:resourcekey="contactValidatorResource1" 
                                                ValidationExpression="[0-9]+" ValidationGroup="SaveSMS"></asp:RegularExpressionValidator> 
                                        <asp:HiddenField ID="OutlogID" runat="server" /> 
                                    </td> 
                                </tr> 
    <tr> 
                                    <td> 
                                        <asp:Label ID="Label2" runat="server" meta:resourcekey="Label2Resource2" Text="SMS Text"></asp:Label></td>  
                                    <td> 
                                        <asp:TextBox ID="txtSMS" runat="server" Columns="50" Rows="5" TextMode="MultiLine"></asp:TextBox> 
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtSMS" 
                                            ErrorMessage="RequiredFieldValidator" meta:resourcekey="RequiredFieldValidator2Resource1" 
                                            ValidationGroup="QuickSMS">*</asp:RequiredFieldValidator></td>  
                                </tr> 
    When i type "<b>example</b> in text box. The unsafe script error was capturing in global and writting into event log but not redirecting top error display page and giving me always Javascript Error.
  4. am getting downside Javascript Error.


Microsoft JScript runtime error: Unexpected ajax response was received from the server.
This may be caused by one of the following reasons:

 - Server.Transfer.
 - Custom http handler.
- Incorrect loading of an "Ajaxified" user control

Verify that you don't get a server-side exception or any other undesired behavior, by setting the EnableAJAX property to false.



Any one Please help me in this issue. am waiting for your reply.

 

Veli
Telerik team
 answered on 02 Feb 2011
7 answers
191 views
Hi,
I have a requirement where in we show a grid with 100+ columns all with GridTemplateColumns. We either have TextBox, Dropdwon or Radiobutton as edit item template for all the columns. We have a feature where in we invoke a RadWindow (Kept as Content Template with in the same Grid Page) that opens up where in user is shown a drop down that has all the columns that are shown in the grid on selection of any column we need to show the appropriate edit item control for the selected column where in user can enter/select data.

For example if user select "Name" in dropdown, I need to show TextBox if edit item template has text box and if user "Department" in dropdown, I need to show Dropdwon if edit item template has dropdwon...

Looking forward for help
Thanks in Advance
Princy
Top achievements
Rank 2
 answered on 02 Feb 2011
4 answers
66 views
Hi, Telerik...
The PDFExport is giving if i add table......what can i do......
ARUNTHOMAS
Top achievements
Rank 1
 answered on 02 Feb 2011
1 answer
127 views
I using a web service to bind the scheduler and now trying to populate the resources.  I need to pass some additional info to the web service so I've created a class that implements ISchedulerInfo and have followed the instructions for passing additional info to the web service via a custom implementation of ISchedulerInfo.  I'm successful with the call to GetAppointments with additional parameters but I set the custom parameters in javascript. 

So, the web service settings show ResourcePopulationMode="ServerSide".  On the page...

    Protected Sub RadScheduler1_ResourcesPopulating(ByVal sender As Object, ByVal e As Telerik.Web.UI.ResourcesPopulatingEventArgs)
        Dim myInfo As New CustomSchedulerInfo
        myInfo.UserID = 1234
        e.SchedulerInfo = myInfo
    End Sub

Setting breakpoints shows ResourcePopulating firing before the web method call to GetResources. 

    <WebMethod()> _
    Public Function GetResources(ByVal schedulerInfo As CustomSchedulerInfo) As IEnumerable(Of ResourceData)
        Return Controller.GetResources(schedulerInfo)
    End Function

When I set a breakpoint in GetResources and evaluate schedulerInfo, schedulerInfo.UserID = 0 (default). 

Maybe I'm just missing some setting but it appears as though replacing e.SchedulerInfo is not working -- at least not in VB.

Any suggestions?
Peter
Telerik team
 answered on 02 Feb 2011
2 answers
87 views
Hi Team ,

I am new to telerik.i am having RadTreeView in MasterPage and having around 100 pages are using this masterpage.what are the differents ways(by using serverside or clientside) to maintain the state of treeview between the pages (ex:expanding and collapsing etc..).

Please help me..

Regards ,
Naveen M
Naveen
Top achievements
Rank 1
 answered on 02 Feb 2011
6 answers
126 views

Hi there,

 I have a page which has a tabstrip. I dynamically add a usercontrol to a pageview. The usercontrol added dynamically has a button which opens a page in a radwindow. I follow the below syntax for opening a radwindow from client side.

var oWnd = radopen("page.aspx", "Page");

The radwindow is displayed distorted. Screenshot attached.

Georgi Tunev
Telerik team
 answered on 02 Feb 2011
2 answers
83 views
I am having a problem understanding why the following entry in the web.config is only working when it exists in the root web.config and not a "child" web.config.

<add name="Telerik_Web_UI_WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" resourceType="Unspecified" preCondition="integratedMode" />

When it is in the child web.config I receive the wonderful 'Sys is undefined' errors that everyone loves so much.  All other Telerik entries work just fine outside of the root.


Here is the Child webconfig
<?xml version="1.0"?>
   
  <system.web>
    <pages>
      <controls>
        <add tagPrefix="telerik" tagName="" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" />
      </controls>
    </pages>
    <httpHandlers>
      <add path="Telerik.Web.UI.SpellChecker.axd" verb="*" type="Telerik.Web.UI.SpellChecker" validate="false" />
      <add path="Telerik.Web.UI.DialogHandler.aspx" verb="*" type="Telerik.Web.UI.DialogHandler" validate="false" />
      <add path="Telerik.RadUploadProgressHandler.ashx" verb="*" type="Telerik.Web.UI.RadUploadProgressHandler" validate="false" />
      <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" validate="false" />
    </httpHandlers>
    <httpModules>
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
    </httpModules>
  </system.web>
  <system.webServer>
    <modules>
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode,runtimeVersion2.0" />
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode,runtimeVersion2.0" />
    </modules>
    <handlers>     
      <remove name="Telerik_Web_UI_WebResource" />
      <remove name="ChartImage_axd" />
      <remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
      <remove name="Telerik_Web_UI_DialogHandler_aspx" />
      <remove name="Telerik_RadUploadProgressHandler_ashx" />
      <remove name="Telerik_Web_UI_WebResource_axd" />
      <add name="Telerik_Web_UI_WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" resourceType="Unspecified" preCondition="integratedMode" />
      <add name="ChartImage_axd" path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler" preCondition="integratedMode,runtimeVersion2.0" />
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" verb="*" type="Telerik_Web.UI.SpellCheckHandler" preCondition="integratedMode,runtimeVersion2.0" />
      <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" verb="*" type="Telerik.Web.UI.DialogHandler" preCondition="integratedMode,runtimeVersion2.0" />
      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" verb="*" type="Telerik.Web.UI.RadUploadProgressHandler" preCondition="integratedMode,runtimeVersion2.0" />
      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource" preCondition="integratedMode,runtimeVersion2.0" />
    </handlers>
  </system.webServer>
  <appSettings file="">
    <add key="Telerik.Skin" value="Outlook" />
    <add key="Telerik.ScriptManager.TelerikCdn" value="Disabled" />
    <add key="Telerik.StyleSheetManager.TelerikCdn" value="Disabled" />
  </appSettings>
</configuration>



Does anyone know a way to get this to work when it is not in the root web.config?

Thanks!

Rick
Georgi Tunev
Telerik team
 answered on 02 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?