Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
104 views
I have a major client issue and I'm days away from UAT.

I'm using the code below to save the information back to the appointment object when I click Save on the Advanced Form.  The problem is, when I open the appointment again, none of my changes persist. 

I have a feeling that this is due to my scheduler not being tied to a datasource.  Currently, I have a class that creates fake data and sends it to the scheduler on load.  The scheduler is not tied to a datasource because I would like to manipulate the schedule and make many changes, then batch them up and send them to the database at one time.  My plan is to iterate through the calendar and find any events that had changes and send them to my update/insert. 

To recap, my problems are:
- The changes are not getting saved to my appointment object
- Is it possible to send all of the changes to the database at once, instead of every time save is pressed?

Let me know what other code you need to help.


protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ProductionRunMock productionRunBL = new ProductionRunMock();
                List<ProductionRun> productionRuns = productionRunBL.GetProductionRuns();
 
                schMasterScheduler.DataSource = productionRuns;
             
                AddResourceTypes();
                AddResources();
 
                schMasterScheduler.GroupBy = ddlPlant.SelectedValue.ToString();
            }
     }


protected void schMasterScheduler_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
       {
           //This event runs on click of save from the form. Therefore we need to check to see if it's an insert or update.
 
           //moveAppointsRight(e.ModifiedAppointment, e.Appointment);
 
           //pull all the controls out of session so we can find their values
           //required
           RadComboBox ddlMatereial = Session["ddlMaterial"] as RadComboBox;
           RadTextBox txtBatchNumber = Session["txtBatchNumber"] as RadTextBox;
           RadNumericTextBox txtBatchSize = Session["txtBatchSize"] as RadNumericTextBox;
           RadComboBox ddlUnitOfMeasure = Session["ddlUnitOfMeasure"] as RadComboBox;
           RadDateTimePicker dtpStartDateTime = Session["dtpStartDateTime"] as RadDateTimePicker;
           RadNumericTextBox txtDuration = Session["txtDuration"] as RadNumericTextBox;
           RadDateTimePicker dtpEndDateTime = Session["dtpEndDateTime"] as RadDateTimePicker;
           ResourceControl ResVessel = Session["ResVessel"] as ResourceControl;
           CheckBox cbNonProdTime = Session["cbNonProdTime"] as CheckBox;
                 
           //optional
           RadDatePicker calShippingDate = Session["calShippingDate"] as RadDatePicker;
           RadTextBox txtWashPrep = Session["txtWashPrep"] as RadTextBox;
           RadComboBox ddlPriority = Session["ddlPriority"] as RadComboBox;
           CheckBox cbWorkOff = Session["cbWorkOff"] as CheckBox;
           CheckBox cbLocked = Session["cbLocked"] as CheckBox;
           RadTextBox txtRawMaterialDependency = Session["txtRawMaterialDependency"] as RadTextBox;
           RadTextBox txtComments = Session["txtComments"] as RadTextBox;
                 
           //conatinering
           Repeater rtpContainering = Session["rptContainering"] as Repeater;
           RadComboBox ddlContainerType = Session["ddlContainerType"] as RadComboBox;
           RadTextBox txtContainerQuantity = Session["txtContainerQuantity"] as RadTextBox;
 
           //write the values of the controls into the appointment object
           e.ModifiedAppointment.Subject = ddlMatereial.SelectedValue;
           e.ModifiedAppointment.Start = Convert.ToDateTime(dtpStartDateTime.SelectedDate);
           e.ModifiedAppointment.End = Convert.ToDateTime(dtpEndDateTime.SelectedDate);
           e.ModifiedAppointment.Attributes["BatchNumber"] = txtBatchNumber.Text;
           e.ModifiedAppointment.Attributes["UnitOfMeasure"] = ddlUnitOfMeasure.SelectedValue;
           e.ModifiedAppointment.Attributes["BatchSize"] = txtBatchSize.Text;
           e.ModifiedAppointment.Attributes["NonProdTime"] = (cbNonProdTime.Checked) ? "true" : "false";
           e.ModifiedAppointment.Attributes["ShipDate"] = Convert.ToDateTime(calShippingDate.SelectedDate).ToShortDateString();
           e.ModifiedAppointment.Attributes["WashPrep"] = txtWashPrep.Text;
           e.ModifiedAppointment.Attributes["Priority"] = ddlPriority.SelectedValue;
           e.ModifiedAppointment.Attributes["WorkOff"] = (cbWorkOff.Checked) ? "true" : "false";
           e.ModifiedAppointment.Attributes["RawMaterialDependency"] = txtRawMaterialDependency.Text;
           e.ModifiedAppointment.Attributes["Comments"] = txtComments.Text;
           e.ModifiedAppointment.Attributes["IsLocked"] = (cbLocked.Checked) ? "true" : "false";
           e.ModifiedAppointment.Attributes["IsDirty"] = "true";
           //e.Appointment.Resources[0] = Convert.ToInt32(e.Appointment.Resources.GetResourceByType(plantNumber.ToString()));
            
       }

protected void schMasterScheduler_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
  {          
      //gets all of the fields
 
      //required fields
      RadComboBox ddlMaterial = e.Container.FindControl("ddlMaterial") as RadComboBox;
      RadTextBox txtBatchNumber = e.Container.FindControl("txtBatchNumber") as RadTextBox;
      RadNumericTextBox txtBatchSize = e.Container.FindControl("txtBatchSize") as RadNumericTextBox;
      RadComboBox ddlUnitOfMeasure = e.Container.FindControl("ddlUnitOfMeasure") as RadComboBox;
      RadDateTimePicker dtpStartDateTime = e.Container.FindControl("dtpStartDateTime") as RadDateTimePicker;
      RadNumericTextBox txtDuration = e.Container.FindControl("txtDuration") as RadNumericTextBox;
      RadDateTimePicker dtpEndDateTime = e.Container.FindControl("dtpEndDateTime") as RadDateTimePicker;
      ResourceControl resVessel = e.Container.FindControl("ResVessel") as ResourceControl;
      CheckBox cbNonProdTime = e.Container.FindControl("cbNonProdTime") as CheckBox;
      Label lblError = e.Container.FindControl("lblError") as Label;
 
      //optional fields
      Panel pnlNonProdOrder = e.Container.FindControl("pnlNonProdOrder") as Panel;
      RadDatePicker calShippingDate = e.Container.FindControl("calShippingDate") as RadDatePicker;
      RadTextBox txtWashPrep = e.Container.FindControl("txtWashPrep") as RadTextBox;
      RadComboBox ddlPriority = e.Container.FindControl("ddlPriority") as RadComboBox;
      CheckBox cbWorkOff = e.Container.FindControl("cbWorkOff") as CheckBox;
      CheckBox cbLocked = e.Container.FindControl("cbLocked") as CheckBox;
      RadTextBox txtRawMaterialDependency = e.Container.FindControl("txtRawMaterialDependency") as RadTextBox;
      RadTextBox txtComments = e.Container.FindControl("txtComments") as RadTextBox;
 
      //containering
      Repeater rptContainering = e.Container.FindControl("rptContainering") as Repeater;
      RadComboBox ddlContainerType = e.Container.FindControl("ddlContainerType") as RadComboBox;
      TextBox txtContainerQuantity = e.Container.FindControl("txtContainerQuantity") as TextBox;
 
      //add the controls to session that we need in other places
      //required
      Session["ddlMaterial"] = ddlMaterial;
      Session["txtBatchNumber"] = txtBatchNumber;
      Session["txtBatchSize"] = txtBatchSize;
      Session["ddlUnitOfMeasure"] = ddlUnitOfMeasure;
      Session["dtpStartDateTime"] = dtpStartDateTime;
      Session["txtDuration"] = txtDuration;
      Session["dtpEndDateTime"] = dtpEndDateTime;
      Session["ResVessel"] = resVessel;
      Session["cbNonProdTime"] = cbNonProdTime;
      Session["lblError"] = lblError;
 
      //optional
      Session["pnlNonProdOrder"] = pnlNonProdOrder;
      Session["calShippingDate"] = calShippingDate;
      Session["txtWashPrep"] = txtWashPrep;
      Session["ddlPriority"] = ddlPriority;
      Session["cbWorkOff"] = cbWorkOff;
      Session["cbLocked"] = cbLocked;
      Session["txtRawMaterialDependency"] = txtRawMaterialDependency;
      Session["txtComments"] = txtComments;
 
      //conatinering
      Session["rptContainering"] = rptContainering;
      Session["ddlContainerType"] = ddlContainerType;
      Session["txtContainerQuantity"] = txtContainerQuantity;
       
      //load materials drop down
      LoadMaterialsDropdown(ddlMaterial, plantNumber);
       
      //fill the form out with the information from appointment object
      if (ViewState["mode"].ToString() == "update")
      {               
          //required               
          ddlMaterial.SelectedValue = e.Appointment.Subject;
          txtBatchNumber.Text = e.Appointment.Attributes["BatchNumber"];
          txtBatchSize.Text = e.Appointment.Attributes["BatchSize"];
          ddlUnitOfMeasure.SelectedValue = e.Appointment.Attributes["UnitOfMeasure"];
          txtDuration.Text = e.Appointment.End.Subtract(e.Appointment.Start).TotalHours.ToString();
          cbNonProdTime.Checked = (e.Appointment.Attributes["NonProdTime"].ToLower() == "true") ? true : false;
 
          //optional
          calShippingDate.SelectedDate = DateTime.Parse(e.Appointment.Attributes["ShipDate"]);
          txtWashPrep.Text = e.Appointment.Attributes["WashPrep"];
          cbWorkOff.Checked = (e.Appointment.Attributes["WorkOff"].ToLower() == "true") ? true : false;
          cbLocked.Checked = (e.Appointment.Attributes["IsLocked"].ToLower() == "true") ? true : false;
          txtRawMaterialDependency.Text = e.Appointment.Attributes["RawMaterialDependency"];
          txtComments.Text = e.Appointment.Attributes["Comments"];
          ddlPriority.SelectedValue = e.Appointment.Attributes["Priority"];
 
          //enable/diable fields based on nonProdTime
          NonProdTimeCheckedChanged();
                        
          //redo this part with the container information
 
          //mock up the containers to fill the middle section of the popup
          ContainersMock containerBL = new ContainersMock();
          List<Container> containers = containerBL.GetContainers();
 
          rptContainering.DataSource = containers;
          rptContainering.DataBind();
      }
       
      else if (ViewState["mode"].ToString() == "insert")
      {
           
      }
  }







Peter
Telerik team
 answered on 27 Jul 2012
1 answer
273 views
We have RadMaskedTextBox control and we are setting the PromptChar and Mask propery of RadMaskedTextBox  as PromptChar="_" and Mask="###-###-####". 
We are accessing the value of RadMaskedTextBox through the javascript like the following:


$("#<%= rmtbPhone.ClientID %>_text").val()


When there is no value in RadMaskedTextBox
For DLL version: 2011.2.816.40, it is giving value as Empty("")
For DLL version: 2012.2.724.40, it is giving value as "___-___-____" instead of Empty("") 

How to get the actual value when using new DLL through Javascript or JQuery?

Thanks in advance,
Ajit
Jayesh Goyani
Top achievements
Rank 2
 answered on 27 Jul 2012
1 answer
93 views
Have a RadListBox with OnItemDataBound going to this method:
protected void listWho_ItemDataBound(object sender, RadListBoxItemEventArgs e)
        {
            if (!IsPostBack)
            {
                    DataRowView dataSourceRow = e.Item.DataItem as DataRowView;
                    string pkValue = dataSourceRow["pk"].ToString();
                    if (pkValue == "51" || pkValue == "53")
                    {
                        e.Item.Selected = true;
                    }
                 
            }
        }


The problem is that dataSourceRow is null.  Why?
Dan
Top achievements
Rank 2
 answered on 27 Jul 2012
1 answer
158 views
Hi all,
I am trying to call ajaxRequestWithTarget on a telerik radajaxpanel like this:
<%= radajaxpanel.ClientID %>.ajaxRequestWithTarget('<%= radajaxpanel.UniqueID %>', eventArgs.get_item().get_value() + '|' + ID + '|' + isDelete);                    
and getting this error:
 
Microsoft JScript runtime error: Unable to get value of the property 'ajaxRequestWithTarget': object is null or undefined
 
I tried to change the code to 
var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
 
ajaxManager.ajaxRequestWithTarget('<%= radajaxpanel.UniqueID %>', eventArgs.get_item().get_value() + '|' + ID + '|' + isDelete);
 

and Its working. But I want to use ajaxRequestWithTarget with ajaxPanel.
 
I am wondering if anyone came across this issue before. Thanks in advance. 
Jayesh Goyani
Top achievements
Rank 2
 answered on 27 Jul 2012
1 answer
105 views
I've noticed that any page that I create that has a radcaptcha on it, causes the warning in Internet Explorer saying "The webpage wants to run the following add-on: 'Windows Media Player' from 'Microsoft Corporation'.

Once you've accepted this once, it doesnt come up again on the client IE browser.  Of course, this warning doesn't pop up in Chrome of FireFox.

Does anyone have any thoughts on this issue, or am I basically screwed for people that use IE (that is, they have to accept the warning - something that I'm worried may scare people away if they see that come up)?

Thanks.
Slav
Telerik team
 answered on 27 Jul 2012
3 answers
171 views
I am experiencing issues with line breaks being added/removed, text being moved around, and font sizes/weight/type changing after saving using the radeditor.  Even on the demo site, if I paste in the content, switch the editor from enabled to disabled, I see line breaks being added. I am using paragraphs, not breaks. What is going on here and is there a setting I can add to stop this from occuring?

More Info: I am using version 2012.1.411.35. Browser is IE8.

I have attached before and after saving images.


Dobromir
Telerik team
 answered on 27 Jul 2012
0 answers
51 views
here is my code:
  
        <telerik:RadDataPager CssClass="rdpWrap" runat="server"
                ID="Pager" PagedControlID="rptq" AllowSEOPaging="True"
    AllowRouting="True" RouteName="q" PageSize="15"
        RoutePageIndexParameterName="pager" Width="330px"
              ontotalrowcountrequest="Pager_TotalRowCountRequest" Culture="fa-IR" Skin="Outlook">
    <Fields>
        <telerik:RadDataPagerButtonField FieldType="Numeric" PageButtonCount="15"
            HorizontalPosition="RightFloat" />
    </Fields>
</telerik:RadDataPager>
     
    <br/>
    <br/>
    <cc1:DataPagerRepeater ID="rptq" DataSourceID="dsq" runat="server">
        <ItemTemplate>
            <blockquote><%#Eval("content")%></blockquote>
            <b><a href="/jomalat/<%#Eval("F_name") %>-<%#Eval("L_name")%>/<%#Eval("author_id")%>"><%#Eval("F_name")%> <%#Eval("L_name")%></a></b>
            <asp:Button runat="server"/>
            <br/>
            <br/>
        </ItemTemplate>
    </cc1:DataPagerRepeater>
    <telerik:RadDataPager CssClass="rdpWrap" runat="server"
                ID="RadDataPager1" PagedControlID="rptq" AllowSEOPaging="True"
    AllowRouting="True" RouteName="q" PageSize="15"
        RoutePageIndexParameterName="pager" Width="330px"
              ontotalrowcountrequest="Pager_TotalRowCountRequest" Culture="fa-IR" Skin="Outlook">
    <Fields>
        <telerik:RadDataPagerButtonField FieldType="Numeric" PageButtonCount="15"
            HorizontalPosition="RightFloat" />
    </Fields>
</telerik:RadDataPager>

And my problem is the first pager is work fine!
and the second is but when I click on for example on page 4 the first pager show page 4 but the second still on page 1!
I don't know where is the problem! 
Taha
Top achievements
Rank 1
 asked on 27 Jul 2012
1 answer
69 views
Hi,
I've created a website like MSDN, it has a tree at left side and a content placeholder at right.
I want to show contents of a html file at the contentplaceholder by clicking each node of the tree but don't know how.
please help me.
Tooraj
Top achievements
Rank 1
 answered on 27 Jul 2012
2 answers
118 views
Im using the GridAttachmentColumn and have created a file download function in the item command event.  This works ok and I get the 'save' dialogue box and can download the selected file.  The problem is with the RadProgressArea on the page, I use this becuase I also have a file upload function  on the same page, the progress indicator alwatys shows as well as the save dialogue, and it wont shut down.  I dont actually need this for the download.  Is there a  way i can disable it just for the download function ?
Eyup
Telerik team
 answered on 27 Jul 2012
1 answer
49 views
  • Hello, Telerik Team

    I got a problem to register the httphandler for the captcha control. Like this document says I placed this two codes in the web.config

    <httpHandlers>  
          
    <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.CaptchaImageHandler"verb="*" validate="false" />  
    </httpHandlers>  
     
    <handlers>  
         
    <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode"path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.CaptchaImageHandler" />  
    </handlers>


    But as this is done I still get this error on my page.
      

    Server Error in '/' Application.

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

    Parser Error Message: Could not load file or assembly 'Telerik.Cms.Web.UI' or one of its dependencies. The system cannot find the file specified.

    Source Error: 

    Line 61: 			<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
    Line 62: 			<add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/>
    Line 63: <add verb="GET" path="CaptchaImage.axd" type="Telerik.Web.UI.SpamProtection.Captcha.CaptchaImageHandler, Telerik.Cms.Web.UI" />Line 64:     </httpHandlers>
    Line 65: 		<httpModules>

    Source File: C:\Users\jmi01\Desktop\custom-image-editor-updated\Custom_Image_Editor\web.config    Line: 63 

    Assembly Load Trace: The following information can be helpful to determine why the assembly 'Telerik.Cms.Web.UI' could not be loaded.

    === Pre-bind state information ===
    LOG: User = WALBEEKGROEP\jmi01
    LOG: DisplayName = Telerik.Cms.Web.UI
     (Partial)
    LOG: Appbase = file:///C:/Users/jmi01/Desktop/custom-image-editor-updated/Custom_Image_Editor/
    LOG: Initial PrivatePath = C:\Users\jmi01\Desktop\custom-image-editor-updated\Custom_Image_Editor\bin
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\Users\jmi01\Desktop\custom-image-editor-updated\Custom_Image_Editor\web.config
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/ace6216c/3fd55b01/Telerik.Cms.Web.UI.DLL.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/ace6216c/3fd55b01/Telerik.Cms.Web.UI/Telerik.Cms.Web.UI.DLL.
    LOG: Attempting download of new URL file:///C:/Users/jmi01/Desktop/custom-image-editor-updated/Custom_Image_Editor/bin/Telerik.Cms.Web.UI.DLL.
    LOG: Attempting download of new URL file:///C:/Users/jmi01/Desktop/custom-image-editor-updated/Custom_Image_Editor/bin/Telerik.Cms.Web.UI/Telerik.Cms.Web.UI.DLL.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/ace6216c/3fd55b01/Telerik.Cms.Web.UI.EXE.
    LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/ace6216c/3fd55b01/Telerik.Cms.Web.UI/Telerik.Cms.Web.UI.EXE.
    LOG: Attempting download of new URL file:///C:/Users/jmi01/Desktop/custom-image-editor-updated/Custom_Image_Editor/bin/Telerik.Cms.Web.UI.EXE.
    LOG: Attempting download of new URL file:///C:/Users/jmi01/Desktop/custom-image-editor-updated/Custom_Image_Editor/bin/Telerik.Cms.Web.UI/Telerik.Cms.Web.UI.EXE.
    

     


    Version Information: Microsoft .NET Framework Version:2.0.50727.4016; ASP.NET Version:2.0.50727.4016 


    Hope you guyes can help me out with this problem.

    Thanks in advance,

Slav
Telerik team
 answered on 27 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?