Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
210 views
Hi,

I'm trying to show a notification when starting a time consuming function.
But no notification will popup.

What am I doing wrong:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ReportsGeneral.ascx.cs"
    Inherits="ReportsGeneral" %>
 
<%@ Register TagPrefix="uc" TagName="InfoPanel" Src="~/InfoPanel.ascx" %>
<%@ Register TagPrefix="uc" TagName="RisWindow" Src="~/RisWindow.ascx" %>
 
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function OnClientFilesUploaded(sender, args) {
            $find('<%=RadAjaxManager1.ClientID %>').ajaxRequest();
        }
    </script>
</telerik:RadScriptBlock>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="false">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadAsyncUploadReport" />
                <telerik:AjaxUpdatedControl ControlID="RadGridReports" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<div style="margin: 15px;">
    <center>
        <table>
            <tr>
                <td valign="top">
                    Begin
                    <telerik:RadCalendar ID="RadCalendar1" runat="server">
                    </telerik:RadCalendar>
                </td>
                <td rowspan="2" valign="top" style="margin-left: 10px; padding-left: 10px;">
                    Rapporten
                    <telerik:RadGrid ID="RadGridReports" runat="server" AllowPaging="True" ActiveItemStyle-Wrap="True"
                        ShowStatusBar="true" AllowSorting="True" AllowMultiRowEdit="true" AutoGenerateColumns="false"
                        AllowAutomaticInserts="true" OnNeedDataSource="RadGridReports_NeedDataSource" ClientSettings-Selecting-AllowRowSelect="true" ClientSettings-EnablePostBackOnRowClick="true"
                        OnItemCommand="RadGridReports_ItemCommand">
                        <MasterTableView PageSize="10" NoMasterRecordsText="No data">
                            <Columns>
                                <telerik:GridBoundColumn DataField="report_id" HeaderText="ID" UniqueName="id" Display="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="owner" HeaderText="Eigenaar" UniqueName="owner">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="filename" HeaderText="Rapport" UniqueName="filename">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="info" HeaderText="Info" UniqueName="info" Display="false">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true">
                        </ClientSettings>
                    </telerik:RadGrid>
                    <br />
                    <asp:Panel runat="server" GroupingText="Upload rapport">
                        <telerik:RadAsyncUpload ID="RadAsyncUploadReport" runat="server" OnFileUploaded="RadAsyncUploadReport_FileUploaded"
                            OnClientFilesUploaded="OnClientFilesUploaded" AllowedFileExtensions="xlsx" Localization-Select="Selecteer" Width="99%">
                        </telerik:RadAsyncUpload>
                        <br />
                    <uc:InfoPanel ID="InfoPanel1" runat="server" Type="note" Text="Je kan alleen rapporten uploaden met de .xlsx extensie!" HeaderText="Let op!"/>
                    </asp:Panel>
                    <br />
                    <div style="text-align: center">
                    <telerik:RadButton ID="buttonGenerateReport" runat="server" Text="Genereer rapport!" OnClick="buttonGenerateReport_Click" Skin="MetroTouch"></telerik:RadButton>
                    </div>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    Eind
                    <telerik:RadCalendar ID="RadCalendar2" runat="server">
                    </telerik:RadCalendar>
                </td>
                <td>
                      
                </td>
            </tr>
        </table>
        <uc:RisWindow runat="server" ID="windowWarning" />
        <telerik:RadNotification ID="RadNotification" runat="server" Text="Initial text" Position="Center" AutoCloseDelay="0" Width="350" Title="Current time" EnableRoundedCorners="true" />
    </center>
</div>

Code to show the notification:
protected void buttonGenerateReport_Click(object sender, EventArgs e)
{
    if (this.RadGridReports.SelectedItems.Count <= 0)
    {
        this.windowWarning.Show("Selecteer eerst een rapport!");
        return;
    }
 
    // now start with the reporting
    string reportID = Session["ReportID"].ToString();
    string ownerID = dbReports.GetReportItem(reportID, "user_id");
    string reportFileName = dbReports.GetReportItem(reportID, "filename");
    string shortNameOwner = dbUser.GetUserItem(ownerID, "short_name");
 
    string completePath = Global.ReportFolder + shortNameOwner + "-" + reportFileName;
 
    this.RadNotification.Visible = true;
    this.RadNotification.VisibleOnPageLoad = true;
    this.RadNotification.Show();
 
    if (reportFileName.ToLower().StartsWith("vakantiekaart"))
    {
        ReportsVacation reportsVacation = new ReportsVacation();
        string reportResult = reportsVacation.CreateReport(completePath, reportFileName);
        if (reportResult != string.Empty)
        {
            this.windowWarning.Show(reportResult);
            return;
        }
    }
    else
    {
        ReportsStandard reportsStandard = new ReportsStandard();
        string reportResult = reportsStandard.CreateReport(completePath, reportFileName);
    }
 
    try
    {
        this.FileResponse(reportFileName, Global.ReportOutputFolder + reportFileName);
    }
    catch (Exception ex)
    {
        this.windowWarning.Show("Fout bij opslaan rapport: " + Global.ReportOutputFolder + reportFileName + "! Bestaat de folder?");
    }
}

Thanks and best regards,
Egbert
Marin Bratanov
Telerik team
 answered on 07 May 2014
2 answers
161 views
I put an ajax panel into my page, which is viewed in a radwindow.  When I use a lookup textbox and postback to get information the page dissapears and eventually it reappears when the data finishes loading.  Becuase of the trip of dta this can take 10 - 15 sec.  Some users take this as the page messing up, how can I show the loading circle of the loadpanel during this time as it is not showing.  When i postback on the txtSearch textbox everything disapears and then reapears when data is loaded, i would like the loading spinner of the load panel to show.

<telerik:RadAjaxPanel ID="radPanel" runat="server" LoadingPanelID="RadloadPanel">
           <div class="CentDiv">
               <asp:TextBox ID="txtSearch" runat="server" Width="360px" AutoPostBack="true" OnTextChanged="txtSearch_TextChanged"></asp:TextBox>
                <asp:AutoCompleteExtender ID="txtSearch_ACE" runat="server" TargetControlID="txtSearch" MinimumPrefixLength="1" ServiceMethod="FindName" ServicePath="~/AutoComplete.asmx"
                  UseContextkey="true" OnClientItemSelected="SelectedName" EnableCaching="true" CompletionInterval="1" DelimiterCharacters=""  />
               <asp:TextBoxWatermarkExtender ID="txtSearch_WME" runat="server" TargetControlID="txtSearch" WatermarkText="Enter Last Name First Name" WatermarkCssClass="WaterMark" />
           </div>
          <asp:Panel ID="pnlInfo" runat="server" Visible="false">
              <table style="width:100%;border:double;background-color:antiquewhite">
                  <tr>
                      <td style="height:5px"></td>
                  </tr>
                  <tr>
                      <td style="text-align:right;width:40%">Pick Persona: </td>
                      <td><telerik:RadComboBox ID="ddlPersona" runat="server" OnDataBound="ddlPersona_DataBound" Width="140px"></telerik:RadComboBox>
                      </td>
                  </tr>
                  <tr>
                      <td style="height:5px"></td>
                  </tr>
                  <tr>
                      <td style="text-align:right;width:40%">Enter EDPI: </td>
                      <td><asp:TextBox ID="txtEDIPI" runat="server" Width="140px" MaxLength="10"></asp:TextBox>
                          <asp:RequiredFieldValidator ID="valEdipi" runat="server" Display="Dynamic" ControlToValidate="txtEDIPI" ValidationGroup="Token" Text=" * Enter EDIPI" Font-Bold="true" ForeColor="Tomato"></asp:RequiredFieldValidator>
                          <asp:FilteredTextBoxExtender ID="txtEDIPI_FTE" runat="server" TargetControlID="txtEdipi" FilterType="Numbers"></asp:FilteredTextBoxExtender>
                      </td>
                  </tr>
                  <tr>
                      <td style="height:5px"></td>
                  </tr>
                  <tr>
                      <td style="text-align:right;width:40%">Enter DISA Email: </td>
                      <td><asp:TextBox ID="txtEmail" runat="server" Width="260px" MaxLength="60"></asp:TextBox>
                          <asp:TextBoxWatermarkExtender ID="txtEmail_WME" runat="server" TargetControlID="txtEmail" WatermarkCssClass="wtrMrk" WatermarkText="Email." />
                          <asp:RequiredFieldValidator ID="valtxtEmail" runat="server" ControlToValidate="txtEmail" ErrorMessage="Enter Disa Email" Display="Dynamic" ForeColor="Red" ValidationGroup="Token"></asp:RequiredFieldValidator>
                      </td>
                  </tr>
                  <tr>
                      <td style="height:5px"></td>
                  </tr>
                   <tr>
                      <td style="text-align:right;width:40%">Unit: </td>
                      <td><asp:Label ID="lblUnit" runat="server"></asp:Label></td>
                  </tr>
                  <tr>
                      <td style="height:5px"></td>
                  </tr>
                  <tr>
                      <td style="text-align:right;width:40%">Unit Phone #: </td>
                      <td><asp:TextBox ID="txtPhone" runat="server" Width="140px" MaxLength="12"></asp:TextBox>
                          <asp:RequiredFieldValidator ID="valPhone" runat="server" Display="Dynamic" ControlToValidate="txtPhone" ValidationGroup="Token" Text=" * Enter Phone" Font-Bold="true" ForeColor="Tomato"></asp:RequiredFieldValidator>
                          <asp:TextBoxWatermarkExtender ID="txtPhoneNumber_WME" runat="server" TargetControlID="txtPhone" WatermarkCssClass="wtrMrk" WatermarkText="000.000.0000" />
                          <asp:FilteredTextBoxExtender ID="txtPhoneNumber_FTE" runat="server" FilterType="Custom, Numbers" ValidChars="." TargetControlID="txtPhone"></asp:FilteredTextBoxExtender>
                          <asp:RegularExpressionValidator ID="valPhoneExpress" runat="server" ControlToValidate="txtPhone" ErrorMessage="* Enter Format 222.222.2222" Display="Dynamic" ValidationExpression="((\(\d{3}\) ?)|(\d{3}.))?\d{3}.\d{4}" ForeColor="Red" ValidationGroup="Token" />
                      </td>
                  </tr>
                  <tr>
                      <td style="height:5px"></td>
                  </tr>
                  <tr>
                      <td style="text-align:right;width:40%">Unit Address: </td>
                      <td><asp:Label ID="lblAddress" runat="server"></asp:Label></td>
                  </tr>
                  <tr>
                      <td style="height:5px"></td>
                  </tr>
                  <tr>
                      <td style="text-align:right;width:40%">Unit City: </td>
                      <td><asp:Label ID="lblCity" runat="server"></asp:Label></td>
                  </tr>
                  <tr>
                      <td style="height:5px"></td>
                  </tr>
                  <tr>
                      <td style="text-align:right;width:40%">Unit State: </td>
                      <td><asp:Label ID="lblState" runat="server"></asp:Label>
                             Unit Zip: 
                          <asp:Label ID="lblZip" runat="server"></asp:Label>
                      </td>
                  </tr>
                  <tr>
                      <td style="height:5px"></td>
                  </tr>
                  <tr>
                      <td style="text-align:right;width:40%">Pick-up Location: </td>
                      <td><telerik:RadComboBox ID="ddlLocation" runat="server" OnDataBound="ddlLocation_DataBound"></telerik:RadComboBox></td>
                  </tr>
                  <tr>
                      <td style="height:5px"></td>
                  </tr>
                  <tr>
                      <td style="text-align:right;width:40%"></td>
                      <td><asp:LinkButton ID="lnkSubmit" runat="server" Text="Submit" CausesValidation="true" OnClick="lnkSubmit_Click" ValidationGroup="Token"></asp:LinkButton>
                               
                          <asp:LinkButton ID="lnkCancel" runat="server" Text="Cancel" CausesValidation="false" OnClick="lnkCancel_Click"></asp:LinkButton>
                      </td>
                  </tr>
              </table>
          </asp:Panel>
          <asp:HiddenField ID="HFPersId" runat="server" /><asp:HiddenField ID="HFUserId" runat="server" /><asp:HiddenField ID="HFEdit" runat="server" /> 
      </telerik:RadAjaxPanel>
      <telerik:RadAjaxLoadingPanel ID="RadloadPanel" runat="server" AnimationDuration="10" MinDisplayTime="5" BackgroundPosition="Center"></telerik:RadAjaxLoadingPanel>
























Kevin
Top achievements
Rank 1
 answered on 07 May 2014
5 answers
149 views
(forum page has timed out twice now when I've submitted this... going to post in pieces)

In a TileList I have a Tile with a radHTMLChart in the PeekTemplate.
When I click on the tile to reposition it, it reorders the other tiles in strange ways.
The Tilelist area expands causing scroll bars to display and blank "phantom" tiles seem to take up space.
I've tried disabling the chart's tooltips, limiting size of the chart content, adding empty onClientClick handlers... no luck.

Please see screen capture and partial example page code snippets below in thread replies

Thanks!
-Matt

Marin Bratanov
Telerik team
 answered on 07 May 2014
9 answers
284 views
Hi

I have developed an external .js file for an ASP.NET system which executes the following...
function ProcessUpdate(arg) {
    var ram = $telerik.$("[id$='RadAjaxManager1']").attr("id");
    var ajaxManager = $find(ram);
    if (!arg) { ram.ajaxRequest("Rebind"); } else if (arg == 'navigateToInserted') ram.ajaxRequest("RebindAndNavigate"); else if (arg.match(/navigateToDeleted.*/)) ram.ajaxRequest(arg);
}


  I am trying to execute the RadAjaxManager ajaxRequest along with the proper argument, but so far all I am getting is an error 'Cannot call method 'ajaxRequest' of null'.  I am able to get reference to the RadAjaxManager object on the page, but the method is not available for referencing at this point.

Any help or comments would be appreciated!

Regards
Maria Ilieva
Telerik team
 answered on 07 May 2014
1 answer
121 views
Hi,  
I have used following ajax manager in my page and i have used user control Schedule_Review_Narrative1 on this page to which i have tool into ajax manager 
and i have my grid in Schedule_Review_Narrative1 and in that grid i have applied code to download image but not able to download image.

Problem : i want to use ajax in grid as well as i need to run code to download document. 

<telerik:RadAjaxManager ID="RAMMileston" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Schedule_Review_Left_Navigation1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Schedule_Review_Narrative1" />
                    <telerik:AjaxUpdatedControl ControlID="Schedule_Review_Left_Navigation1" />
                      </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

in link button i have gave command name  to link button and in rggrid_ItemCommand () i have gave following code but not able to download so please help me in this 

    else if (e.CommandName == "DownloadFile")
                    {
                       
                            SqlConnection objSqlCon = new SqlConnection(db.ConnectionString);
                            objSqlCon.Open();
                            SqlTransaction objSqlTran = objSqlCon.BeginTransaction();

                            SqlCommand objSqlCmd = new SqlCommand("Procedure_Name", objSqlCon, objSqlTran);
                            objSqlCmd.CommandType = CommandType.StoredProcedure;

                            SqlParameter objSqlParam1 = new SqlParameter("@FileGUID", SqlDbType.VarChar);
                            objSqlParam1.Value = e.CommandArgument;

                            objSqlCmd.Parameters.Add(objSqlParam1);
                            string path = string.Empty;
                            string FileType = string.Empty;
                            string FormName = string.Empty;

                            using (SqlDataReader sdr = objSqlCmd.ExecuteReader())
                            {
                                while (sdr.Read())
                                {
                                    path = sdr[0].ToString();
                                    FileType = sdr[1].ToString();
                                    FormName = sdr[2].ToString();
                                }

                            }

                            objSqlCmd = new SqlCommand("SELECT GET_FILESTREAM_TRANSACTION_CONTEXT()", objSqlCon, objSqlTran);
                            byte[] objContext = (byte[])objSqlCmd.ExecuteScalar();
                            SqlFileStream objSqlFileStream = new SqlFileStream(path, objContext, FileAccess.Read);
                            byte[] buffer = new byte[(int)objSqlFileStream.Length];
                            objSqlFileStream.Read(buffer, 0, buffer.Length);
                            objSqlFileStream.Close();

                            objSqlTran.Commit();
                            FormName = FormName.Replace(";", "").Replace(",", " ");
                            Response.AddHeader("Content-disposition", "attachment; filename=" + Path.GetFileName(FormName) + FileType);
                            // Here you need to manage the download file stuff according to your need
                            Response.ContentType = "application/octet-stream";
                            Response.BinaryWrite(buffer);
                            Response.End();
                        
                    }

Please help me in this.
Thanks
Manish
Maria Ilieva
Telerik team
 answered on 07 May 2014
1 answer
180 views
Hi Telerik,

Are any events fired at the beginning/end of the drawing actions, ideally that can report back to the server in some way? I would like to be able to capture the starting and ending coordinates when a user draws a circle or rectangle using the image editor controls so that I can flag the image as altered when the Apply button is clicked, as well as write it to the database along with an explanation/annotation for explain why it was done (using this for redaction) when the image is saved.
Vessy
Telerik team
 answered on 07 May 2014
1 answer
121 views
When editing a grid, the pagelayout seems not to work well in edit form templates. I believe it does not account for the space consumed outside of the template, the grid itself and any other space between grid and edge boundary of screen. I have add the pagelayout with in the edit form and also wrap the grid with the pagelayout control. No effect.
Venelin
Telerik team
 answered on 07 May 2014
3 answers
203 views
Hi,

When using bootstrap, the RadMenu with RepeatColumns = 2 setting renders as single column because bootstrap forces the box-sizing: border-box rule. If we include this CSS rule, the multi-column render correctly:

ul.rmMultiColumn
{
   box-sizing: content-box;
}

Please include the box-sizing rule into the RadMenu out of the box. Thanks,
Magdalena
Telerik team
 answered on 07 May 2014
7 answers
282 views
I have been experimenting with the advanced binding features of the RadTreeView and have hit a wall in my knowledge level. Perhaps one of you can answer it.

I have a simple database schema, as shown in the attached picture.
Manufacturers can have Products which in turn have multiple Parts.

The project contains the Linq to Sql model (also shown)

I am try to have the tree bind the various levels using the RadTreeNodeBinding technique.

<telerik:RadTreeView ID="RadTreeView1" runat="server">
    <DataBindings>
        <telerik:RadTreeNodeBinding Depth="0" TextField="ManufacturerName" ValueField="ManufacturerID" />
        <telerik:RadTreeNodeBinding Depth="1" DataMember="Products" TextField="ProductName" ValueField="ProductID" />
        <telerik:RadTreeNodeBinding Depth="2" DataMember="Parts" TextField="PartName" ValueField="PartName" />
    </DataBindings>
</telerik:RadTreeView>

with code behind

protected void Page_Load(object sender, EventArgs e)
{
    if (!this.IsPostBack)
    {
        DataClasses1DataContext db = new DataClasses1DataContext();
        RadTreeView1.DataSource = db.Manufacturers;
        RadTreeView1.DataBind();
    }
}

Only the root nodes of Manufacturer show up, shouldnt it traverse automatically by setting the "DataMember" property to the Property of the LinqToSql Entity that has children entities?
Dimitar Terziev
Telerik team
 answered on 07 May 2014
1 answer
240 views
Hi,
After reading posts in different sited for hours, i couldn't find the problem in my code.
I'm using telerik rad chart and need to create a stacked bar chart, according to this data table structure:

Work Week         Product         Quantity
-------------------------------------------------------
201401               a                      10
201401               a                      20
201402               a                       5
201402               b                      10
201402               c                       6
201418               a                      10
201418               b                       25

I know there is a similar question to this, and you referred them to:
 http://www.telerik.com/help/aspnet-ajax/chart-grouping-databound-items.html


but its not helping. 
My code is:

        RadChart1.DataSource = dataForGraph; //dataForGraph is a data table
        RadChart1.DataGroupColumn = "product";
        RadChart1.PlotArea.XAxis.DataLabelsColumn = "WW";
        RadChart1.Legend.Appearance.GroupNameFormat = "#NAME:#VALUE";
        
        RadChart1.DataBind();
        foreach (ChartSeries s in RadChart1.Series)
        {
            s.Type = ChartSeriesType.StackedBar;
        }
And the result is that the quantity is stacked in wrong places (for example quantity 25 is in 201401 instead of 201418)
What am i doing wrong?

Thx,




Danail Vasilev
Telerik team
 answered on 07 May 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?