Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
65 views
I am using a Telerik skin for my controls in my web application.  I would like to check out the css files that the skin references so I can apply the same look to my asp:label controls.  I installed this particular msi: Telerik.Web.UI_2011_2_712_Dev.msi.

J
J
Top achievements
Rank 1
 answered on 05 Feb 2012
2 answers
122 views
I have a page that has several user controls in it.  The page inherits from a master page, and that master page has a single RadAjaxManager control on it.  Every user control has a RadAjaxManagerProxy that handles ajaxing just the child controls contained inside that user control.  Everything is functional, but there is some behavior I didn't expect.

For example, like I said above, User Control 1 has it's own RadAjaxManagerProxy on it that ajaxifies a RadButton to a RadGrid.  When the button is clicked in User Control 1, the RadGrid is updated as expected; however, User Control 2 is also updated (another user control on the same page with it's own RadAjaxManagerProxy).  Is that behavior expected?  I thought if a button was ajaxified, only the controls specified would be updated when an ajax request was initiated?  So why is User Control 2 updated as well?  Am I misunderstanding the functionality? 
Patrick Rills
Top achievements
Rank 1
 answered on 04 Feb 2012
2 answers
141 views

I had this Error
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
when i tried to add new record.

Update work fine with RadInputManager to validate the textbox/NumuricTextbox.
I think it might be my js conditionalPostback and validateRadUpload for disable ajax to update Image from RadUpload

Here my aspx file

<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="ManageRecipes.aspx.cs" Inherits="GroceryStore.AdminPanel.ManageRecipes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
 
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
            <script type="text/javascript">
                function rowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
 
                function conditionalPostback(sender, eventArgs) {
                    var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
                    if (eventArgs.get_eventTarget().match(theRegexp)) {
                        var upload = $find(window['UploadId']);
 
                        //AJAX is disabled only if file is selected for upload
                        try{
                            if (upload.getFileInputs()[0].value != "") {
                                eventArgs.set_enableAjax(false);
                            }
                        }catch(Error){
                        }
                         
                    }
                }
 
                function validateRadUpload(source, e) {
                    e.IsValid = false;
 
                    var upload = $find(source.parentNode.getElementsByTagName('div')[0].id);
                    var inputs = upload.getFileInputs();
                    for (var i = 0; i < inputs.length; i++) {
                        //check for empty string or invalid extension
                        if (inputs[i].value != "" && upload.isExtensionValid(inputs[i].value)) {
                            e.IsValid = true;
                            break;
                        }
                    }
                }
            </script>
 
        </telerik:RadCodeBlock>
 
 
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                        <telerik:AjaxUpdatedControl ControlID="RadInputManager1" />
                        <telerik:AjaxUpdatedControl ControlID="RadInputManager2" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>
 
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" ClientEvents-OnRequestStart="conditionalPostback">
<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None" OnNeedDataSource="RadGrid1_NeedDataSource"
OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated"
OnDeleteCommand="RadGrid1_DeleteCommand" OnUpdateCommand="RadGrid1_UpdateCommand"
OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnInsertCommand="RadGrid1_InsertCommand"
        AllowSorting="True">
<MasterTableView AutoGenerateColumns="False" DataKeyNames="RecipeId" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage"
        AllowPaging="True">
    <DetailTables>
        <telerik:GridTableView runat="server"
            AutoGenerateColumns="False" DataKeyNames="RecipeIngredientId" CommandItemDisplay="Top"
            Name="Ingredient">
            <CommandItemSettings ExportToPdfText="Export to PDF" />
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" />
                <telerik:GridBoundColumn DataField="RecipeIngredientId"
                    FilterControlAltText="Filter RecipeIngredientId column"
                    HeaderText="RecipeIngredientId" UniqueName="RecipeIngredientId" ReadOnly="True">
                </telerik:GridBoundColumn>
                <telerik:GridDropDownColumn DataField="Name"
                    FilterControlAltText="Filter IngredientName column" HeaderText="Ingredient"
                    UniqueName="IngredientName" DataSourceID="LinqDataSource1"
                    ListTextField="Name" ListValueField="Name">
                </telerik:GridDropDownColumn>
                <telerik:GridBoundColumn DataField="Amount"
                    FilterControlAltText="Filter column1 column" HeaderText="Amount"
                    UniqueName="Amount">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Unit"
                    FilterControlAltText="Filter column2 column" HeaderText="Unit"
                    UniqueName="Unit">
                </telerik:GridBoundColumn>
        <telerik:GridButtonColumn ConfirmText="Delete this Ingredient?" ConfirmDialogType="RadWindow"
        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" />
            </Columns>
            <EditFormSettings>
                <EditColumn ButtonType="ImageButton">
                </EditColumn>
            </EditFormSettings>
        </telerik:GridTableView>
    </DetailTables>
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"
        Visible="True">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
    <telerik:GridEditCommandColumn ButtonType="ImageButton" />
        <telerik:GridBinaryImageColumn DataField="MainImage"
                        FilterControlAltText="Filter Image column" HeaderText="Image"
                        ImageHeight="50px" ImageWidth="50px" ResizeMode="Crop" UniqueName="Image" DefaultImageUrl="~\resources\images\noImageAvailable.jpg">
        </telerik:GridBinaryImageColumn>
        <telerik:GridBoundColumn DataField="RecipeId" DataType="System.Int32"
            FilterControlAltText="Filter RecipeId column" HeaderText="RecipeId"
            ReadOnly="True" SortExpression="RecipeId" UniqueName="RecipeId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Name"
            FilterControlAltText="Filter Name column" HeaderText="Name"
            SortExpression="Name" UniqueName="Name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Description"
            FilterControlAltText="Filter Description column" HeaderText="Description"
            SortExpression="Description" UniqueName="Description">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Serving" DataType="System.Int32"
            FilterControlAltText="Filter Serving column" HeaderText="Serving"
            SortExpression="Serving" UniqueName="Serving">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Instruction"
            FilterControlAltText="Filter Instruction column" HeaderText="Instruction"
            SortExpression="Instruction" UniqueName="Instruction">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Cuisine"
            FilterControlAltText="Filter Cuisine column" HeaderText="Cuisine"
            SortExpression="Cuisine" UniqueName="Cuisine">
        </telerik:GridBoundColumn>
        <telerik:GridButtonColumn ConfirmText="Delete this recipes?" ConfirmDialogType="RadWindow"
        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" />
    </Columns>
 
<EditFormSettings>
                    <EditColumn ButtonType="ImageButton" />
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
</telerik:RadGrid>
        </telerik:RadAjaxPanel>
 
<telerik:RadInputManager runat="server" ID="RadInputManager1" Enabled="true">
            <telerik:TextBoxSetting BehaviorID="TextBoxSetting1">
            </telerik:TextBoxSetting>
            <telerik:TextBoxSetting BehaviorID="TextBoxSetting2">
            </telerik:TextBoxSetting>
            <telerik:NumericTextBoxSetting BehaviorID="NumericTextBoxSetting1" Type="Number"
                AllowRounding="true" DecimalDigits="0">
            </telerik:NumericTextBoxSetting>
            <telerik:TextBoxSetting BehaviorID="TextBoxSetting3">
            </telerik:TextBoxSetting>
            <telerik:TextBoxSetting BehaviorID="TextBoxSetting4">
            </telerik:TextBoxSetting>
</telerik:RadInputManager>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" />
 
        <telerik:RadInputManager runat="server" ID="RadInputManager2" Enabled="true">
            <telerik:NumericTextBoxSetting BehaviorID="NumericTextBoxSetting11" Type="Number"
                AllowRounding="true" DecimalDigits="0">
            </telerik:NumericTextBoxSetting>
            <telerik:TextBoxSetting BehaviorID="TextBoxSetting11">
            </telerik:TextBoxSetting>
        </telerik:RadInputManager>
        <telerik:RadWindowManager ID="RadWindowManager2" runat="server" />
 
 
 
 
 
    <asp:LinqDataSource ID="LinqDataSource1" runat="server"
        ContextTypeName="GroceryStore.GroceryStoreDataContext" EntityTypeName=""
        TableName="Ingredientdatas" Select="new (Name)">
    </asp:LinqDataSource>
</asp:Content>
Weilun
Top achievements
Rank 1
 answered on 04 Feb 2012
2 answers
63 views
I have radtab with following code  and building the child tab dynamically. How to set different skin to childtabs built dynamically

 

<

telerik:RadTabStrip ID="RadTabStrip1" runat="server" AutoPostBack="true"

SelectedIndex="1" Width="100%" onclienttabselected="tabClicked" Skin="Web20">

</telerik:RadTabStrip>


Server code to add chidltabs

For Each dr As DataRow In readerdt.Rows
Dim tab_item As New Telerik.Web.UI.RadTab
tab_item.Text = dr.Item(0)
tab_item.SelectedCssClass = tabSelected"
parent.Tabs.Add(tab_item)
Next

 

Thanks

NVB
Top achievements
Rank 1
 answered on 03 Feb 2012
6 answers
90 views
Hi,

I've been looking for a way to get a view button on a grid to open a raddock for the current row and present read only data for it - kind of the view mode to look like the edit mode with a popup form.  I think that the raddock will look closer to the popup form than a radwindow.

Now one way that I could acheive this is to open a new page inside the dock or even just call some server side code to populate labels containing the view data.  

There must be a better way though that can work more seamlessly with the RadGrid.  Has anyone done this before or know of any good examples on the site (I may have missed some).

Thanks in advance for any pointers.

Regards,

Jon
Jon
Top achievements
Rank 1
 answered on 03 Feb 2012
1 answer
539 views
I have a RadTextBox on the page. I read the client side API page for textbox. It said to use something like this:

var shipControl = $find("txtShippingFirstName");
var text = shipControl.get_textBoxValue; ( have also tried just get_Value and it didn't work either.)
alert(text);

However, the alert is just this : "function() {return this._textBoxElement.value;}

So how can I get the text value of a RadTextBox correctly with Javascript?
Matt
Top achievements
Rank 1
 answered on 03 Feb 2012
1 answer
68 views
Please let me know if this is feasible. I want to provide different templates to appointments based on the appointment duration. For reference you can check MS outlook where the appointment template changes based on appointment duration.
Ivana
Telerik team
 answered on 03 Feb 2012
1 answer
88 views
For some reason.. this is only happening on my web server through IIS, but it's looking in a completely different place for my toolsfile


Could not find file 'C:\Windows\SysWOW64\inetsrv\cms-editor.xml'.



Why is it looking there?
Alan T
Top achievements
Rank 1
 answered on 03 Feb 2012
1 answer
136 views
I've found what appears to be a bug on the Scheduler Timeline view.  If you enable Exact Time Rendering, and try and re-size an appointment, it doesn't always snap to the correct time.   In addition, when you re-size the appointment to one time slot in the future, it fails to fire the "end drop" event (hence you can't save).

This only appears to happen for appointments with a start time that exceeds 1/2 of the time slot.  For example, if you have hour time slots, an appointment with a start time of 8:45 will have this problem.

I can reproduce this problem on your demo located here:  http://demos.telerik.com/aspnet-ajax/scheduler/examples/exacttimerendering/defaultcs.aspx  using these steps:

In timeline view, re-size the "Attending exercises on Object Oriented Programming" appointment to a few hours in the future.  First thing you'll notice is that it "snaps" to the time slot previous to where you drop it.  This is the first problem.  Secondly, if you move it up only one time slot, it fails to fire the "drag end" event, so it doesn't "save".   I'm assuming this is all because you're "pushing" the appointment so far to the right that it _thinks_ it's actually in the next time slot, when it fact it isn't.  I'm also assuming the event doesn't fire b/c you have it turn off when you resize an appointment back to it's original time slot.

I hope this helps explain the problem clearly.  I couldn't think of any work-arounds, so would love to see a fix or a work-around if possible.  

Thanks!


Ivana
Telerik team
 answered on 03 Feb 2012
5 answers
505 views
I have the following issues when using jquery scripts in the page with ajax manager although I used radscriptblock rounding my script as documented:

1- when using radscriptblock inside updated ajax panel it will be executed in the load but if I make any ajax request manually using "ajaxRequest" function it will be executed again although I need it to be executed only one time [on page load]

2- when using radscriptblock out of updated ajax panel, it will be also executed in the load but if I make any ajax request manually using "ajaxRequest" function it will be no longer executed any more [after going to server side]


below is my code:

PAGE:
<head>
  <script src="http://localhost/xsurvey/scripts/custom/collapsible.panel.js" type="text/javascript"></script>
</head>
<%--below is body-->
<asp:ScriptManager runat="server" ID="scrt" />
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" OnAjaxRequest="OnAjaxManager_Request">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="PnlPage">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PnlPage" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PnlPage" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <asp:Panel runat="server" ID="PnlPage">
        <telerik:RadScriptBlock runat="server" ID="s">
 
            <script type="text/javascript">
                $(document).ready(function() {
                    function test() {
                        $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest('sss');
                    }
                    alert("d");
                    $("#faq").makeCollapsible({ 'collapse': '1' }, test);
 
 
                });
   
   
            
            </script>
 
        </telerik:RadScriptBlock>
        <asp:Label runat="server" ID="LblEd" />
        <ul id="faq">
            <li>
                <h3 style="text-align: center">
                    More Options?</h3>
                <p>
                    test test test
                    <br />
                    test test test
                    <br />
                    test test test
                    <br />
                    test test test
                    <br />
                    test test test
                    <br />
                    test test test
                    <br />
                    test test test
                    <br />
                </p>
            </li>
            <li>
                <h3 style="text-align: center">
                    More Options?</h3>
                <p>
                    test test test
                    <br />
                    test test test
                    <br />
                    test test test
                    <br />
                    test test test
                    <br />
                    test test test
                    <br />
                    test test test
                    <br />
                    test test test
                    <br />
                </p>
            </li>
        </ul>
    </asp:Panel>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.Web.UI;
 
public partial class Tests_jQuery_CollapsePanel : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void OnAjaxManager_Request(object sender, AjaxRequestEventArgs e)
    {
        LblEd.Text = "test test CALL SERVER" + DateTime.Now;
 
    }

}

Collapsible.panel.js
(function($) {
 
    $.fn.makeCollapsible = function(options, onCollapse) {
        var settings = $.extend({
            'collapse': '1',
            'idToCollapse': ''
        }, options);
 
        return this.each(function() {
            var $this = $(this);
 
            $this.find("li > h3").each(function() {
                $(this).css("cursor", "pointer");
                $(this).siblings().wrapAll('<div>');
            });
 
            //$("#faq li > *:not(h3)").hide();
 
 
            $this.find("li > h3").click(function() {
 
                var $h3 = $(this);
                //minus icon
                var minus = {
                    'background-image': 'url(http://localhost/xsurvey/Images/minus.gif)'
                };
                //plus icon
                var plus = {
                    'background-image': 'url(http://localhost/xsurvey/Images/plus.gif)'
                };
 
                //all siblings beside <li><h3></h3>(.....)</li>
                var risposta = $h3.siblings();
 
                var callf = 0;
 
                if (risposta.is(':hidden')) {
                    $h3.css(minus);
                    callf = 1;
                    risposta.slideDown("slow");
                }
                else {
                    $h3.css(plus);
                    risposta.slideUp("slow");
                }
 
                //risposta.slideToggle("slow");
 
                if (callf == 1 && settings.onCollapse != '') {
                    //setTimeout(alert('s'), 2000);
                    if (typeof onCollapse == "function") onCollapse();
                }
 
            });
        });
 
    }
 
 
})(jQuery);
Vasil
Telerik team
 answered on 03 Feb 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?