Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
128 views
Hi,

I'm trying desperately to find a way to change the template of the row that is being dragged (drag clue). In my application, the user will drag a row from a RadGrid and drop it into a RadScheduler. I want the row that is being dragged to appear like it is when it's dropped  in the scheduler.

I know that the RadGrid doesn't provide any DragItemTemplates, so I will have to do it manually but I can't find the css class that is used by the dragged item. I'm guessing the css of the drag clue item is made in javascript (as every row is different), is there a master div that I can use?

Thanks in advance
Marin
Telerik team
 answered on 10 Oct 2012
1 answer
269 views
hi!!

i have this code in my aspx:

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
            <asp:Table runat="server" CellPadding="0" CellSpacing="0" HorizontalAlign="Center">
                <asp:TableRow runat="server">
                    <asp:TableCell runat="server">
                        <asp:Table runat="server" CellPadding="0" CellSpacing="0">
                            <asp:TableRow runat="server">
                                <asp:TableCell runat="server">
                                    <telerik:RadBarcode runat="server"
                                                        ID="radcodigos"
                                                        Width="100"
                                                        Height="30"
                                                        Font-Size="10px"
                                                        ShowChecksum="false"
                                                        RenderChecksum="false"
                                                        ShowText="true"></telerik:RadBarcode>

                                </asp:TableCell>
                            </asp:TableRow>
                        </asp:Table>
                    </asp:TableCell>
                </asp:TableRow>
            </asp:Table>      
        </telerik:RadAjaxPanel>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None">
        </telerik:RadAjaxLoadingPanel>


this barcode i'm load in the follow function:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            lbltipocodigoID.Text = Request.Params("tipocodigoID")
            lblcodigo.Text = Request.Params("codigo")

            radcodigos.Text = Val(lblcodigo.Text)

            Select Case lbltipocodigoID.Text
                Case "1"
                    radcodigos.Type = BarcodeType.EAN13
                Case "2"
                    radcodigos.Type = BarcodeType.EAN8
            End Select
        End If
    End Sub


in the file "img_barcode.png" you can see my problem better.
plase i need implements this barcode for my aplication. thanks.
Kostadin
Telerik team
 answered on 10 Oct 2012
1 answer
117 views
as I can lift a pop-up with a key combination, after selecting edit in a column, an item RaGrid??
Andrey
Telerik team
 answered on 10 Oct 2012
1 answer
68 views

Hello all,

While executing the application i am getting Script Error in user Control Page.What i am doing in my ASPX.Cs page i have used User Control and again in that user control i have used another user control which is opened through Rad Window.Is it correct thing to use user control in an another user control.

script Error : Object Undefined :

actually process ---> aspx.Cs---> usercontrol1---->(Rad window)user control2

unable to find the solution for the last few hours.Suggest me the best way to get over it

Thanks in advance

Marin Bratanov
Telerik team
 answered on 10 Oct 2012
1 answer
121 views
Hello all,

While executing the application i am getting Script Error in user Control Page.What i am doing in my ASPX.Cs page i have used User Control and again in that user control i have used another user control which is opened through Rad Window.Is it correct thing to use user control in an another user control.

script Error : Object Undefined :

actually process ---> aspx.Cs---> usercontrol1---->(Rad window)user control2

unable to find the solution for the last few hours.Suggest me the best way to get over it

Thanks in advance

Marin Bratanov
Telerik team
 answered on 10 Oct 2012
5 answers
82 views
Hello,

Id like to have the built in "Add new record" at the top of my grid, but instead of opening an input form in the grid id like to link to a form of my own instead.

How can i do this?

Thanks
Robert
Top achievements
Rank 1
 answered on 10 Oct 2012
19 answers
730 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
147 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
162 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
172 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?