Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
60 views
Have a grid w/ in-place editing enabled. One of the fields stores a dollar amount (unit price) which is databound to my sql database via an sqldatasource, decimal(10,2) field. The column definition is as follows:

 

<telerik:GridMaskedColumn DataField="UnitPrice" DisplayMask="" 
HeaderText="Unit Price" Mask="$##,###.##" UniqueName="Unit Price" 
DataFormatString="{0:C2}"
<HeaderStyle HorizontalAlign="Center" Width="100px" /> 
<ItemStyle HorizontalAlign="Center" Width="100px" /> 
</telerik:GridMaskedColumn>

 

 

 


Let's take an item with a unit price of $110.00 from the database.

When the grid initially loads, the column properly displays the amount as $110.00

If I click edit, my in-place editing form appears and the input box for the unit price appears as:

$11,0__.00

Suffice to say, this is clearly incorrect. There are other editable columns in the grid... if the user intends to edit a different field (such as description) they also have to "correct" the incorrect unit price -- each and every time they perform an edit operation -- otherwise if they attempt to update w/o correcting it, they receive a "Exception Details: System.FormatException: Input string was not in a correct format." error when trying to update. This is very annoying to the user community.

Why is the masked control displaying the data incorrectly for edit, and how can I correct it so the value is properly displayed on the edit form to avoid this issue?
Vin
Top achievements
Rank 1
 answered on 23 Nov 2010
1 answer
65 views
Have a grid w/ in-place editing enabled. One of the fields stores a dollar amount (unit price) which is databound to my sql database via an sqldatasource, decimal(10,2) field. The column definition is as follows:

 

<telerik:GridMaskedColumn DataField="UnitPrice" DisplayMask="" 
HeaderText="Unit Price" Mask="$##,###.##" UniqueName="Unit Price" 
DataFormatString="{0:C2}"
<HeaderStyle HorizontalAlign="Center" Width="100px" /> 
<ItemStyle HorizontalAlign="Center" Width="100px" /> 
</telerik:GridMaskedColumn>

Let's take an item with a unit price of $110.00 from the database.

When the grid initially loads, the column properly displays the amount as $110.00

If I click edit, my in-place editing form appears and the input box for the unit price appears as:

$11,0__.00

Suffice to say, this is clearly incorrect. There are other editable columns in the grid... if the user intends to edit a different field (such as description) they also have to "correct" the incorrect unit price -- each and every time they perform an edit operation -- otherwise if they attempt to update w/o correcting it, they receive a "Exception Details: System.FormatException: Input string was not in a correct format." error when trying to update. This is very annoying to the user community.

Why is the masked control displaying the data incorrectly for edit, and how can I correct it so the value is properly displayed on the edit form to avoid this issue?
Vin
Top achievements
Rank 1
 answered on 23 Nov 2010
1 answer
59 views
Hi All,
I have a panelbar set up in FullExpandedItem mode.
Inside one of these I have a grid that scrolls.  I have found that on a callback, the grid loses it's scroll position, so I need to track that. Ok, I have that working.
My issue comes when my scrolling code is fired before the expand animation is complete - basically, once the animation is complete, the grid scroll position gets set back to the top.
I have solved it partially by choosing an arbitrary setTimeout number to make my scrolling code fire after the expand animation has finished, but I am having trouble finding out what this is meant to be!
I have an ExpandAnimation Duration of 200, 0 Delay, type OutQuart, but for some reason, I need to wait 500 ms to run my code.  Why is this?  If I use the Duration, it is too soon.  The client event OnClientItemExpand seems to occur when the expansion starts, so is no good to me.
Is there a reliable way to find out whether the animation has completed so that my scrolling code will work without a pause and reliably?
Thanks,
Steele.
Nikolay Tsenkov
Telerik team
 answered on 23 Nov 2010
3 answers
142 views
I have a problem using a rowheight lower than 16.
The appointments in the radscheduler appear smaller than they are and when i resize an appointment it becomes smaller than i really resize.
Peter
Telerik team
 answered on 23 Nov 2010
7 answers
94 views
Hello,

At the moment i have a scheduler inplemented in my application. I made it exactly as in the examples is described. The problem is at the moment, that when there are appointments on the overview, pointing to different timeslots is workign kinda laggy and slow. it takes a while before it lights up the timeslot of one hour where i have my mouse on it. I searched the Telerik forum, for performance problems and im already using the radscriptmanager as well the radstylesheetmanager.

My code is below:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucQuickPlan.ascx.cs"
    Inherits="VEGAS_HPF.Hoofdmenu.Agenda.ucQuickPlan" %>
<%@ Register Src="AdvancedForm.ascx" TagName="AdvancedForm" TagPrefix="scheduler" %>
<style type="text/css">
    .RadScheduler .rsAptSubject
    {
        text-align: left;
        padding: 4px 0 1px;
        margin: 0 0 3px;
        font-size: 12px;
        font-weight: bold;
        color: #369;
        height: 17px;
        border-bottom: 1px solid #99DEFD;
        width: 100%;
    }
    .RadScheduler .rsAdvancedEdit .RadColorPicker label
    {
        text-align: left;
        display: block;
        padding: 0;
    }
</style>
  
<script type="text/javascript">
    //<![CDATA[
  
    // Dictionary containing the advanced template client object
    // for a given RadScheduler instance (the control ID is used as key).
    var schedulerTemplates = {};
  
    function schedulerFormCreated(scheduler, eventArgs) {
        // Create a client-side object only for the advanced templates
        var mode = eventArgs.get_mode();
        if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert ||
                    mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
            // Initialize the client-side object for the advanced form
            var formElement = eventArgs.get_formElement();
            var templateKey = scheduler.get_id() + "_" + mode;
            var advancedTemplate = schedulerTemplates[templateKey];
            if (!advancedTemplate) {
                // Initialize the template for this RadScheduler instance
                // and cache it in the schedulerTemplates dictionary
                var schedulerElement = scheduler.get_element();
                var isModal = scheduler.get_advancedFormSettings().modal;
                advancedTemplate = new window.SchedulerAdvancedTemplate(schedulerElement, formElement, isModal);
                advancedTemplate.initialize();
  
                schedulerTemplates[templateKey] = advancedTemplate;
  
                // Remove the template object from the dictionary on dispose.
                scheduler.add_disposing(function() {
                    schedulerTemplates[templateKey] = null;
                });
            }
  
            // Are we using Web Service data binding?
            if (!scheduler.get_webServiceSettings().get_isEmpty()) {
                // Populate the form with the appointment data
                var apt = eventArgs.get_appointment();
                var isInsert = mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert;
                advancedTemplate.populate(apt, isInsert);
            }
        }
    }
  
    //]]>
</script>
  
<telerik:RadScheduler runat="server" ID="RadScheduler1" Width="750px" OnDataBound="RadScheduler1_DataBound"
    OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" OnClientFormCreated="schedulerFormCreated"
   EnableDescriptionField="true" AppointmentStyleMode="Default"
    OnDataBinding="RadScheduler1_DataBinding" ayStartTime="08:00:00" DayEndTime="22:00:00" WorkDayStartTime="08:00:00" WorkDayEndTime="22:00:00"
    FirstDayOfWeek="Monday" LastDayOfWeek="Friday" HoursPanelTimeFormat="HH:mm" Height="100%"
    ShowViewTabs="false" Skin="Telerik" StartInsertingInAdvancedForm="true" StartEditingInAdvancedForm="true">
    <AdvancedForm Modal="false" />
    <AdvancedEditTemplate>
        <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit" Subject='<%# Bind("Subject") %>'
            Description='<%# Bind("Description") %>' Start='<%# Bind("Start") %>' End='<%# Bind("End") %>'
            RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
            UserID='<%# Bind("intPersoneelID") %>' RoomID='<%# Bind("intKamerID") %>' />
    </AdvancedEditTemplate>
    <AdvancedInsertTemplate>
        <scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Insert" Subject='<%# Bind("Subject") %>'
            Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' Description='<%# Bind("Description") %>'
            RecurrenceRuleText='<%# Bind("RecurrenceRule") %>'
            UserID='<%# Bind("intPersoneelID") %>' RoomID='<%# Bind("intKamerID") %>' />
    </AdvancedInsertTemplate>
    <TimelineView UserSelectable="false" />
    <TimeSlotContextMenuSettings EnableDefault="true" />
    <AppointmentContextMenuSettings EnableDefault="true" />
</telerik:RadScheduler>

And the code behind:

public partial class ucQuickPlan : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //RadScheduler1.ResourceTypes.Add(new ResourceType("User"));
            //RadScheduler1.Resources.Add(new Resource("User", "22", "Alex"));
            //RadScheduler1.Resources.Add(new Resource("User", "24", "Bob"));
  
        }
  
        protected void RadScheduler1_DataBinding(object sender, EventArgs e)
        {
  
  
            string strDateSelected = RadScheduler1.SelectedDate.ToShortDateString();
            //RadScheduler1.DataSource = Agenda_cls.GetAgendaItems(intPersoneelID, strDateSelected);
            RadScheduler1.DataKeyField = "id";
            RadScheduler1.DataStartField = "afspraakdatum";
            RadScheduler1.DataEndField = "afspraakdatumEind";
            RadScheduler1.DataSubjectField = "afspraakopmerkingen";
            //RadScheduler1.GroupBy = "adviseur_id";
            RadScheduler1.GroupingDirection = GroupingDirection.Horizontal;
  
            RadScheduler1.DataSource = cls_VEGAS_HPF.getDataset("exec sp_getAgendaItems", "ConnWB");
  
            RadScheduler1.ResourceTypes.Clear();
  
            DataTable dt_Adviseurs = cls_VEGAS_HPF.getDataTable("Exec sp_HypGetAdviseursInDienst", "ConnHPF");
  
            ResourceType restype1 = new ResourceType("Adviseur");
            restype1.DataSource = dt_Adviseurs;
            restype1.KeyField = "intPersoneelID";
            restype1.TextField = "strNaam";
            restype1.ForeignKeyField = "intPersoneelID";
            RadScheduler1.ResourceTypes.Add(restype1);
  
            DataTable dt_Kamers = cls_VEGAS_HPF.getDataTable("SELECT * FROM tblDLocatieKamer", "ConnHPF");
  
            ResourceType restype2 = new ResourceType("Kamer");
            restype2.DataSource = dt_Kamers;
            restype2.KeyField = "intKamerID";
            restype2.TextField = "strKamerNaam";
            restype2.ForeignKeyField = "intKamerID";
            RadScheduler1.ResourceTypes.Add(restype2);
  
            RadScheduler1.GroupBy = "Adviseur";
        }
  
        protected void RadScheduler1_DataBound(object sender, EventArgs e)
        {
            //RadScheduler1.ResourceTypes.FindByName("User").AllowMultipleValues = true;
            //RadScheduler1.ResourceTypes.FindByName("Room").AllowMultipleValues = false;
        }
  
        protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
        {
            string colorAttribute = e.Appointment.Attributes["AppointmentColor"];
            if (!string.IsNullOrEmpty(colorAttribute))
            {
                int colorValue;
                if (int.TryParse(colorAttribute, out colorValue))
                {
                    Color appointmentColor = Color.FromArgb(colorValue);
                    e.Appointment.BackColor = appointmentColor;
                    e.Appointment.BorderColor = Color.Black;
                    e.Appointment.BorderStyle = BorderStyle.Solid;
                    e.Appointment.BorderWidth = Unit.Pixel(1);
                }
            }
            e.Appointment.ToolTip = e.Appointment.Subject + ": " + e.Appointment.Description;
        }
    }

Any help is much appriciated.

Regards,

Corné
Peter
Telerik team
 answered on 23 Nov 2010
3 answers
173 views
Hi,
I wish that when I change the date with the integrated datepiker also change the date to a calendar outside the radscheduler.
The event is RadScheduler1_NavigationCommand from what I understand, but what is the name of the datepicker for reference?
Thanks a lot
Fabrizio
Peter
Telerik team
 answered on 23 Nov 2010
3 answers
78 views
What is the property of similar ActiveView in WinForms?

I would like to disable and Dayview TimeLineView
Nikolay Tsenkov
Telerik team
 answered on 23 Nov 2010
1 answer
77 views

I have a Telerik RAD Editor in a user control, so I can set defaults in one place to enable me to reuse the control where ever I need a rich text editor. When I add it to a page I want to validate the content property of the editor by using a RequiredFieldValidator control to ensure that the editor has content.

When I load the page I get,

"Control 'radEditor' referenced by the ControlToValidate property of 'ValidateEditor' cannot be validated."

After some research, I discovered decorating the class with [System.Web.UI.ValidationProperty("RadEditor")] will expose the validation property in the markup page, but when I add this attribute, the page doesn't throw the above error, but it is not respecting the RequiredFieldValidator hooked up to the control when I submit the page without content.

Any ideas?

Thanks,
Neil

Rumen
Telerik team
 answered on 23 Nov 2010
4 answers
285 views
Hi,

I created a RadGrid programmatically and added the RadGrid to a PlaceHolder control. The PlaceHolderControl is in a RadPageView.
In the code-behind, how can I programmatically find the RadGrid control when I click on a button?

I have tried the following code but to no avail.
 

 

 

protected void GetVotingsBtn_Click(object sender, EventArgs e)

 

{

 

 

  RadGrid vGrid = null;

 

 

 

 

  PlaceHolder GridPlaceHolder = (PlaceHolder)this.VotingRadPageView.FindControl("GridPlaceHolder");

 

 

 

  if (GridPlaceHolder != null) { vGrid = (RadGrid)this.GridPlaceHolder.FindControl("VRadGrid"); }

 

 

}

 


The value of the vGrid is always null. Please, help.

Thanks in advance.
Jeffrey
Top achievements
Rank 1
 answered on 23 Nov 2010
3 answers
34 views
Hi,

Clicking on the export button opens the document in the browser in IE 7.0. Can you provide a way for it to prompt a dialog box to save instead?

Thanks & Regards
Daniel
Telerik team
 answered on 23 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
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?