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

I would like to get a radgrid cells value and controls when a context menu item is selected on the client side. How would I do this?

Thank You
Fred
Fred Mare
Top achievements
Rank 1
 answered on 05 Feb 2012
1 answer
53 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
110 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
131 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
54 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
85 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
513 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
61 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
79 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
123 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?