Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
530 views
I have a RADGrid named 'RadGrid1' in my ASPX page.
RadGrid1 has Form Template Edit form and this edit form contains RADEditor named 'RadEditor1'.

If I want to get the content of the RADEditor 'RadEditor1' in the code behind file of this ASPX page, what is the correct way of referencing the contents in the RadEditor1?

I tried the code shown below:
RadEditor radEditor = ((RadEditor)e.Item.FindControl("RadEditor1"));
string content = radEditor.Content;

But I get the error 'System.EventArgs' does not contain a definition for 'Item' and no extension method 'Item' accepting...'

I have also tried the code shown below to get the content stored in the RadEditor1 but it still didn't work.
string content = RadGrid1.RadEditor1.Content;

Thank you.
Soismel
Top achievements
Rank 1
 answered on 01 Jul 2014
1 answer
99 views
Hi,

Is there a 100% stacked chart available?

Regards,

Sanj
Danail Vasilev
Telerik team
 answered on 01 Jul 2014
1 answer
95 views
Is it possible to save a HtmlChart as an image? The goal is to use it in excel or similar products.
Danail Vasilev
Telerik team
 answered on 01 Jul 2014
3 answers
133 views
Hi,
I am trying to use the Telerik RadListView Darg-Drop feature: 
http://demos.telerik.com/aspnet-ajax/listview/examples/datagrouping/defaultcs.aspx

I want to be able to drag an item from one data group to another datagroup. How can I do that?

ASPX code:

<telerik:RadListView runat="server" ID="Lsv_Vis" AllowPaging="True" PageSize="50"
    ItemPlaceholderID="Phi_Vis_I" GroupPlaceholderID="Phi_Vis_G"
    DataKeyNames="url_id, lst_id, url_name, url_address" ClientDataKeyNames="url_id, lst_id, url_name, url_address"
    OnItemDrop="CsVisItemDrop" OnItemDataBound="CsVisIDB" DataSourceID="Sql_Vis">
</telerik:RadListView>

<DataGroups>
    <telerik:ListViewDataGroup GroupField="lst_id" DataGroupPlaceholderID="Phi_Vis_G">
        <DataGroupTemplate>
            <div class="Div_Vis_Grp"><span class="Spn_Vis"><%# (Container as RadListViewDataGroupItem).AggregatesValues["lst_name"].ToString() %></span></div>
            <asp:Panel ID="Pnl_Vis" runat="server" CssClass="Pnl_Vis" ToolTip='<%# (Container as RadListViewDataGroupItem).DataGroupKey %>' onmouseover='this.className += " Vis_Sel";' onmouseout='this.className = this.className.split(" Vis_Sel").join("");'>
                <asp:PlaceHolder ID="Phi_Vis_I" runat="server" />
            </asp:Panel>
        </DataGroupTemplate>
        <GroupAggregates>
            <telerik:ListViewDataGroupAggregate Aggregate="Max" DataField="lst_name" />
        </GroupAggregates>
    </telerik:ListViewDataGroup>
</DataGroups>
<ItemTemplate>
    <div class="Div_Vis_Item rlvI">
    <asp:Panel ID="Pnl_Vis" runat="server" ToolTip='<%# Eval("lst_id") %>' CssClass="Div_Vis_Item" onmouseover='this.className += " Vis_Sel";' onmouseout='this.className = this.className.split(" Vis_Sel").join("");'>
        <a class="Hyp_Vis" runat="server" href='<%# Eval("url_address") %>' target="_blank">
            <div class="Div_Vis_Body">
                <div class="Div_Vis_Con">
                    <asp:Panel ID="Div_Vis_Con" runat="server" class="Div_Vis_Con" ToolTip='<%# Eval("lst_id") %>' ></asp:Panel>
                </div>
            </div>
            <div class="Div_Vis_Link">
                <asp:Label ID="Lbl_VisI" runat="server" Text='<%# Eval("url_name_short") %>' ToolTip='<%# Eval("url_name") %>'/>
            </div>
        </a>
    </asp:Panel>
    </div>
</ItemTemplate>

C# Code:

protected void CsVisItemDrop(object sender, RadListViewItemDragDropEventArgs e)
{
    if (e.DestinationHtmlElement.IndexOf("Div_Vis_Con") < 0)
    {
        return;
    }
 
    foreach (RadListViewDataItem di in Lsv_Vis.Items)
    {
        Panel pnl = di.FindControl("Div_Vis_Con") as Panel;
 
        if (pnl != null && pnl.ClientID == e.DestinationHtmlElement)
        {
            string uid = e.DraggedItem.GetDataKeyValue("url_id").ToString();
            string lid = pnl.ToolTip.ToString();
 
            using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Con_Str"].ToString()))
            {
                using (SqlCommand cmd = new SqlCommand("UPDATE [MyTable] SET lst_id = @lst_id WHERE url_id = @url_id", conn))
                {
                    cmd.Parameters.Add("@lst_id", SqlDbType.VarChar).Value = lid;
                    cmd.Parameters.Add("@url_id", SqlDbType.VarChar).Value = uid;
                    try
                    {
                        conn.Open();
                        cmd.ExecuteNonQuery();
                        conn.Close();
                    }
                    catch { }
                }
            }
        }
    }
    Lsv_Vis.Rebind();
}

<telerik:RadListView runat="server" ID="Lsv_Vis" AllowPaging="True" PageSize="50"
    ItemPlaceholderID="Phi_Vis_I" GroupPlaceholderID="Phi_Vis_G"
    DataKeyNames="url_id, lst_id, url_name, url_address" ClientDataKeyNames="url_id, lst_id, url_name, url_address"
    OnItemDrop="CsVisItemDrop" OnItemDataBound="CsVisIDB" DataSourceID="Sql_Vis">
</telerik:RadListView>

<telerik:RadListView runat="server" ID="Lsv_Vis" AllowPaging="True" PageSize="50"
    ItemPlaceholderID="Phi_Vis_I" GroupPlaceholderID="Phi_Vis_G"
    DataKeyNames="url_id, lst_id, url_name, url_address" ClientDataKeyNames="url_id, lst_id, url_name, url_address"
    OnItemDrop="CsVisItemDrop" OnItemDataBound="CsVisIDB" DataSourceID="Sql_Vis">
</telerik:RadListView>

Maria Ilieva
Telerik team
 answered on 01 Jul 2014
2 answers
191 views
Hi Telerik,

I find limited resources on the Gallery, as far as the client object is concerned and trying to get information out of it. In otherwords, finding the text, description, etc of the currently selected image. I cant seem to get this information from the argument in the OnNavigated function. If you have documentation on it please lead me to it.

Ok, I want the OnNavigated to update other controls on the screen once that image is selected. I have textboxes and a check box that should update after the image is chosen to view. The server event - Image requested  gets hit only the first time around. So i need this event to update other controls on the screen.

<telerik:RadImageGallery ID="ImageGallery1" DataKeyNames="MemberImageId, IsPrimary, Name, Description" runat="server" Height="400px" LoopItems="true" Skin="Web20">
    <ThumbnailsAreaSettings ThumbnailsSpacing="5px" />
    <ClientSettings>
        <ClientEvents OnNavigated="OnNavigated" />
    </ClientSettings>
    <ImageAreaSettings ShowDescriptionBox="false" />                   
</telerik:RadImageGallery>

JS function
function OnNavigated(sender, args) {
    $find('<%=RadTextBoxMemberImageId.ClientID%>').set_value('1');
    $find('<%=RadTextBoxDescription.ClientID%>').set_value('Try Desc');
    $find('<%=RadButtonPrimary.ClientID%>').set_checked(false);
    $find('<%=RadTextBoxName.ClientID%>').set_value('Try Name');
}

I obviously want the 4 objects to be updated when the next/previous/other image is selected. Not the hard coded values you see. Maybe the key names have values in the js side? Like other controls, but client datakey is used. I dont see any help on the matter.

Can you guys/girls lead me in the right direction?

Thanks a bunch!







Angel Petrov
Telerik team
 answered on 01 Jul 2014
1 answer
341 views
Hi,

I have a form with three controls.  One a RadNumericTextbox with a MaxValue of 6, a dropdown and a button.  The MaxValue of the numeric textbox changes depending on what is selected under the dropdown, and this works fine.  The problem I'm having is that even though I have the numeric textbox's property AllowOutOfRangeAutoCorrect set to false, when submitting the form it sometimes defaults the value to the original MaxValue of 6.  

Here is how to duplicate issue (happens every time):

1. Enter 2 under numeric textbox
2. Click "Get Quote" button, which submits the form
3. Change dropdown value from "Pallet" to "Other"
4. Enter 10 under numeric textbox
5. click "Get Quote" again
6. Numeric Textbox's value switches from 10 to 6.

I am using the Telerik Controls version of 2014.1.403.35

Below is my form, no server-side logic is required:


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestRadNumericTextbox.aspx.vb" Inherits="TestRadNumericTextbox" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
      <telerik:RadCodeBlock runat="server" ID="rcbJavascript">
             
        <script type="text/javascript">
 
            function rddlItemQtyUOM_OnClientSelectedIndexChanged(sender, eventArgs) {
                var selectedValue = sender.get_selectedItem().get_value();
                var rntbItemQty = $find("<%= rntbItemQty.ClientID%>");
 
            if (selectedValue == 'Pallet') {
 
                rntbItemQty.set_maxValue(6);
            }
            else {
                rntbItemQty.set_maxValue(10000);
            }
        }
 
        </script>
</telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
         
    </telerik:RadScriptManager>
 
        <telerik:RadAjaxManager ID="ramMain" runat="server" DefaultLoadingPanelID="ralpDefault" >
        <AjaxSettings>
           
            <telerik:AjaxSetting AjaxControlID="btnGetQuote">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="LTLUI" UpdatePanelCssClass=""  LoadingPanelID="ralpDefault"/>
                    
                </UpdatedControls>
            </telerik:AjaxSetting>
 
        </AjaxSettings>
            </telerik:RadAjaxManager>
        <telerik:RadSkinManager runat="server" ID="rskmMain" Skin="Windows7" ShowChooser="false" />
         
        <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all" EnableRoundedCorners="false">
        </telerik:RadFormDecorator>
 
        <telerik:RadAjaxLoadingPanel ID="ralpDefault" runat="server" Height="75px" Width="75px" />
 
        <div id="LTLUI" runat="server" >
                <telerik:RadNumericTextBox runat="server" ID="rntbItemQty" Width="48px" NumberFormat-DecimalDigits="0" EmptyMessage="Required Field" MinValue = "1" MaxValue="6"  AllowOutOfRangeAutoCorrect="false"   />
                                                                    <asp:RequiredFieldValidator runat="server" ID="rfvrntbItemQty" ValidationGroup="InputArea" Display="Dynamic" Text="" ControlToValidate="rntbItemQty"  />
                                                                     
                <telerik:RadDropDownList runat="server" ID="rddlItemQtyUOM"  Width="66px" OnClientSelectedIndexChanged="rddlItemQtyUOM_OnClientSelectedIndexChanged">
                    <Items>
                        <telerik:DropDownListItem Value="Pallet" Text="Pallet" />
                        <telerik:DropDownListItem Value="Other" Text="Other" />
                    </Items>
                    </telerik:RadDropDownList>
                                                                   
            <telerik:radbutton runat="server" id="btnGetQuote" Text="Get Quote" CausesValidation="true"  ValidationGroup="InputArea" Width="500px" />
            </div>
    </div>
 
    </form>
</body>
</html>
















Maria Ilieva
Telerik team
 answered on 01 Jul 2014
2 answers
323 views
Hi All
I have a Radgrid with many records and while updating It create copy of current month records  and put as  new records. I would like to make sure that person could not hit the button twice in one go. otherwise it will create two copies of the current month records. Is it possible I can disable update button after user click it. I am using EditCommandColumn.
Please update me it is urgent.
Thanks in advance
Syed
Viktor Tachev
Telerik team
 answered on 01 Jul 2014
4 answers
207 views
We are upgrading our code from .Net 3.5 to 4.0 and an issue has come up. The way we previously did login is now having an error on the Response.Redirect. From what have found doing research, it seems to be an error that has something to do with Ajax, adding to the response, and redirect.  Unfortunately I can not find a solution to this problem.

The error we get is "Uncaught Sys.WebForms.PageRequestManagerParserErrorException" via the javascript from Telerik.Web.UI.WebResource.axd.

The code snippets we have below work under .Net 3.5 but do not work after attempting the 4.0 upgrade. The authentication cookies do get added as I can manually type the url that we are supposed to redirect to. However, the automatic redirect does not work. 



<%@ Page Language="C#" MasterPageFile="~/masterpages/WebMain.master" AutoEventWireup="true" Inherits="Default" Codebehind="Default.aspx.cs"%>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMaster" Runat="Server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="Login">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="Login" LoadingPanelID="AjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server" />   
    <div id="divLogin" runat="server">
        <table align="center">
            <tr>
                <td align="center">
                    <asp:Login ID="Login" runat="server"
                        OnAuthenticate="Login_Authenticate" DisplayRememberMe="False"
                        Orientation="Horizontal" TextLayout="TextOnTop" TitleText="" LoginButtonStyle-Height="25px" LoginButtonStyle-Width="50px">
                    </asp:Login>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
protected void Login_Authenticate(object sender, AuthenticateEventArgs e)
{
    ...
     Response.Cookies.Add(authCookie);
 
     ...
     Response.Redirect(pageUrl, false);
 
}

ChrisS
Top achievements
Rank 1
 answered on 01 Jul 2014
2 answers
163 views
I'm in need of an OnClientClose event for the ColorPicker, but do not see one.  Does anyone know if this exists or a similar clientSide event I can use?

Erik
Top achievements
Rank 1
 answered on 01 Jul 2014
1 answer
73 views
Hello All, 
I am getting some issue with here is my code

See attached , i have aspx, VB page along with the ERROR, also screen short after F12
, exception is 
Uncaught TypeError: Cannot set property 'control' of undefined 

Interesting thing is this same code is basically generating columns based on the query and condition, in some pages it's really work but in some case not , and from the error when i go to the source i found it's date picker also on load this exception happen , and including date picker no ajax is working even loader , row filter all, 


Please help as soon you can 


























Mahaarajan
Top achievements
Rank 1
 answered on 01 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?