Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
40 views

I updated my controls from 2008 and for some reason the pager now displays on 5 lines.  Any idea why this might be happening?  I have posted the code below.

Thanks

<telerik:RadGrid ID="rgSalesOrder" DataSourceID="dsSalesOrderList" ShowHeader="true"
                    Width="676px" Height="185" AutoGenerateColumns="false" GridLines="None" AllowPaging="True"
                    PageSize="30" runat="server" OnSelectedIndexChanged="rgSalesOrder_SelectedIndexChanged"
                    OnItemDataBound="rgSalesOrder_ItemDataBound" OnSortCommand="rgSalesOrder_SortCommand" onpageindexchanged="rgSalesOrder_PageIndexChanged"
                    Skin="" EnableEmbeddedSkins="False" ImagesPath="~\Images\Grid\" CssClass="grid"
                    AllowSorting="true">
                    <PagerStyle Position="Bottom" AlwaysVisible="True"  />
                    <MasterTableView AllowPaging="true" DataKeyNames="Id" AllowSorting="true">
                        <Columns>
                            <telerik:GridTemplateColumn HeaderText="Customer" ItemStyle-Width="250px" HeaderStyle-Width="250px" SortExpression="Company">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbtnCompany" runat="server" Text='<%#Bind("Company") %>' OnClick="lbtnCompany_Click"></asp:LinkButton>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:LinkButton ID="lbtnCompany" runat="server" Text='<%#Bind("Company") %>' OnClick="lbtnCompany_Click"></asp:LinkButton>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                              
                            <telerik:GridBoundColumn HeaderText="User" DataField="CreatedBy" HeaderStyle-Width="50px" ItemStyle-Width="50px">
                            </telerik:GridBoundColumn>
                              
                            <telerik:GridButtonColumn ButtonType="LinkButton" HeaderText="Quote#" CommandName="Select"
                                DataTextField="Id" SortExpression="Id" HeaderStyle-Width="65px" ItemStyle-Width="65px">
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn HeaderText="Date" DataField="CreatedOn" DataFormatString="{0:MM/dd/yyyy}"
                                HeaderStyle-Width="85px" ItemStyle-Width="85px">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Status" DataField="OrderStatus" HeaderStyle-Width="70px"
                                ItemStyle-Width="70px">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Value" DataField="QuoteValue" HeaderStyle-Width="100px"
                                ItemStyle-Width="100px" DataFormatString="{0:c}">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="ACTION" SortExpression="Status" HeaderStyle-Width="155px"
                                ItemStyle-Width="155px" HeaderStyle-HorizontalAlign="Center" Visible="false">
                                <ItemTemplate>
                                    <table id="tblStatus" border="0px" cellpadding="0px" cellspacing="0px" width="155px">
                                        <tr>
                                            <td style="text-align: center">
                                                <asp:Label ID="lblCustomerID" runat="server" Visible="false" Text='<%# Bind("CustomerId") %>'></asp:Label>
                                                <asp:Label ID="lblStatusID" runat="server" Visible="false" Text='<%# Bind("Status") %>'></asp:Label>
                                                <asp:Label ID="lblStatus" runat="server" Visible="false" Text='<%# Bind("Status") %>'></asp:Label>
                                                <asp:Label ID="lblRowStyle" runat="server" Visible="false" Text='<%# Bind("RowStyle") %>'></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="" ItemStyle-HorizontalAlign="Right">
                                <ItemTemplate>
                                    <asp:CheckBox runat="server" ID="chkSelect" />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:CheckBox runat="server" ID="chkSelect" />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                        <%--<ItemStyle CssClass="gridstyle"></ItemStyle>--%>
                       <HeaderStyle CssClass="gridheaderstyle"></HeaderStyle>
                    </MasterTableView
                        <SelectedItemStyle BackColor="#FFFFCC" />
                                <ActiveItemStyle BackColor="#FFFFCC" />
                    <ClientSettings>
                        <Scrolling AllowScroll="True" UseStaticHeaders="true" ScrollHeight="141"  />
                          
                        <%--<ClientEvents OnGridCreated= "SetHeight"  />--%>
                    </ClientSettings>
                </telerik:RadGrid>

 

Paul
Top achievements
Rank 1
 answered on 21 Oct 2011
1 answer
175 views
I thought I'd share this solution here to save anyone else the hours of tearing hair out that I've had.

I had a master page and user controls using RadAjaxProxyManagers and the RadAjaxLoadingPanel was displaying for some buttons and not others. I played around with the setup of the page and narrowed it down to the buttons that had causesvalidation="false" were the ones that worked as expected.

This however was a red herring, as I eventually discovered the problem was caused by having ClientIDMode set to Static on the radbuttons! Why does setting ClientIDMode="Static" break showing the loading panel, but everything else functions fine?

<asp:Content ID="bodyPlaceholder" ContentPlaceHolderID="BodyPlaceHolder" runat="server">
 
  <div id="wrapper" runat="server">
 
    <!-- various grids etc -->
 
    <div>
       <div class="left">
         <telerik:RadButton runat="server" ID="addButton" ClientIDMode="Static" Text="Add" OnClick="Add" />
       </div>
       <div class="right">
         <telerik:RadButton runat="server" ID="okButton" ClientIDMode="Static" Text="OK" OnClick="Ok" />
         <telerik:RadButton runat="server" ID="cancelButton" ClientIDMode="Static" Text="Cancel" OnClick="Cancel" CausesValidation="false" />
          </div>
          <div class="clear">
        </div>
      </div>
  </div>
 
  <telerik:RadAjaxManagerProxy runat="server" ID="ajaxProxy" ClientIDMode="Static">
    <AjaxSettings>
      <telerik:AjaxSetting AjaxControlID="ajaxProxy">
        <UpdatedControls>
          <telerik:AjaxUpdatedControl ControlID="wrapper" LoadingPanelID="loadingPanel" />
        </UpdatedControls>
      </telerik:AjaxSetting>
      <telerik:AjaxSetting AjaxControlID="wrapper">
        <UpdatedControls>
          <telerik:AjaxUpdatedControl ControlID="wrapper" LoadingPanelID="loadingPanel" />
        </UpdatedControls>
      </telerik:AjaxSetting>
    </AjaxSettings>
  </telerik:RadAjaxManagerProxy>
 
  <telerik:RadAjaxLoadingPanel runat="server" ID="loadingPanel" />
 
</asp:Content>


Tsvetina
Telerik team
 answered on 21 Oct 2011
2 answers
116 views
Hi! I use RadAsyncUpload in aspx page with RadWindow! And it doesn't visible in FireFox! In Chrome and IE it visible but in FireFox not! Help please! Thankue!))) 
Timyr
Top achievements
Rank 1
 answered on 21 Oct 2011
7 answers
701 views

Using version 2.0.2.0 of the Rad Ajax Chart. 
I cannot figure out how to change the font size for the title of a chart created via the API.
The title is being truncated (it looks like part of a left parenthesis followed by "Enrollmen" and then a few extra pixels of something).
AutoTextWrap is True. 

I'd expect to find the font-size property somewhere in the Appearance.TextProperties hierarchy, but don't see it.

 

 

Dim CTitle As New Telerik.Charting.ChartTitle

  

With CTitle.TextBlock

 

 

    .Text =

"Enrollment Blah Blah"

 

 

 

 

   .Appearance.AutoTextWrap = Telerik.Charting.Styles.AutoTextWrap.True

 

 

    .Appearance.TextProperties.Color = System.Drawing.Color.Maroon

 

End With

 

 

 

 

RadChart1.ChartTitle.Add(CTitle)

 

 

 

 

 

 

 

 

 

 

Evgenia
Telerik team
 answered on 21 Oct 2011
2 answers
300 views
Hi Team,
I have a hierarchical radgrid and I want to export it to Excel
I have 2 problems exporting it .

1. I am exporting it on button_Click (button outside the grid). 
    My page has RadAjaxPanel . So when I click the button, it doesn't export it to excel.

2. I want to format it .
    I want to add some header with values from dropdown on my page.

Attaching image of the grid and below is my page and MasterPage

MainMaster.master :::
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MainMasterPage.master.cs" Inherits="AceFinance.MainMasterPage" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="act" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
   
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head id="Head1" runat="server">
    <title>Ace Finance</title>
</head>
<body class="bodymaster">
    <form id="form1" runat="server">
         <telerik:RadScriptManager ID="ScriptManager" runat="server" AsyncPostBackTimeout="1500" />
    <telerik:RadAjaxManager ID="RadAjaxManagerMaster" runat="server" EnableAJAX="true">
           <AjaxSettings>
                 <telerik:AjaxSetting AjaxControlID="rmFinanceMenu">
                   <UpdatedControls>
                           <telerik:AjaxUpdatedControl ControlID="rmFinanceMenu" LoadingPanelID="AjaxLoadingPanel1" />
                   </UpdatedControls>
               </telerik:AjaxSetting>
           </AjaxSettings>
    </telerik:RadAjaxManager>
  
        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" Skin="Default" />
        <asp:Panel runat="server" ID="Panel1" CssClass="menu-container">
        //  my code... menus, etc.
      </asp:Panel>
 </form>
    </body>
</html>

page.aspx :::
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ManageGiroPayments.aspx.cs" Inherits="AceFinance.ManageGiroPayments" MasterPageFile="~/MainMasterPage.Master" Title="Giro Payments" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <telerik:RadAjaxPanel ID="rjxPanel" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
        <fieldset>
            <asp:Label ID="lblGiroPayment" runat="server" Text="Giro Payments" Font-Bold="true"  CssClass="ClsLabelHead" />
            <br /> <br />
            <table width="100%">
                <tr>
                    <td>
                        <asp:Label ID="lblOrganization" runat="server" Text="Organization" Font-Bold="true" />
                        <telerik:RadComboBox ID="rcbOrganization" runat="server" OnSelectedIndexChanged="rcbOrganization_SelectedIndexChanged" AutoPostBack="true" Height="140px" />
                    </td>
                    <td>
                        <asp:Label ID="lblAccountNo" runat="server" Text="Account #" Font-Bold="true" />
                        <telerik:RadComboBox ID="rcbBankAccount" runat="server" />
                    </td>
                    <td>
                        <asp:Label ID="lblCostCenter" runat="server" Text="Cost Center" Font-Bold="true"  />
                        <telerik:RadComboBox ID="rcbCostCenter" runat="server" Height="140px" />
                    </td>
                </tr>
                <tr>
                    <td style="width:100%" colspan="3">
                        <telerik:RadGrid ID="rgGiroPayments" runat="server" OnNeedDataSource="rgGiroPayments_NeedDataSource" AllowMultiRowSelection="true">
                            <MasterTableView>
                                <GroupByExpressions>
                                    <telerik:GridGroupByExpression>
                                        <SelectFields>
                                            <telerik:GridGroupByField FieldName="EntityKeyName" FieldAlias="Vendor" />
                                        </SelectFields>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="EntityKeyName" FieldAlias="Vednor" />
                                        </GroupByFields>
                                    </telerik:GridGroupByExpression>
                                </GroupByExpressions>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="AP_InvoiceID" HeaderText="AP_InvoiceID" Display="false" UniqueName="AP_InvoiceID">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="InvoiceNo" HeaderText="Invoice #" DataType="system.string"
                                        UniqueName="InvoiceNo" FilterControlWidth="75%" SortExpression="InvoiceNo"
                                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="InvoiceDate" HeaderText="Date" FilterControlWidth="75%"
                                        UniqueName="InvoiceDate" DataFormatString="{0:d}" AutoPostBackOnFilter="true"
                                        CurrentFilterFunction="Contains">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="EntityID" HeaderText="EntityID" Display="false" UniqueName="EntityID">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="EntityKeyID" HeaderText="EntityKeyID" Display="false" UniqueName="EntityKeyID">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="EntityKeyName" FilterControlWidth="75%" HeaderText="EntityKeyName"
                                        UniqueName="EntityKeyName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" Display="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="InvoiceCurrencyName" HeaderText="Currency"
                                        UniqueName="InvoiceCurrencyName" FilterControlWidth="50%" AutoPostBackOnFilter="true"
                                        CurrentFilterFunction="Contains" Display="false">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="CurrencySymbol" HeaderText="Currency"
                                        UniqueName="CurrencySymbol" FilterControlWidth="50%" AutoPostBackOnFilter="true"
                                        CurrentFilterFunction="Contains">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="InvoiceAmount" HeaderText="Amount" UniqueName="InvoiceAmount"
                                        FilterControlWidth="50%" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridTemplateColumn HeaderText="Paid Amount" UniqueName="PaidAmount">
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtPaidAmount" runat="server" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn DataField="BalanceAmount" HeaderText="Due Amount" UniqueName="BalanceAmount"
                                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridClientSelectColumn UniqueName="Select">
                                    </telerik:GridClientSelectColumn>
                                </Columns>
                            </MasterTableView>
                            <ClientSettings Selecting-AllowRowSelect="true"></ClientSettings>
                        </telerik:RadGrid>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="3">
                        <asp:Button ID="btnPayment" runat="server" Text="Make Payment" OnClick="btnPayment_Click" Width="100px" />
                    </td>
                </tr>
            </table>
        </fieldset>
    </telerik:RadAjaxPanel>
</asp:Content>


This is  Button_Click
protected void btnPayment_Click(object sender, EventArgs e)
     {
         try
         {
             string InvoiceIDList = GlobalConstants.BLANK;
             DataTable dt = new DataTable();
             dt.Columns.Add("VendorID");
             dt.Columns.Add("AP_InvoiceID");
             dt.Columns.Add("InvoiceAmount");
             dt.Columns.Add("PaidAmount");
             APInvoices AllAPInvoices = APInvoices.GetAllInvoices(int.Parse(rcbOrganization.SelectedValue), UIHelper.GetCurrentUsersLanguageID());
             foreach (GridDataItem item in rgGiroPayments.SelectedItems)
             {
                 TextBox txtPaidAmount = item.FindControl("txtPaidAmount") as TextBox;
                 if (txtPaidAmount.Text == GlobalConstants.BLANK)
                     throw new Exception("Please enter Paid Amount for Invoice " + item["InvoiceNo"].Text);
                 if (double.Parse(txtPaidAmount.Text) > double.Parse(item["BalanceAmount"].Text))
                     throw new Exception("Paid Amount cannot be greater than Due Amount for Invoice " + item["InvoiceNo"].Text);
                 dt.Rows.Add(int.Parse(item["EntityKeyID"].Text), item["AP_InvoiceID"].Text, item["InvoiceAmount"].Text, txtPaidAmount.Text);
                 APInvoice AnAPInvoice = AllAPInvoices.GetItem(int.Parse(item["AP_InvoiceID"].Text));
                 AnAPInvoice.PaidAmount = double.Parse(txtPaidAmount.Text);
             }
             //AllAPInvoices.Save(); 
             DataRow[] dr = dt.Select("", "VendorID");
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 InvoiceIDList = InvoiceIDList + dt.Rows[i]["AP_InvoiceID"].ToString() + ",";
             }
             // Export to Excel code here 
             rgGiroPayments.AllowSorting = false;
             rgGiroPayments.AllowFilteringByColumn = false;
             rgGiroPayments.ExportSettings.IgnorePaging = true;
             //rgGiroPayments.ExportSettings.ExportOnlyData = true;
             rgGiroPayments.MasterTableView.HierarchyDefaultExpanded = true;
             rgGiroPayments.ExportSettings.OpenInNewWindow = true;   
             rgGiroPayments.MasterTableView.ExportToExcel();
             Session["APInvoiceInfoList"] = null;
             rgGiroPayments.Rebind();
         }
         catch (Exception ex)
         {
             XITingExceptionProcessor.ProcessException(this, ex);
         }
     }


Waiting for your positive reply,

Thanks,
Lok..

Please refere excel_format_001.png file..
its an updated image.

Lokesh
Top achievements
Rank 1
 answered on 21 Oct 2011
0 answers
73 views
I've added a resource to the advanced form template as below

 <ResourceTypes>
                    <telerik:ResourceType KeyField="ID" Name="Type" />
</ResourceTypes>

I'm populating this drop down in the code behing on load

    rad_diary.Resources.Add(New Resource("Type", 1, "Appointment"))
    rad_diary.Resources.Add(New Resource("Type", 4, "Out of office"))

When adding a new appointment I grab the value of this using the following

 Protected Sub rad_diary_AppointmentInsert(ByVal sender As Object, ByVal e As SchedulerCancelEventArgs)

appointmentitem = e.Appointment.Resources.GetResourceByType("Type").Key

end sub

This works fine when inserting a new entry.

My problems arises  when I try to update an existing appointment - the same line of code to get the value of my resource i.e

Protected Sub rad_diary_AppointmentUpdate(ByVal sender As Object, ByVal e As AppointmentUpdateEventArgs)

appointmentitem = e.Appointment.Resources.GetResourceByType("Type").Key

end sub

When I click to update and this sub runs to get the value I get an error saying

Error : : Object reference not set to instance of an object.

Any help would be gladly recieved - I've searched long and hard for a solution but cannot find one.

Thanks in advance

Tim
Tim
Top achievements
Rank 1
 asked on 21 Oct 2011
3 answers
90 views
Hi

I am being asked to present a RadMenu type UI when a RadTooBarSplitButton is being clicked.

The reason that I am being asked to do this is because your RadToolBarSplitButton only allows one
layer of buttons in its Item List, and we need a cascading series of buttons.

So I am attempting to still use the RadToolBarSplitButton and just show a RadContextMenu on the client side click event.

I have found some example code that calls  the show function on a context menu variable after I find the ContentMenu, however I am unclear on how to associate the menu with my specific button so it appears just below the RadToolBarSplitButton.

Is the parameter that is passed on the show method the control I want to associate with? 
Or is there some other mechanism?

If you have an alternative solution to my functional requirement to show cascading items below a RadToolBar I would love to hear that too

TIA
Kate
Telerik team
 answered on 21 Oct 2011
1 answer
116 views


Email Send Problem in those boded lines


String server = "587";
 
                                MailAddress from = new MailAddress("newgenetech@gmail.com");
                                MailAddress to = new MailAddress("mohideenrms@gmail.com");
                                System.Web.Mail.MailMessage message = new System.Web.Mail.MailMessage(from, to);
 
                                message.Subject = "Hello";
                                message.Body = "How are you";
 
                                SmtpClient client = new SmtpClient(server);
 
                                try
                                {                                   
                                    client.Send(message);
                                }
                                catch (Exception ex)
                                {
                                    throw new Exception(ex.Message, ex);
                                }

1 boded error message come like that

Doesn't contain a contractors take two arguments

2 boded error message come like that

(local variable)system.web.mail.mailing message error: the best overload method match for 'system.net.mail.Smptclient.Send'(system.web.mail.mailling message)has some invalid aruguments.

Thanks,
Mohamed.
mohamed
Top achievements
Rank 1
 answered on 21 Oct 2011
1 answer
92 views
Does anyone know how to trap the keydown event on the text inputbox on the ColorPicker?  When you put the cursor in the field and hit the Backspace key to erase what is there, the browser back button is triggered taking the user off of the page entirely.  I want to prevent that from happening.

Thanks,
Dean
Slav
Telerik team
 answered on 21 Oct 2011
3 answers
269 views
Ola bom dia,


estou com problema ao usar o "RadWindow" dentro do "RadAjaxPanel", ele não aparece. È possivel usar os dois objetos ao mesmo tempo? se for! por favor me ajudem com um exemplo.


Att,

Claudinei.
Marin Bratanov
Telerik team
 answered on 21 Oct 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?