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

I'm having a very strange issue.  When I update or save a record in any one of my 3 RadGrids, then add a new appointment to the Scheduler, it saves the new appointment but then the scheduler stops reacting to any events.  It will not let you edit, or add new appointments and the will error as if it were not registered.  I've included my add code for the scheduler and save function from one of my RadGrids (they're all similar).

protected void RadScheduler1_AppointmentInsert(object sender, AppointmentInsertEventArgs e)
{
    string newslot = e.Appointment.Attributes["SlotDesc"].ToString();
    if (!IsValidAppointment(e.Appointment, newslot))
    {
        e.Cancel = true;
        EventsDataSource.SelectCommand = eventsselectsql;
        RadScheduler1.Rebind();
        return;
    }
    if (e.Appointment.Resources.GetResourceByType("Status").Key.ToString().Equals("UNSCHEDULED", StringComparison.OrdinalIgnoreCase))
        return;
    string fakeid = string.Empty;
    try
    {
        fakeid = e.Appointment.ID.ToString();
        Session["OrigApptID"] = fakeid;
        e.Appointment.Attributes["SystemID"] = null;
    }
    catch
    { }
    int custid = -1;
    try
    {
        custid = int.Parse(Session["CurrentCustomerID"].ToString());
        Session.Remove("CurrentCustomerID");
    }
    catch{}
    if(!e.Appointment.Subject.Equals("CLOSED", StringComparison.OrdinalIgnoreCase) && !e.Appointment.Subject.Equals("LUNCH", StringComparison.OrdinalIgnoreCase))
    {
        string trailerID = e.Appointment.Attributes["TrailerID"];
        string carrierID = e.Appointment.Resources.GetResourceByType("CarrierID") == null ? null : e.Appointment.Resources.GetResourceByType("CarrierID").Key.ToString();
        if (!string.IsNullOrWhiteSpace(trailerID) && !string.IsNullOrWhiteSpace(carrierID))
        {
            InOpenTrailers(trailerID, carrierID);
        }
 
        UpdatePOList(int.Parse(fakeid), custid);
        rgOpenTrailers.Rebind();
        rgOpenPO.Rebind();
    }
    ClearSearch();
}
private void ClearSearch()
{
    GridDataSource.SelectCommand = originalUnschedQuery;
    rgUnscheduled.DataBind();
    Session["ApptID"] = -1;
    btnResetSearch.Visible = false;
    txtSearch.Text = "";
    RadScheduler1.DayStartTime = cliconf.DayStartTime;
    RadScheduler1.DayEndTime = cliconf.DayEndTime;
    RadScheduler1.WorkDayStartTime = cliconf.WorkDayStartTime;
    RadScheduler1.WorkDayEndTime = cliconf.WorkDayEndTime;
 
    DateTime date = RadScheduler1.SelectedDate;
    Session.Add("CurrentDate", date.AddDays(-1).ToShortDateString());
    Session.Add("NextDate", date.AddDays(1).ToShortDateString());
    EventsDataSource.SelectCommand = eventsselectsql;
    RadScheduler1.Rebind();
    foreach (GridColumn column in SearchGrid.MasterTableView.OwnerGrid.Columns)
    {
        column.CurrentFilterFunction = GridKnownFunction.NoFilter;
        column.CurrentFilterValue = string.Empty;
    }
    searchWhere = string.Empty;
    SearchGrid.MasterTableView.FilterExpression = string.Empty;
    SearchGrid.MasterTableView.Rebind();
    SearchGrid.Rebind();
}
protected void btnTrailerSave_Click(object sender, EventArgs e)
{
    string update = string.Empty;
    if (txtApptID.ReadOnly)
    {
        update = "UPDATE OpenTrailers SET ";
        update += "TrailerTypeID = '" + cboTrailerTrailerType.SelectedValue + "'";
        update += ", TrailerTypeDesc = '" + cboTrailerTrailerType.SelectedItem.Text + "'";
        update += ", RefField1='" + txtTrailerRef1.Text.TrimAndSafeDB() + "'";
        update += ", RefField2='" + txtTrailerRef2.Text.TrimAndSafeDB() + "'";
        update += ", RefField3='" + txtTrailerRef3.Text.TrimAndSafeDB() + "'";
        update += ", RefField4='" + txtTrailerRef4.Text.TrimAndSafeDB() + "'";
        update += ", RefField5='" + txtTrailerRef5.Text.TrimAndSafeDB() + "'";
        update += ", LocationID = '" + cboTrailerLocation.SelectedValue + "'";
        update += ", LocationDesc = '" + cboTrailerLocation.SelectedItem.Text + "'";
        update += " WHERE TrailerID='" + txtApptID.Text + "' AND CarrierID=" + cboTrailerCarrier.SelectedValue;
        update = string.Concat(update, " and ClientID=", Session["ClientID"].ToString(), " and AccountID=", Session["AccountID"].ToString(), " and WarehouseID=", Session["WarehouseID"].ToString());
    }
    else
    {
        update = "INSERT INTO OpenTrailers (ClientID, ClientName, AccountID, AccountName, WarehouseID, WarehouseName, CarrierID, CarrierDesc, TrailerID, TrailerTypeID, TrailerTypeDesc, RefField1, RefField2, RefField3, RefField4, RefField5, LocationID, LocationDesc, CreatedBy, CreatedDateTime, ModifiedBy, ModifiedDateTime) values (";
        update += Session["ClientID"].ToString() + ", ";
        update += "(Select ClientName from Client where ClientID=" + Session["ClientID"].ToString() + "), ";
        update += Session["AccountID"].ToString() + ", ";
        update += "(Select AccountName from Account where AccountID=" + Session["AccountID"].ToString() + "), ";
        update += Session["WarehouseID"].ToString() + ", ";
        update += "(Select WarehouseName from Warehouse where WarehouseID=" + Session["WarehouseID"].ToString() + "), ";
        update += cboTrailerCarrier.SelectedValue + ", ";
        update += "'" + cboTrailerCarrier.SelectedItem.Text + "', ";
        update += "'" + txtApptID.Text +"', ";
        update += "'" + cboTrailerTrailerType.SelectedValue + "', ";
        update += "'" + cboTrailerTrailerType.SelectedItem.Text + "', ";
        update += "'" + txtTrailerRef1.Text.TrimAndSafeDB() + "', ";
        update += "'" + txtTrailerRef2.Text.TrimAndSafeDB() + "', ";
        update += "'" + txtTrailerRef3.Text.TrimAndSafeDB() + "', ";
        update += "'" + txtTrailerRef4.Text.TrimAndSafeDB() + "', ";
        update += "'" + txtTrailerRef5.Text.TrimAndSafeDB() + "', ";
        update += "'" + cboTrailerLocation.SelectedValue + "', ";
        update += "'" + cboTrailerLocation.SelectedItem.Text + "', ";
        update += "'" + Session["UserID"].ToString() + "', ";
        update += "'" + DateTime.Now + "', ";
        update += "'" + Session["UserID"].ToString() + "', ";
        update += "'" + DateTime.Now + "') ";
    }
    SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["DMSConnectionString"].ConnectionString);
    conn.Open();
    SqlTransaction trans = conn.BeginTransaction();
    SqlCommand cmd = new SqlCommand(update);
    cmd.Transaction = trans;
    try
    {
        cmd.Connection = conn;
        cmd.ExecuteNonQuery();
        trans.Commit();
    resetGrids();
    }
    catch (Exception ex)
    {
        RadAjaxManager1.Alert("An error occurred during the save: " + ex.Message);
        cmd.Dispose();
        hdnTrailerIndex.Value = "OPEN";
        trans.Rollback();
    }
    finally
    {
        cmd.Dispose();
        conn.Close();
        conn.Dispose();
    }
}
EJ
Top achievements
Rank 1
 asked on 18 Jan 2019
2 answers
89 views

I have a page where I need to:

  1. Display RadBinaryImages in a datalist.
  2. Click a button to open a RadWindow which contains a RadImageEditor to edit the image.
  3. User edits the image and clicks Save in the Editor, which saves and closes the window.
  4. When the window closes, refresh the datalist so the image is updated on the page.

I've got 1-3 working great, and am successfully able to send a command back to the parent page when the RadWindow closes. It's #4 that has me stumped. I'm working with a master page that has the RadAjaxManager on it, and on my content page there's a RadAjaxManagerProxy.

I'm able to change the Datalist to anything else if that helps. I just can't figure out how all of these pieces come together to make a part of my page refresh.

Jessica B.
Top achievements
Rank 1
 answered on 17 Jan 2019
1 answer
187 views

Hello Forum Members,

we have a problem with the JavaScript radconfirm dialog box.

On our local machine it is working fine. But on a customer windows server 2012, IIS8 with IE 

the buttons do not work properly. The debug console shows that it expects to call a .close method

but there is only a .Close method. So if we change that to .Close at runtime it works.

 

Any Suggestions?

 

Rumen
Telerik team
 answered on 17 Jan 2019
1 answer
534 views

I have a RadGrid with 700,000 rows.  I do not bind the RadGrid until the user runs a search function to filter the data.  If the filtered data returns only 1 row I would like to skip showing the the Radgrid and just open a web page that would show the information for the single record.  I can not figure out how to the get the DataKey for that single record.

I am thinking the logical place would be the PreRender event.  to get a row count in the prerender and if that row count was 1 then get the datakey and redirect to my edit page with the the data key as my QueryString. 

This is far as I can get with the code:

int count = RadGrid1.Items.Count;
            if (count == 1)
            {
                string a ="How can I get the datakey value for this 1 row ?"
            }
Perry
Top achievements
Rank 1
 answered on 17 Jan 2019
1 answer
105 views

Hi,

We have an old .NET 3.5 web-site that uses RadEditor for rich text editing operations. The last version of the Telerik DLLs was 2011.2.915.35 and with this configuration, the web-site functioned well until end of December.

Currently, the RadEditor is blocked when you try to open it and no text is rendered in edit mode. This is happening in all modern browsers including Edge except in IE11 where it works only in compatibility mode. I added the meta tag http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> and it only affects IE11.

I upgraded to a newer version 2014.1.403.35 also downloaded the latest trial build 2018.3.910.35 with no luck - the same behaviour.

 

Any ideas?

Rumen
Telerik team
 answered on 17 Jan 2019
8 answers
136 views
I have some charts in a master page site which display data in currency (£) terms.

The localisation quick fix  http://www.telerik.com/help/aspnet-ajax/htmlchart-accessibility-and-internationalization-localization.html  works fine, but in my master page site it fails and the default $ is displayed.

Does anybody know why a master page site messes this up?
Marin Bratanov
Telerik team
 answered on 17 Jan 2019
1 answer
129 views

Hello,

How to format the yaxis label based on the culture? The following code always renders the yaxis in "en" format instead of "fr", when the user loaded in "fr" mode. Y axis will be having amount value.

<script src="js/kendo.all.min.js"></script>
<script src="js/kendo.culture.en-CA.min.js"></script>
<script src="js/kendo.culture.fr-CA.min.js"></script>
 
kendo.culture("<%=GetCultureString()%>");
 
<PlotArea>
<YAxis>
<LabelsAppearance DataFormatString="C" />
</YAxis>


I tried this as well, but didnt work

<YAxis>
<LabelsAppearance>  
<ClientTemplate>#if(value > 0){# #= kendo.format(\'{0:C1}\', value)# #}#</ClientTemplate>
</LabelsAppearance>

 

Marin Bratanov
Telerik team
 answered on 17 Jan 2019
3 answers
1.3K+ views
Hello,

I am trying to incoporate some of the code from the Telerik website's "Application Scenarios" sample codes, but most of them require Telerik.QuickStart namespace/DLL, I searched the entire Telerik installation folder and couldn't find it, can someone let me know where i can find it?

or, are the sample code runable at all?

Thanks
Rumen
Telerik team
 answered on 17 Jan 2019
1 answer
140 views

Line chart is displaying as in attached file chart 1. I need to updated the code to display as in attached file chart 2. Also find code from.aspx and .cs files.

 

aspx file:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>

         <telerik:radscriptmanager ID="QsfScriptManager" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
             </Scripts>
        </telerik:radscriptmanager>

        <telerik:radhtmlchart runat="server" ID="RadHtmlChart1" Width="800px" Height="400px">
        <PlotArea>
        <XAxis DataLabelsField="Measured_depth" MajorTickType="None">
            <MinorGridLines Visible="false" />
            <MajorGridLines Visible="false" />
        </XAxis>
        <YAxis MajorTickType="None">
            <MinorGridLines Visible="false" />
        </YAxis>
        </PlotArea>
        </telerik:radhtmlchart>

            <telerik:radajaxloadingpanel runat="server" ID="RadAjaxLoadingPanel1" Skin="Silk">
        </telerik:radajaxloadingpanel>
        <telerik:radajaxmanager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="Configuratorpanel1">
    <UpdatedControls>
    <telerik:AjaxUpdatedControl ControlID="RadHtmlChart1" />
    </UpdatedControls>
    </telerik:AjaxSetting>
    </AjaxSettings>
        </telerik:radajaxmanager>

        </div>

        <div>
            <asp:button ID="Button1" runat="server" text="Submit" OnClick="Button1_Click"/>
        </div>
    </form>
   


</body>
</html>

cs file:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using Telerik.Web.UI.HtmlChart;
using Telerik.Web.UI.HtmlChart.Enums;
using System.Data.SqlClient;
using System.Data;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {

            DataTable dt = new DataTable();
            DataColumn dcMeasuredDepth = new DataColumn("Measured_depth", typeof(System.Decimal));
            DataColumn dcTrueVerticalDepth = new DataColumn("True_Vertical_Depth", typeof(System.Decimal));
            dt.Columns.Add(dcMeasuredDepth);
            dt.Columns.Add(dcTrueVerticalDepth);

            DataRow dr = dt.NewRow();
            dr[0] = 0.00;
            dr[1] = 0.00;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = 858.60;
            dr[1] = 858.60;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = 1740.40;
            dr[1] = 1740.35;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr[0] = 1882.60;
            dr[1] = 1882.54;
            dt.Rows.Add(dr);

            RadHtmlChart1.DataSource = dt;
            LineSeries ls = new LineSeries();

            ls.DataFieldY = "True_Vertical_Depth";
        
            RadHtmlChart1.PlotArea.Series.Add(ls);
            RadHtmlChart1.DataBind();

           
        }
        catch (Exception ex)
        {

        }
        finally
        {

        }
    }
}

 

 

 

Marin Bratanov
Telerik team
 answered on 17 Jan 2019
1 answer
229 views

I was able to successfully convert FROM byte[] to MemoryStream to load an image from the database into the editor, but now when it comes to saving I am not able to convert the image TO byte[].

Using

Telerik.Web.UI.ImageEditor.EditableImage newimg = args.Image;

 

 does not result in a type that can be converted to byte[]. Or does it? I can't even seem to convert it to a Stream.

Jessica B.
Top achievements
Rank 1
 answered on 16 Jan 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?