Telerik Forums
UI for ASP.NET AJAX Forum
19 answers
691 views
Hi,

I'm having some problems working with recurring appointments.  I am currently using the latest Q3 2009 .NET 2.0 version of Telerik, but I have tried the Q1 2010 controls and got the same problems.

I am recording the RecurrenceRule and RecurrenceParentID in the database, and the calendar entries are appearing on the scheduler properly.  The problem comes when I try to edit.

By looking at the properties of the appointments as they are created from the data, I have noticed some strange things occurring.

  • The "Master" record, the one with the recurrence rule in it, is created as type Exception in the scheduler.  

Now, I can override this in the AppointmentCreated event and force it to a RecurrenceState of Master, but then I get other problems:

  • If the type is Master, the "Edit this occurrence" generates an "Object not set to an instance of an object" error.

I have also found that

  • The "Edit the series" option seems to fail if the RecurrenceParentID value is not set, 

Which means that you can't edit the series from the master appointment unless you also set the RecurrenceParentID.

Using the "Reset exceptions" option gives me either:
  1. An "Object reference not set to an instance of an object" error if the RecurrenceParentID is not set on the master, or
  2. If the RecurrenceParentID is set, all occurrences are removed, including the master (presumably because it removes anything with the RecurrenceParentID set to the master value)

If you can tell me what I might be doing wrong, I would much appreciate it, since no-one else seems to be having these problems!

I was also having problems with non-recurring appointments being created in the calendar as Exceptions, but I think this is because I was not ensuring the RecurrenceRule was set to Nothing instead of an empty string, and this now works.

Regards,

Dan

Plamen
Telerik team
 answered on 10 Oct 2012
4 answers
130 views
Hi I am currently using the latest version of rad controls asp.net ajax V 2012.2.912.40

and on the editor if i open up the image manager it opens up the rad window but strteches to 100% the height of the body size I also noticed the exact same error on the web demo

Browser is am using is Firefox 15.0.1 on windows 7 64 bit.


Birgit
Top achievements
Rank 1
 answered on 10 Oct 2012
5 answers
132 views
Hello,

I am using version 2011.2.816 of the ASP.NET AJAX grid control and seem to be experiencing some issues with EditInPlace and the GridHTMLEditor column. In particular, when adding or updating a row, the text value obtained from the GridHTMLEditorColumn control is always empty. I noticed that if I removed the grid from the AjaxManager Ajax settings or if I changed the edit command column button type to LinkButton (or PushButton), everything would work fine.

Provided is a sample of the markup and code behind that will reproduce the problem.

<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
        <div>
            <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
        </div>       
    </form>
</body>
</html>




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;
 
public partial class Default3 : System.Web.UI.Page
{
 
    protected RadGrid RadGridNote = null;
 
 
    private int NoteId
    {
        get
        {
            if (ViewState["Id"] == null)
            {
                ViewState["Id"] = 0;
            }
            ViewState["Id"] = (int)ViewState["Id"] + 1;
 
            return (int)ViewState["Id"];
        }      
    }
 
    private List<Note> NotesList
    {
        get
        {
            if (ViewState["NotesList"] == null)
            {
                // Initialize list.
                List<Note> list = new List<Note>();
 
                Note note;
 
                note = new Note();
                note.NoteId = NoteId;
                note.NoteText = "This is the first note.";
                list.Add(note);
 
                note = new Note();
                note.NoteId = NoteId;
                note.NoteText = "This is the seconds note.";
                list.Add(note);
 
                ViewState["NotesList"] = list;
            }
            return (List<Note>)ViewState["NotesList"];
        }
 
        set { ViewState["NotesList"] = value; }
    }
     
 
    override protected void OnInit(EventArgs e)
    {    
        base.OnInit(e);
      
        InitializeGridNote();
    }
 
    protected void Page_Load(object sender, EventArgs e)
    {
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadGridNote, RadGridNote);
    }
 
    private void InitializeGridNote()
    {
 
        GridBoundColumn boundColumn;
        GridButtonColumn buttonColumn;
        GridEditCommandColumn editCommandColumn;
        GridHTMLEditorColumn htmlEditorColumn;
 
 
        this.RadGridNote = new RadGrid();
 
        // Set required event handlers.
        RadGridNote.NeedDataSource += new GridNeedDataSourceEventHandler(RadGridNote_NeedDataSource);
        RadGridNote.InsertCommand += new GridCommandEventHandler(RadGridNote_InsertCommand);
        RadGridNote.UpdateCommand += new GridCommandEventHandler(RadGridNote_UpdateCommand);
        RadGridNote.DeleteCommand += new GridCommandEventHandler(RadGridNote_DeleteCommand);
 
        RadGridNote.ID = "RadGridNote";
        RadGridNote.AutoGenerateColumns = false;
        RadGridNote.AllowMultiRowEdit = false;
        RadGridNote.AllowSorting = true;
        RadGridNote.Width = Unit.Percentage(100);       
         
        RadGridNote.ClientSettings.Selecting.AllowRowSelect = true;
 
        RadGridNote.MasterTableView.DataKeyNames = new string[] { "NoteId" };
        RadGridNote.MasterTableView.DataMember = "Note";
 
        RadGridNote.MasterTableView.EditMode = GridEditMode.InPlace;
        RadGridNote.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
        RadGridNote.MasterTableView.CommandItemSettings.AddNewRecordText = "Add New Note";
 
        // Edit button.
        editCommandColumn = new GridEditCommandColumn();
        RadGridNote.MasterTableView.Columns.Add(editCommandColumn);
        editCommandColumn.ButtonType = GridButtonColumnType.ImageButton;
        editCommandColumn.UniqueName = "EditCommandColumn";
        editCommandColumn.ItemStyle.Width = Unit.Percentage(10);
 
        // Delete button.
        buttonColumn = new GridButtonColumn();
        RadGridNote.MasterTableView.Columns.Add(buttonColumn);
        buttonColumn.ButtonType = GridButtonColumnType.ImageButton;
        buttonColumn.UniqueName = "DeleteCommandColumn";
        buttonColumn.CommandName = "Delete";
        buttonColumn.ItemStyle.Width = Unit.Percentage(5);
 
        boundColumn = new GridBoundColumn();
        RadGridNote.MasterTableView.Columns.Add(boundColumn);
        boundColumn.ReadOnly = true;
        boundColumn.UniqueName = "NoteId";
        boundColumn.DataField = "NoteId";
        boundColumn.HeaderText = "Id";
        boundColumn.ItemStyle.Width = Unit.Percentage(10);
 
        htmlEditorColumn = new GridHTMLEditorColumn();
        RadGridNote.MasterTableView.Columns.Add(htmlEditorColumn);
        htmlEditorColumn.UniqueName = "NoteText";
        htmlEditorColumn.DataField = "NoteText";
        htmlEditorColumn.HeaderText = "Note";
        htmlEditorColumn.ItemStyle.Width = Unit.Percentage(75);
 
        PlaceHolder1.Controls.Add(RadGridNote);
    }
 
    void RadGridNote_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        RadGridNote.MasterTableView.DataSource = NotesList;       
    }   
 
    void RadGridNote_InsertCommand(object sender, GridCommandEventArgs e)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        GridEditManager editManager = editedItem.EditManager;
 
        Note note = new Note();
 
        note.NoteId = NoteId;
        note.NoteText = (editManager.GetColumnEditor("NoteText") as GridHTMLEditorColumnEditor).Editor.Content;
 
        NotesList.Add(note);
    }   
 
    void RadGridNote_UpdateCommand(object sender, GridCommandEventArgs e)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        GridEditManager editManager = editedItem.EditManager;
 
        // Obtain the ID for the contract step.
        int noteId = int.Parse(editedItem.GetDataKeyValue("NoteId").ToString());
 
        Note foundNote = NotesList.Find(delegate(Note note) { return (note.NoteId == noteId); });
        if (foundNote != null)
        {
            foundNote.NoteText = (editManager.GetColumnEditor("NoteText") as GridHTMLEditorColumnEditor).Editor.Content;
        }
    }
 
    void RadGridNote_DeleteCommand(object sender, GridCommandEventArgs e)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        GridEditManager editManager = editedItem.EditManager;
 
        // Obtain the ID for the contract step.
        int noteId = int.Parse(editedItem.GetDataKeyValue("NoteId").ToString());
 
        Note foundNote = NotesList.Find(delegate(Note note) { return (note.NoteId == noteId); });
        if (foundNote != null)
        {
            NotesList.Remove(foundNote);
        }
    }
 
 
    [Serializable]
    private class Note
    {
        public int NoteId
        {
            get;
            set;
        }
 
        public string NoteText
        {
            get;
            set;
        }
    }
 
}


Any help in resolving this issue would be greatly appreciated.
Thanks,

Tony
Maria Ilieva
Telerik team
 answered on 10 Oct 2012
2 answers
144 views
I have developed a page where I have used the following controls:

RadGrid
RadTabStrip
RadDatePicker
RadNumericTextBox

On this page caching is enabled so every control I use here on the page I need to set the following properties:

EnableEmbeddedBaseStylesheet = false;
EnableEmbeddedScripts = false;
EnableEmbeddedSkins = false;
RegisterWithScriptManager = false;


I have added the scripts of the controls dynamically in my MasterPage via the following code snippet:

var scripts = new List<ScriptReference>();
 
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadGrid)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadTabStrip)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadMultiPage)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadComboBox)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadInputManager)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadFilter)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadMenu)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadContextMenu)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadInputControl)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadMaskedTextBox)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadToolTip)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadToolTipManager)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadNumericTextBox)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadUpload)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadAsyncUpload)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadTreeView)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadTextBox)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadCalendar)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadDatePicker)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadDateTimePicker)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadMonthYearPicker)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadTimeView)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadTimePicker)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadDateInput)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadScriptManager)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadAjaxManager)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadToolBar)));
scripts.AddRange(ScriptObjectBuilder.GetScriptReferences(typeof(RadDate)));
 
foreach (var script in scripts)
   RadScriptManager1.Scripts.Add(script);

The above code section works because all other controls work how they should be except the RadNumericTextBox.

On that page which I have developed I have a RadTabStrip with two tabs. In the second tab I have rendered the RadNumericTextBox via the codebehind with the following code:

var ctl = new RadNumericTextBox();
ctl.ID = "RandomId";
ctl.NumberFormat.AllowRounding = false;
ctl.NumberFormat.DecimalDigits  = 0;
ctl.NumberFormat.GroupSeparator = "";
ctl.MinValue = 1;
ctl.MaxValue = int.MaxValue;
ctl.ClientEvents.OnKeyPress = "onKeyPress";
ctl.ClientEvents.OnBlur = "onBlur";
ctl.Value = 1;
ctl.EnableEmbeddedBaseStylesheet = false;
ctl.EnableEmbeddedScripts = false;
ctl.EnableEmbeddedSkins = false;
ctl.RegisterWithScriptManager = false;

Which have some client events which are not worth to mention because they validate if the user presses ',' that this is not allowed in the RadNumericTextBox and when the user leaves the RadNumericTextBox and it is empty that the value is reset to the default (minimal value).

The problem is that sometimes the RadNumericTextBox works but when I press CTRL + F5 or just restart my webpage the RadNumericTextBox does not work anymore. Somehow client events are not triggered when the user interacts with this RadNumericTextBox.

I have validated that the $create method is rendered on the page and also is called. Based on this idea (because we had a similair problem before with the RadTabStrip) I have decided to add an additional client event: onNumericClientLoad which simulates again the $create method. Somehow this doesn't work either.

    $create(Telerik.Web.UI.RadNumericTextBox, {
        "_displayText": sender.get_value(),
        "_focused": false,
        "_initialValueAsText": sender.get_value(),
        "_postBackEventReferenceScript": sender._postBackEventReferenceScript,
        "_skin": sender._skin,
        "_validationText": sender.get_value(),
        "clientStateFieldID": sender._clientStateFieldID,
        "enabled": true,
        "incrementSettings": { InterceptArrowKeys: true, InterceptMouseWheel: true, Step: 1 },
        "maxValue": sender.get_maxValue(),
        "minValue": sender.get_minValue(),
        "numberFormat": { "DecimalDigits": 0, "DecimalSeparator": ",", "CultureNativeDecimalSeparator": ",", "GroupSeparator": "", "GroupSizes": 3, "NegativePattern": "-n", "NegativeSign": "-", "PositivePattern": "n", "AllowRounding": false, "KeepNotRoundedValue": false, "KeepTrailingZerosOnFocus": false, "NumericPlaceHolder": "n" },
        "styles": { HoveredStyle: ["width:160px;", "riTextBox riHover"], InvalidStyle: ["width:160px;", "riTextBox riError"], DisabledStyle: ["width:160px;", "riTextBox riDisabled"], FocusedStyle: ["width:160px;", "riTextBox riFocused"], EmptyMessageStyle: ["width:160px;", "riTextBox riEmpty"], ReadOnlyStyle: ["width:160px;", "riTextBox riRead"], EnabledStyle: ["width:160px;", "riTextBox riEnabled"], NegativeStyle: ["width:160px;", "riTextBox riNegative"] }
    }, { "keyPress": onKeyPress, "blur": onBlur }, null, $get(sender.get_id()));  


I'm really lost now why this is not working, I hope someone can help me to get the client events working with this RadNumericTextBox.

Details:
Development Environment: Visual Studio 2010 Professional
Framework: .NET 4.0
Controls: ASP.NET Controls
Version: 2012.2.912.40

Michiel
Top achievements
Rank 1
 answered on 10 Oct 2012
2 answers
224 views
Hi,

I have a RadGrid that is created dynamically in the code-behind file from the Page_Init event stage, so everything is constructed here.

The grid contains several columns of data, and three hyperlink columns on the far right side of the grid. Each has a javascript function assigned to the NavigateUrl property in the ItemDataBound event handler in the code behind page.

I need to capture the onkeypress javascript event when the user tabs past the last column in the row being edited to trigger an ajax postback so the row being added can be processed and added to the grid's underlying datasource, and a new row automatically added to the end of the grid.

I have no problems getting this behavior out of a GridBoundColumn or a GridDropdownColumn by assigning the onkeypress javascript event to the edit controls in those columns, but cannot get it to work with the hyperlink controls.

I had zero luck in getting the GridHyperlinkColumn to capture the Tab key. Pressing the Tab key simply moved the focus from this control to the next control (in this case, the address bar).

So, then I thought I'd use the GridButtonColumn, using a LinkButton as the button type. I got the onkeypress event to fire when pressing the Enter key, but not the Tab key. The other problem I noticed is that if I set the ShowInEditForm property to true, then the buttons do not render for the GridDataItems (rows not being edited), and if I do not set the ShowInEditForm property, they do not render in the row being edited. I cannot figure out how to get the buttons to display in BOTH types of rows.

Is what I am wanting to accomplish even possible? Optimally, I would like to get the GridHyperlinkColumn to work as I describe above, but I cannot figure out how to get the rendered hyperlink to behave as expected.
Antonio Stoilkov
Telerik team
 answered on 10 Oct 2012
2 answers
227 views
Hello,

I'm having difficulties when trying to add the following functionality to my RadGrid.

I have a RadGrid with a GridTableView inside the DetailTables section of the RadGrid. I've set the CommandItemDisplay so the commands are visible to the user; however, when a command is used, like "Add New Record", the Master Grid's ItemCommand event is fired and the CommandName is "InitInsert". The issue I have is that the master RadGrid also has commands, which will insert/update/delete records in a different table than the GridTableView Commands would update records in. I have been unable to determine how to identify whether or not the command is coming from the Master RadGrid or the GridTableView. Is there a way to determine that the user clicked the DELETE command of the detail table and not of the master table?

Any assistance would be appreciated.

Thanks!
Casey
Jack
Top achievements
Rank 1
 answered on 10 Oct 2012
1 answer
59 views
I was wondering if it is possible to manipulate the intervals of the HoursPanel.
In this case the hours are fixed lesson hours being:

8.30-8.55 (25")
8.55-9.20 (25")
9.20-9.45 (25")

9.45-10.10 (15")

10.25-10.50 (25")
10.50-11.15 (25")
11.15-11.40 (25")
11-40-12.05 (25")

12.05-13.15 (70")

13.15-13.40 (25")
etc...

Using MinutesPerRow="5" And TimeLabelRowSpan="1" just doesn't cut it.
These blocks are always the same and I can't seem to find any way to customize the HoursPanel.

Is there any way I can do this? By inheriting the control and manipulating some properties perhaps?

Thank you in advance!

Frederik R.
Plamen
Telerik team
 answered on 10 Oct 2012
3 answers
457 views
HI,  I see you guys get this a lot but I couldn't find a recent one that had a similar circumstance - so here goes.  I have a very simple website that I developed a registration page for that included radCaptcha.  I then began implementing forms authentication and used a location tag in the web.config to make the register.aspx page and App_Themes directory available to anonymous users.  All of that worked until I got to the bottom of the page and found that the captcha image was broken.

After doing some googling on the subject I saw a lot of references to this:

<location path="Telerik.Web.UI.WebResource.axd">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>

Unfortunately VS2010 does not seem to know where Telerik.Web.UI.WebResource.axd is (I get the blue squigly from resharper telling me it can't be found).  I have an entry in httHandlers and handlers groups for the axd.  Kind of at a dead stop at the moment - I just got the latest subscription so I know I'm up to date and as noted at the start of this post it worked fine when I didn't the forms authentication implemented.

Thanx,

Eric

Princy
Top achievements
Rank 2
 answered on 10 Oct 2012
1 answer
50 views
hiii all,
     can anyone help me?
i am using telerik grid. Problem is when i click on export to excel link button while grid is empty.
in excel i am not getting anything.
i want to show headers of the grid in the excel sheet.
Shinu
Top achievements
Rank 2
 answered on 10 Oct 2012
2 answers
138 views
I have followed the code snippets from other posts on this issue to add a linkbutton to the group headers of my radgrid but on clicking the linkbutton's I get an object not specified error.

I'm adding the following code, where item is the gridgroupheaderitem and then handling the command in the radgrid_itemcommand event.
the code is added in both the radgrid_itemcreated and radgrid_itemdatabound events.
protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridGroupHeaderItem)
        {
            createbutton((GridGroupHeaderItem)e.Item);
 
        }
    }
    protected void createbutton(GridGroupHeaderItem header)
    {
        if (header.DataCell.FindControl("thisGroup") == null)
        {
            Label mylab = new Label();
            mylab.ID = "thisNumber";
            DataRowView drv = header.DataItem as DataRowView;
            mylab.Text = drv["Location"].ToString();
            Label mylabno = new Label();
            mylab.ID = "thisGroup";
 
            mylabno.Text = drv["GroupOrder"].ToString();
            mylabno.Visible = false;
            GridGroupHeaderItem item = header as GridGroupHeaderItem;
            LinkButton lnk = new LinkButton();
            lnk.Text = "Move up ";
            lnk.Style.Add("margin", "3px");
            LinkButton xnk = new LinkButton();
            xnk.Text = "Move down";
            xnk.Style.Add("margin", "2px");
            xnk.Style.Add("padding", "2px");
 
            item.DataCell.Controls.Add(mylab);
            item.DataCell.Controls.Add(mylabno);
            lnk.CommandName = "Up";
            item.DataCell.Controls.Add(lnk);
            xnk.CommandName = "Down";
            item.DataCell.Controls.Add(xnk);
        }
    }


I'm guessing its related to the fact this radgrid is ajaxified, but not entirely sure.  any ideas??
Morgan
Top achievements
Rank 2
 answered on 10 Oct 2012
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?