Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
158 views

A couple of weeks ago, there was an error of an invalid json primitive. From reading about it, it's basically that the json is improperly setup. The error log below seems to trace that to the Rad date picker. However, the only client scripts I am using for that control is resizing it and focusing on the input box. I do not think that would be the problem.  What strange is that there is more than 25 errors with this error that happened within a minute from the same IP Address. Could this be a bot or something else?

Error:   Invalid JSON primitive: ovAA
Stack Trace:   at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject() at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) at Telerik.Web.UI.RadWebControl.LoadPostData(String postDataKey, NameValueCollection postCollection) at Telerik.Web.UI.RadDatePicker.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Vasil
Telerik team
 answered on 20 Dec 2016
9 answers
340 views

I am handling opening file by myself in browser, but this empty, small preview window also opens when file is double-clicked.

how to disable, hide it or close it?   I don't want to disable fileopen event though.

thank you

Vessy
Telerik team
 answered on 20 Dec 2016
13 answers
545 views
Hello, 

I am using this method to save a local PDF from a radeditor when a form is submitted:  http://blogs.telerik.com/blogs/posts/08-12-08/how-to-export-grid-to-pdf-file-and-show-the-result-using-the-window.aspx 

But this sends the PDF to the client as well. 

How can I save a PDF to the server without sending a copy to the client? 



Ianko
Telerik team
 answered on 20 Dec 2016
5 answers
182 views

Hi, I got confused with all the threads I've read and I wasn't able to find an answer to my problem.

I have a RadGrid bound to RadClientDataSource. I'm using ClientItemTemplate to format my data in a single cell and my column does not have a header. 

So each data item occupies a single cell per row.

I want to know how I can group/ungroup the grid using a checkbox.

I was able to group by declaring the grouping in the grid but I want to achieve this using the checkbox.

 

One of the data field in the cell is a date, I want to sort my grid based on this field in a descending order.

How can I do it?

ps. type is string representing the name of the typeid.

<telerik:RadClientDataSource ID="AlarmClientDataSource" runat="server" AutoSync="True">
    <ClientEvents OnDataParse="AlarmClientDataSource_OnDataParse" OnChange="AlarmClientDataSource_OnChange" />
    <SortExpressions>
        <telerik:ClientDataSourceSortExpression FieldName="Created" SortOrder="Desc" />
    </SortExpressions>
    <Schema DataName="Result" ResponseType="JSON" ErrorsName="ErrorMessage">
        <Model ID="ID">
            <telerik:ClientDataSourceModelField FieldName="ID" DataType="String" Nullable="true" Editable="False" />
            <telerik:ClientDataSourceModelField FieldName="TypeID" DataType="String" Nullable="false" Editable="False" />
            <telerik:ClientDataSourceModelField FieldName="Created" DataType="Date" />
        </Model>
    </Schema>
</telerik:RadClientDataSource>
<telerik:RadCheckBox ID="AlarmGroupCheckBox" runat="server" Text="Group Alarms By Type" Width="100%" RenderMode="Classic"
            AutoPostBack="False" OnClientCheckedChanged="AlarmGroupCheckBox_OnClientCheckedChanged">
        </telerik:RadCheckBox>
        <telerik:RadGrid ID="AlarmGrid" runat="server" ClientDataSourceID="AlarmClientDataSource" Width="100%"
            AutoGenerateColumns="False" RenderMode="Lightweight" Skin="Material" CssClass="noWrapRadGrid">
            <ClientSettings AllowGroupExpandCollapse="true">
                <Selecting CellSelectionMode="SingleCell"></Selecting>
                <ClientEvents OnCellSelected="AlarmGrid_CellSelected" OnCellSelecting="AlarmGrid_CellSelecting" OnGridCreated="gridCreated"></ClientEvents>
            </ClientSettings>
            <SortingSettings SortedBackColor="#FFF6D6" EnableSkinSortStyles="false"></SortingSettings>
            <MasterTableView ShowHeader="False" AllowNaturalSort="True">
                <%--<SortExpressions>
                      <telerik:GridSortExpression FieldName="Created" SortOrder="Descending" />
                </SortExpressions>--%>
                <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldAlias="Type" FieldName="type"></telerik:GridGroupByField>
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="type" />
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
                <Columns>
                    <telerik:GridTemplateColumn UniqueName="Alarms">
                        <ClientItemTemplate>  
                            <table>
                                <tr>
                                    <td>
                                        <div class="alarm">
                                            <div class="alarm-wrapper">
                                                <div style="color:red; font-weight:bold">Alarm: #: ID #</div>
                                                <dl class="alarm-list-details">
                                                    <dt class="name">#= fecha.format(Created, 'YYYY-MM-DD hh:mm:ss A') #</dt>
                                                </dl>
                                            </div>                     
                                        </div>
                                    </td>
                                </tr>
                            </table>             
                        </ClientItemTemplate>
                    </telerik:GridTemplateColumn>             
                </Columns>
            </MasterTableView>
            <GroupingSettings ShowUnGroupButton="true" />
        </telerik:RadGrid>
    </ItemTemplate>
</telerik:RadPanelItem>
Marin
Telerik team
 answered on 20 Dec 2016
1 answer
355 views

Good day Telerik Community,

I'm starting at Telerik and I need help with Custom Skins and web resources for showing Icons.

I have made my custom Skin that is the same as the Old Forest Skin One, it's all good with my DLL until I see Icons ("Edit","Delete","Ok","Cancel", etc.). This Icons are not showing (Html broken Image shown and Alt shown), I want to know how to call the Image from the DLL web resource and not through the File itself (for example: ~/Image/Edit.gif, is what I'm doing now but I want to call it from the Web Resource to keep independance of the Skin).

I hope I'm clear with my trouble I am having,

I hope you can help me Solve it :)...

Thanks for Reading,

Bozhidar
Telerik team
 answered on 20 Dec 2016
3 answers
197 views

Hi all,

So im having a problem with de radcombobox, i have a combobox getting values from the database, no problem there, the problem starts when i selecta a option, and then is i select the combobox, and no value is selected, and i press autside de combobox to get out of the selection the box loses the value previously selected.

 

Does anybody ave any ideas?

 

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 19 Dec 2016
6 answers
265 views
Hi,

  I need an example project on rad window.
senario :: On click of the button an rad dailog window should be opened ( which has 2 text boxs). entering the value in the 2 textboxs
and on click of "ok" button the dailog box will be close. here i need that 2 textbox values in my parent form.

I had used your below exmaple code, here i was getting null value at args.get_argument(); statement
 function openWin()
        {
            var oWnd = radopen("Dialog1.aspx", "RadWindow1");
        }
        
        function OnClientClose(oWnd,args)
        {
            //get the transferred arguments
            var arg = args.get_argument();
            if(arg)
            {
                var cityName = arg.cityName;
                var seldate = arg.selDate;
                $get("order").innerHTML = "You chose to fly to <strong>" + cityName + "</strong> on <strong>" + seldate + "</strong>";
            }
        }
        //]]>
    </script>

    <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
        ReloadOnShow="true" runat="server" Skin="Sunset">
        <Windows>
            <telerik:RadWindow ID="RadWindow1" Behaviors="Close" OnClientClose="OnClientClose"
                NavigateUrl="Dialog1.aspx">
            </telerik:RadWindow>
            <telerik:RadWindow ID="RadWindow2" Width="650" Height="445" Modal="true" NavigateUrl="Dialog2.aspx">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <div id="offsetElement" class="bigModule" style="height: 400px; padding: 8px;">
        <p>
            Click the button to open the Travel Planner form in a RadWindow.
        </p>
        <button onclick="openWin(); return false;">
            Choose Destination and date</button>
        <div id="order" class="orderText">
            <!---->
        </div>
        <br />
        <br />
    </div>

Marin Bratanov
Telerik team
 answered on 19 Dec 2016
3 answers
319 views

I need to display the large number in exponential notation format.

When I enter more than 15 digit number which is "12345678901234567890" into the RadNumericTextBox

Value automatically gets rounded as 12345678901234560000.(Zero at the end) which is wrong.

But,
When I enter more than 21 digits number "1234567890123456789012"
then the value gets displayed as "1.234567890123457e+21" which is working perfectly

So the problem is in between the range 16 - 21 Digits. 

Please help to resolve this problem.


Using IE.9,Chrome,Firefox
VS2012
Telerik version : 2014.1.416.40


My Code
<telerik:RadNumericTextBox Width="100px" ID="txtTest" EmptyMessage="Test" ShowSpinButtons="false" DisplayText="" Type="Number"
                                runat="server" InvalidStyleDuration="100">
                                <NumberFormat AllowRounding="false" GroupSeparator="" DecimalDigits="15"   KeepNotRoundedValue="true" />
                                <ClientEvents OnKeyPress="keyPress" OnValueChanged="valueChanged"  />
</telerik:RadNumericTextBox>
 
Telerik.Web.UI.RadNumericTextBox.prototype._compileRegEx = function () {
                        var regexDecimalSeparator = this.get_numberFormat().DecimalSeparator == "." ? "\\." : this.get_numberFormat().DecimalSeparator;
                        this._acceptRegExp = new RegExp("[e0-9" + regexDecimalSeparator + this.get_numberFormat().NegativeSign + "]{1}");
                        this._rejectRegExp = new RegExp("[^e0-9" + regexDecimalSeparator + this.get_numberFormat().NegativeSign + "]{1}", "g");
                        this._decimalReplaceRegExp = new RegExp(regexDecimalSeparator, "g");
                    };
 
                    var orgNegativeSign = "";
                    function keyPress(sender, args) {
                        if (args.get_keyCode() == 45) {
                            orgNegativeSign = sender.get_numberFormat().NegativeSign;
                            sender.get_numberFormat().NegativeSign = "~";
                        }
                    }                
 
                     
                    function valueChanged(sender, args) {
                        if (orgNegativeSign != "") {
                            sender.get_numberFormat().NegativeSign = orgNegativeSign;
                            orgNegativeSign = "";
                        }                      
                    }
Viktor Tachev
Telerik team
 answered on 19 Dec 2016
1 answer
292 views
I am trying to do an insert in editForm in a RadGrid nested in another RadGrid's editform.  I need a way to tell the parent grid to close its editForm.



I have a RadGrid (RadGridMain) that lets the user display and edit some data.  It works fine for update and delete.

In order to do inserts and updates using slightly different processes, I have an Edit.ascx and an Insert.ascx.  The OnItemCommand adjusts the user control appropriately like:

01.protected void RadGridMain_OnItemCommand(object sender, GridCommandEventArgs e)
02.{
03.    if (e.CommandName == RadGrid.InitInsertCommandName)
04.    {
05.        RadGridMain.MasterTableView.EditFormSettings.UserControlName = "~/Insert.ascx"
06. 
07.        // Set up the control
08.        Control control = Page.LoadControl("~/Insert.ascx");
09.        RadGrid radGridInsert = control.FindControl("radGridInsert") as RadGrid;
10. 
11.        radGridInsert.NeedDataSource += RadGridInsertSelector_OnNeedDataSource;
12. 
13.        // give the child a handle to the parent
14.        PSC.Controls.UdcsConnectionInsert.ParentRadGrid = RadGridMain;
15.    }
16.    else if (e.CommandName == RadGrid.EditCommandName)
17.    {
18.        RadGridMain.MasterTableView.EditFormSettings.UserControlName = "~/Edit.ascx";
19.    }
20.}


The reason that I am loading the insert control and assigning the NeedDataSource is that I am doing this in SharePoint, and this seems to be the best way.


So, the insert.ascx control gives the user a RadGrid (let's call it radGridInsert) to select an item to associate with and then opens up an editform in radGridInsert to do the insert.  Once the insert is done, they click Save and the RadGridInsertSelector editform closes.  This works great.

The catch is that when they save or cancel in the radGridInsert editForm, I want to tell the outer RadGrid (RadGridMain) to stop editing and close its editform.  The only way that I have been able to do it so far is by having a button that calls the cancel command in the ascx outside the RadGridInsertSelector.

In the radGridInsert_OnInsertCommand, I can save the data and close the radGridInsert editform, but I need a way to pass this to the parent so that it closes its editform.

In radGridInsert_OnInsertCommand, I have tried calling
ParentRadGrid.MasterTableView.IsItemInserted = false;


and

GridEditFormItem editFormItem = e.Item as GridEditFormItem;
GridDataItem parentItem = editFormItem.ParentItem;
parentItem.EditFormItem.Edit = false;


Any suggestions would be greatly appreciated.

Thanks
Viktor Tachev
Telerik team
 answered on 19 Dec 2016
25 answers
723 views
Hi

Are there any examples of how to add an appointment to the diary on the client side. I can add an appointment to by database using AJAX but I have to refresh the page to show the new appointment. I'd like to be able to just add it to the scheduler without refreshing the page.

Thanks
Jon
Plamen
Telerik team
 answered on 19 Dec 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?