Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
89 views
xx
xx
Shinu
Top achievements
Rank 1
 asked on 13 Mar 2012
1 answer
63 views
Hi,

I am using Telerik Rad Controls Chart for ASP.Net Ajax. 
Does Telerik Chart Control support more than two Y scales?


Best regards,
Rok Pahulje 
Richard
Top achievements
Rank 1
 answered on 13 Mar 2012
1 answer
47 views
Hi,

  i am using  RadAjaxManager for showing the image whenever the server is responding, it was working fine. When i am using the code for printing the page using javascript. To print the page, the page has to go to server and get the details, when i am assign the radajaxManger it was not working.

my radajaxManager:

<telerik:AjaxSetting AjaxControlID="imgPrint">
                            <UpdatedControls>
                                                   <telerik:AjaxUpdatedControl ControlID="pnlBellMaintainanceServices" />                              
                            </UpdatedControls>
                        </telerik:AjaxSetting>
Maria Ilieva
Telerik team
 answered on 13 Mar 2012
3 answers
206 views

Hi,
I am using Visual Studio 2008 and Telerik Controls Version 2009.3.1103.20.

I am developing ASP.Net Website.

I have so many different WebPages and I want to implement AJAX on my page so that I can display rotating image during postback when system is processing something.

I tried code from Telerik Demo, tried using "telerik:RadAjaxPanel" and also tried to add ajaxsettings using "telerik:RadAjaxManager" but somehow I always ended up having javascript errors on some controls. So finally I thought to post my question here for help.

I am PASTING html for my sample UI. Can you please help me what is the best way to implement this on this page?

In the attached sample HTML, I removed all of my events and other source code and just putting my basic UI design with minimum fields.

My purpose is to know hot to implement AJAX on these pages.
Please provide me working setting for AJAX on these pages as I have already tried so many different options.

I HAVE SAMPLE PROJECT BUT DONT KNOW HOW TO UPLOAD IT HERE. SO I AM PASTING ONE OF MY PAGE CODE HERE. IF THERE IS ANY WAY TO UPLOAD .ZIP FILE WITH NEW THREAD, PLEASE DO LET ME KNOW AND I WILL UPLOAD MY SAMPLE PROJECT.

Can you help me with these items? -->
 1. is it possible to display loadingpanel image for whole page and its ok to refresh whole page if we can display loading image during postback
 2. in general, for grid, whenever any paging number is clicked, it should display loadingpanel for grid
 3. CompletedRequestsDetail.aspx
           --> When "btnUpdateGeneratedPONo" or "btnCompleteRequest" is clicked which is inside ItemTemplate, it should display loadingpanel for grid
           --> when "btnViewAllSelected" or "btnViewAllSelectedSupplierCopy" is clicked, it should display loadingpanel for whole page


Thanks in advance,
Nirav

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="CompletedRequestsDetail.aspx.cs" Inherits="CompletedRequestsDetail"
    Title="All Completed/Cancelled Requests" %>
  
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="ContentPlaceHolder2" ContentPlaceHolderID="ContentPlaceHolder1"
    runat="server">
  
    <script type="text/javascript" language="javascript">
    </script>
  
    <table>
        <tr>
            <td colspan="100%" valign="top">
                <table border="0" cellpadding="0" cellspacing="0">
                    <tr valign="top">
                        <td valign="top">
                               
                            <asp:ImageButton runat="server" ID="imgExportToExcel" ImageUrl="~/Images/Excel-19.png"
                                CausesValidation="false" OnClick="imgExportToExcel_Click" BorderWidth="0" ToolTip="Click here to export displayed list to Excel" />
                                
                            <asp:ImageButton runat="server" ID="imgExportToWord" ImageUrl="~/Images/Word-19.png"
                                CausesValidation="false" OnClick="imgExportToWord_Click" BorderWidth="0" ToolTip="Click here to export displayed list to Word" />
                                
                            <asp:Button CssClass="ButtonCSS" runat="server" ID="btnViewAllSelected" Text="View All Selected Requests as pdf"
                                ToolTip="Click here to view all selected requests as pdf" CausesValidation="false"
                                OnClick="btnViewAllSelected_Click" OnClientClick="javascript:Page_BlockSubmit = false;buttonClicked_WithObj(this);" />
                                      
                            <asp:Button CssClass="ButtonCSS" runat="server" ID="btnViewAllSelectedSupplierCopy"
                                Text="View All Selected Requests Supplier Copy" ToolTip="Click here to view all selected requests Supplier Copy"
                                CausesValidation="false" OnClick="btnViewAllSelectedSupplierCopy_Click" 
                                OnClientClick="javascript:Page_BlockSubmit = false;buttonClicked_WithObj(this);" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="100%">
            </td>
        </tr>
    </table>
    <table>
        <tr>
            <td>
                <asp:Panel runat="server" ID="pnlPendingRequests" CssClass="panelStyle">
                    <table cellspacing="0" cellpadding="0">
                        <tr>
                            <td>
                                <%--<div class="Scrollgrid" style="WIDTH: 1100px; HEIGHT: 600px;">--%>
                                <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" AllowSorting="true"
                                    AllowFilteringByColumn="true" AutoGenerateColumns="False" GridLines="Both" OnNeedDataSource="RadGrid1_needdatasource"
                                    OnItemDataBound="RadGrid1_ItemDataBound" OnDetailTableDataBind="RadGrid1_DetailTableDataBind"
                                    AllowMultiRowSelection="true" OnItemCreated="RadGrid1_ItemCreated" OnItemCommand="RadGrid1_ItemCommand"
                                    SelectedItemStyle-CssClass="SelectedItem" Skin="Default">
                                    <PagerStyle Mode="NextPrevNumericAndAdvanced" Position="TopAndBottom" AlwaysVisible="true" />
                                    <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
                                        <Selecting AllowRowSelect="true" />
                                    </ClientSettings>
                                    <MasterTableView ShowHeadersWhenNoRecords="true" AllowFilteringByColumn="true" DataKeyNames="RequestInfoID"
                                        Name="ApprovalsMaster">
                                        <DetailTables>
                                            <telerik:GridTableView DataKeyNames="RequestInfoID" Width="80%" Name="ApprovalsDetail"
                                                AllowPaging="false" runat="server" AllowSorting="false">
                                                <ParentTableRelation>
                                                    <telerik:GridRelationFields DetailKeyField="RequestInfoID" MasterKeyField="RequestInfoID" />
                                                </ParentTableRelation>
                                                <HeaderStyle CssClass="InnerHeaderStyle" />
                                                <Columns>
                                                    <telerik:GridBoundColumn DataField="ApproverEmailAddress" HeaderText="ApproverEmailAddress"
                                                        SortExpression="ApproverEmailAddress">
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                            </telerik:GridTableView>
                                        </DetailTables>
                                        <Columns>
                                            <telerik:GridTemplateColumn HeaderStyle-Width="10px" AllowFiltering="false" UniqueName="selectrow">
                                                <HeaderTemplate>
                                                    <input id="chkSelectAll" type="checkbox" onclick="return CheckAllCheckboxes(this,'chkSelectRow');" />
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <asp:CheckBox runat="server" ID="chkSelectRow" />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridNumericColumn DataField="RequestInfoID" HeaderText="Request No." SortExpression="RequestInfoID"
                                                DataType="System.Int64" FilterControlWidth="40px">
                                            </telerik:GridNumericColumn>
                                            <telerik:GridTemplateColumn HeaderText="Total Amount" SortExpression="TotalAmount"
                                                DataType="System.Decimal" DataField="TotalAmount" HeaderStyle-HorizontalAlign="Right"
                                                ItemStyle-HorizontalAlign="Right">
                                                <ItemTemplate>
                                                    <asp:Label runat="server" ID="lblTotalAmount" Text='<%#  Eval("CurrencySymbol").ToString() + Eval("TotalAmount","{0:#,##0.00}").ToString() %>'></asp:Label>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Update Generated PO No./Invoice No." UniqueName="updategeneratedpono"
                                                AllowFiltering="false" SortExpression="generatedpono">
                                                <ItemTemplate>
                                                    <asp:TextBox Width="150px" runat="server" MaxLength="150" ValidationGroup="vgGeneratedPONo"
                                                        ID="txtGeneratedPONo" ToolTip="Enter Generated PO No."></asp:TextBox>
                                                    <asp:Button runat="server" ID="btnUpdateGeneratedPONo" Text="Update" CssClass="ButtonCSS"
                                                        ValidationGroup="vgGeneratedPONo" ToolTip="Click here to update information for Generated PO No./Invoice No."
                                                        OnClick="btnUpdateGeneratedPONo_Click" OnClientClick="javascript:return confirm('Are you sure you want to update this Generated PO No./Invoice No.? ');"
                                                        CommandArgument='<%# Eval ( "RequestInfoID").ToString() %>' />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn HeaderText="Complete Request" UniqueName="completerequest"
                                                SortExpression="CompletedStatus" DataField="CompletedStatus">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblCompletedStatus" runat="server" Text='<%# Eval ( "CompletedStatus").ToString()%>'></asp:Label>
                                                    <asp:Button runat="server" ID="btnCompleteRequest" Text="Complete" CssClass="ButtonCSS"
                                                        ToolTip="Click here to complete Request" CausesValidation="False" OnClick="btnCompleteRequest_Click"
                                                        OnClientClick="javascript:var agree= confirm('Are you sure you want to complete this Request? '); if(agree){ Page_BlockSubmit = false;buttonClicked_WithObj(this); return true; };else {return false;};"
                                                        CommandArgument='<%# Eval ( "RequestInfoID").ToString() %>' />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        <EditFormSettings>
                                            <PopUpSettings ScrollBars="None" />
                                        </EditFormSettings>
                                        <ExpandCollapseColumn Resizable="False" Visible="False">
                                            <HeaderStyle />
                                        </ExpandCollapseColumn>
                                        <RowIndicatorColumn Visible="False">
                                            <HeaderStyle />
                                        </RowIndicatorColumn>
                                    </MasterTableView>
                                </telerik:RadGrid>
                                <br />
                                <%--</div>--%>
                            </td>
                        </tr>
                    </table>
                    <table width="100%">
                        <tr>
                            <td>
                                <hr class="hrClass" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
    </table>
    <div class="WaitDisplay" id="divWait" style="display: none; width: auto;">
        <img alt="" src="Images/spinner2.gif" />
        <div id="divWaitMessage">
            Processing...
        </div>
    </div>
</asp:Content>


Maria Ilieva
Telerik team
 answered on 13 Mar 2012
3 answers
1.0K+ views
i need to update panels from client side  RadWindow ClientClose event
depend the return value i need to update Panels
for example if return value = "1"
i need to update Panel1

if return value = "2"
i need to update Panel 2

how to achive this


Maria Ilieva
Telerik team
 answered on 13 Mar 2012
1 answer
71 views
Hello, 
Is there a way to configure an iFrame RadWindow to automatically add the stylesheets of the parent window? I recall that the RadEditor has this feature, so I am hoping that the RadWindow can perform the same functionality.

Thanks,
Adam
Marin Bratanov
Telerik team
 answered on 13 Mar 2012
1 answer
316 views
Hi there,

I have a problem with the Grid not returning the text I have in my RadComboBox.

I have got a grid with a GridTemplateColumn, with a RadComboBox and checkboxes like so:
<telerik:GridTemplateColumn HeaderText="Roles" UniqueName="Roles"> 
    <EditItemTemplate> 
        <telerik:RadComboBox ID="RadComboBox1" DataSourceID="SqlDataSource3" AllowCustomText="true" OnSelectedIndexChanged="OnSelectedIndexChanged"
        DataTextField="RoleName" DataValueField="RoleName" runat="server">
            <ItemTemplate>
                <div class="combo-item-template">
                    <asp:CheckBox runat="server" ID="chk1" OnCheckedChanged="onCheckBoxClick" AutoPostBack="True" />
                    <asp:Label runat="server" ID="Label1" AssociatedControlID="chk1" Text='<%# Eval("RoleName")%>'>
                    <%# Eval("RoleName")%>
                    </asp:Label>
                </div>
            </ItemTemplate>
        </telerik:RadComboBox>
    </EditItemTemplate>
    <ItemTemplate>
        <asp:Label runat="server" ID="Label2"><%# Eval("RoleNames")%></asp:Label>
    </ItemTemplate>
</telerik:GridTemplateColumn>


And using a sql datasource and using the getuserlist stored procedure to retrieve the roles :
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SqlConnection %>" OnInserting="SqlDataSource_OnInserting"
SelectCommandType="StoredProcedure"
SelectCommand="GetUserList"
 
InsertCommandType="StoredProcedure"
InsertCommand="dbo.CreateUser" 
>
<InsertParameters>
    <asp:Parameter Name="UserName" Type="String" />
    <asp:Parameter Name="Password" Type="String" />
    <asp:Parameter Name="IsApproved" Type="Byte" />
    <asp:Parameter Name="IsLockedOut" Type="Byte" />
    <asp:Parameter Name="Email" Type="String" />
    <asp:Parameter Name="Roles" Type="String" />
    <asp:Parameter Name="UserId" DbType="Guid" Direction="Output" />
</InsertParameters>

Roles come back as a comma separated string and the procedure that inserts them can handle it like: 'Role1, Role2' as parameter

But in edit/insert mode, I need to fill the RadComboBox and the checkboxes so I can select any of the ones I have.
<asp:SqlDataSource ID="SqlDataSource3" runat="server" 
ConnectionString="<%$ ConnectionStrings:Sql_Azure %>" 
SelectCommand="SELECT RoleId, RoleName FROM Roles ORDER BY RoleName">
</asp:SqlDataSource>

So I have a oncheckboxclick that modfies the RadComboBox

protected void onCheckBoxClick(object sender, EventArgs e)
{
    CheckBox chk = (CheckBox)sender;
    RadComboBox combobox = (RadComboBox)chk.Parent.Parent;
 
    string text = BuildText(combobox);
    combobox.Text = text;
}

So this all works until I check the roles in the command parameters:
protected void SqlDataSource_OnInserting(object sender, SqlDataSourceCommandEventArgs e)
{
       DbParameterCollection CmdParams = e.Command.Parameters;
}
And I can see the Roles parameter is empty. What I am doing wrong? I think I am not setting the griddataitem, so I looked into it...

And I have seen use reading the text property of the griddataitem with the following, so I tried to modify the text
protected void OnSelectedIndexChanged(object sender, EventArgs e)
{
      GridDataItem dataItem = (GridDataItem)combobox.Parent.Parent;
      dataItem["Roles"].Text = text;
}
But that doesn't work, because the Text property is readonly.

For updating I need to do the same thing obviously, plus then I need to set the initial state. I don't know which event I can use.
Thank you so much, been puzzling on this for a long time... :S
Richard
Top achievements
Rank 1
 answered on 13 Mar 2012
2 answers
187 views
Hello,

  I have a RadBInaryImage and i would like to change the visibility from javascript. Right now I am making the source empty but i still see the empty image with cross mark. So i wanted it to be invisible.

var OldImage = $get("<%= rbiClientImage.ClientID %>");    
       if (OldImage != null)
       {       
          OldImage.src = "";     
       }

Is there any property to make the binaryimage invisible?

Appreciate the help
Thanks
Jagat
Top achievements
Rank 1
 answered on 13 Mar 2012
1 answer
390 views
Is there any way to apply excel like automatic filter on telrik grid ? I have autogeneratedcolumn=true and based on condition I am showing the column 


<telerik:RadGrid ID="gvinvoice" Width="98%" AllowPaging="true" PageSize="10" runat="server"
                                AutoGenerateColumns="true" 
                                OnPageIndexChanged="gvinvoice_PageIndexChanged" 
                                ShowFooter="True">
                                <PagerStyle Mode="NextPrevAndNumeric" />
                            </telerik:RadGrid>


So, at design time I am not sure the number and name of the column. How can I apply filter to these columns ? 
Princy
Top achievements
Rank 2
 answered on 13 Mar 2012
1 answer
709 views
Ok, I'm at the bottom of the pit of despair!
Have tried for days to resolve this problem, so maybe hoping someone here can help. I've searched the web and tried all the advice given, to no avail. Here is the problem.

I built a local project with RAD grid, cloud, combos etc and it worked fine.  However, when I integrated it into out CMS, the problems started.  The man error message is:

Script controls may not be registered before PreRender


The problem is something to do with this piece of code:
<telerik:RadScriptManager ID="RadScriptManager1" EnableHandlerDetection="false" runat="server">
</telerik:RadScriptManager>


The pages where I've tried this :
1. The master page
2. The ascx page

Doesn't matter where I position this line of code, I still get either the above error message.  I've also tried these 2 different code blocks (not at the same time obviously) in the code behind of the ascx page:

  
protected override void OnInit(EventArgs e)
{
    if (ScriptManager.GetCurrent(this.Page) == null)
    {
        ScriptManager scriptManager = new ScriptManager();
        scriptManager.ID = "myScriptManager";
        scriptManager.EnablePartialRendering = true;
        this.Page.Form.Controls.Add(scriptManager);
    }
    base.OnInit(e);
}
 
protected override void OnPreRender(EventArgs e)
{
    if (ScriptManager.GetCurrent(this.Page) == null)
    {
        ScriptManager scriptManager = new ScriptManager();
        scriptManager.ID = "myScriptManager";
        scriptManager.EnablePartialRendering = true;
        this.Page.Form.Controls.Add(scriptManager);
    }
    base.OnPreRender(e);
}

Here is the stack trace:
[InvalidOperationException: Script controls may not be registered before PreRender.]
   System.Web.UI.ScriptControlManager.RegisterScriptControl(TScriptControl scriptControl) +348689
   System.Web.UI.ScriptManager.RegisterScriptControl(TScriptControl scriptControl) +66
   Telerik.Web.UI.RadWebControl.RegisterScriptControl() +42
   Telerik.Web.UI.RadWebControl.ControlPreRender() +15
   Telerik.Web.UI.RadFormDecorator.ControlPreRender() +464
   Telerik.Web.UI.RadWebControl.OnPreRender(EventArgs e) +22
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842


I'm pretty much as my wits end with this. Any ideas Telerik, community?
Many thanks,
Alan
Richard
Top achievements
Rank 1
 answered on 13 Mar 2012
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?