Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
157 views
Hi,

Using index how can I access a radtab in js and set a new text and navigation link.

Thanks,
Karl.
Shinu
Top achievements
Rank 2
 answered on 13 Aug 2013
1 answer
175 views
I needed to get validation working with the Notification control so thought i'd share this code, it's taken from http://demos.telerik.com/aspnet-ajax/notification/examples/waiariasupport/defaultcs.aspx but modified to allow multiple ValidationGroups per page

Simply create a UserControl called Validation.ascx and add this markup

<telerik:RadNotification
    ID="ValidationNotification"
    runat="server"
    AutoCloseDelay="20000"
    EnableRoundedCorners="true"
    EnableShadow="true"
    KeepOnMouseOver="true"
    Position="Center"
    Title="Validation errors"
    TitleIcon="warning"
    ShowCloseButton="true"
    Width="350">
    <NotificationMenu Visible="false" />
    <ContentTemplate>
        <asp:ValidationSummary
            ID="ValidationSummary"
            runat="server"
            DisplayMode="BulletList"
            ShowMessageBox="false"
            ShowSummary="true" />
    </ContentTemplate>
</telerik:RadNotification>

and this code-behind

/// <summary>
/// Provides a ValidationSummary inside a Telerik Notification
/// </summary>
/// <example>
/// Add the controls to the page
/// <code><uc1:Validation runat="server" id="Validation" ValidationGroup="Activate" /></code>
///
/// Attach the validation function to the button which fires the validation in OnInit
/// <code>ActivateButton.OnClientClicked = Validation.ValidationJsFunction;</code>
///
/// Any Server-Side validation function will need to show the notification
/// <code>if (!valid)   {   Validation.ValidationNotificationControl.Show();    }</code>
/// </example>
public partial class Validation : System.Web.UI.UserControl
{
    public string ValidationGroup { get; set; }
    public RadNotification ValidationNotificationControl { get { return this.ValidationNotification; } }
    public string ValidationJsFunction { get { return string.Format("Show_{0}", ValidationNotification.ClientID); } }
 
    protected void Page_Load(object sender, EventArgs e) { }
 
    protected override void OnInit(EventArgs e)
    {
        ValidationSummary.ValidationGroup = ValidationGroup;
        ValidationNotification.OnClientShowing = string.Format("Check_{0}", ValidationSummary.ClientID);
 
        StringBuilder js = new StringBuilder();
 
        // the Show function needs to be added to each button which causes validation
        js.AppendFormat("       function Show_{0}()", ValidationNotification.ClientID);
        js.Append("             {");
        js.AppendFormat("           var notification = $find('{0}');", ValidationNotification.ClientID);
        js.Append("                 setTimeout(function () { notification.show(); }, 0);");
        js.Append("             }");
 
        js.AppendFormat("       function Check_{0}(sender, args)", ValidationSummary.ClientID);
        js.Append("             {");
        js.AppendFormat("           var summaryElem = document.getElementById('{0}');", ValidationSummary.ClientID);
        js.Append("                 var noErrors = summaryElem.style.display == 'none';");
        js.Append("                 args.set_cancel(noErrors);");
        js.Append("             }");
 
        ScriptManager.RegisterClientScriptBlock(Page, this.GetType(),  ValidationNotification.ClientID, js.ToString(), true);
 
        base.OnInit(e);
    }
}


Now add the control to your page in place of a ValidationSummary

<uc1:Validation runat="server" ID="Validation" ValidationGroup="Subscription" />


You then need to attach the onclick event of the button firing validation to Validation.ValidationJsFunction eg

GetQuoteButton.OnClientClicked = Validation.ValidationJsFunction;









Marin Bratanov
Telerik team
 answered on 13 Aug 2013
1 answer
170 views
Hello,

In my project I have only RadDate Picker controls  which is dynamic based on the database values, and a button control.   

So I call the method for calculating CW in selected Index changed event of raddate picker, can this be done in client side? 

Now the problem is, my page is full of Date picker control, on each and every date selection the page is getting posted back to the server. So how can i overcome this problem of postback since every control is dynamic. Any help would be great.

Thanks.
Eyup
Telerik team
 answered on 13 Aug 2013
1 answer
323 views
I ned to make the calendar show only months for picking it and years and not days.  Then I am wondering If I can show then all in the header of the calander controls instead of indididual box type format so it would look like this.

2012     JAN    FEB     MAR     APR     MAY      JUN     JUL     AUG      SEP   OCT   NOV     DEC   2013

Instead of this
JAN  FEB  MAR
APR  MAY  JUN
JUL  AUG   SEp
OCT NOV   DEC
Konstantin Dikov
Telerik team
 answered on 13 Aug 2013
2 answers
244 views
I need to add a RadAjaxManager to my master pages, and so need to remove them from the content pages.

My questions is, the current RadAjaxManagers in the content pages have AjaxSettings code specific to the individual pages, detailing which controls get updates based on the control being accessed. How to I replicate this code for each page in the master page?

Thanks.
Konstantin Dikov
Telerik team
 answered on 13 Aug 2013
5 answers
146 views
Hi,
I am using a treeView with LoadonDemand using a webservice-method. And I want to do drag&drop.
- When I drag a node and insert it into a node that has been already expanded it works perfect (I think after expanding a node once, it gets the ExpandMode = clientside).
- When I drag a node and hover the targetNode, wait till it has expanded and then release the mouse button to complete the drag and drop process, it works (because the targetNode is expanded now).
- When I drag a node onto a targetNode and release the mouse button before the targetNode has been expanded I get an script Error.

Can someone help me out here?
Plamen
Telerik team
 answered on 13 Aug 2013
10 answers
346 views
I have a couple of labels on the page that I need to update periodically via Ajax. When RadAjaxManager is used to included them in an Ajax call, they are wrapped in a div. Once this happens the layout of the page is broken as they were originally spans. <edit>I'm guessing this has to do with them being wrapped with UpdatePanels, but how do I work around this?</edit> I guess I can wrap them in a panel to fix this. (slaps forhead).

Not only that, if they are configured to be updated by multiple controls, they will be wrapped by more than one div with the same id. Is this the correct behaviour?
Maria Ilieva
Telerik team
 answered on 13 Aug 2013
5 answers
220 views
Hello

If you want reproduce the bug, you must to add a RadEditor in the RadWindow.
When you get the content of the radeditor1 with your javascript we have Two <br/>
And in the Radeditor2 we Have on <br/>
You can see to choose HTML view.

I don't attach files on the thread but i can you send by mail a webform test.aspx

You see the code html on follow.

<form id="form1" runat="server">
  <div>
      <asp:ScriptManager ID="Sc1" runat="server"></asp:ScriptManager>
      <telerik:RadWindow ID="RadWindow1" Width="1000" Height="800" OnClientShow="OnClientShow" runat="server" VisibleOnPageLoad="true">
          <ContentTemplate>
              <div id="editorWrapper" style="padding: 5px; display: none;">
                  RADEDITOR WITH JAVASCRIPT, See the HTML
                  <telerik:RadEditor ID="RadEditor1" runat="server" height="200px"></telerik:RadEditor>
              </div>
              RADEDITOR WITHOUT JAVASCRIPT, See the HTML
              <telerik:RadEditor ID="RadEditor2" runat="server" height="200px"></telerik:RadEditor>
           
              <asp:button runat="server" ID="btn_save" Text="save" onclick="btn_save_Click"/>
 
              <asp:TextBox runat="server" ID="TextBox1" Width="150px"></asp:TextBox>
              <asp:TextBox runat="server" ID="TextBox2" Width="150px"></asp:TextBox>
          </ContentTemplate>
      </telerik:RadWindow>
 
      <script type="text/javascript">
          function OnClientShow(sender, args) {
              // Fix the size problem in IE.
              var editorParent = $get('editorWrapper');
              editorParent.style.display = '';
              // Fixes the problem with the content area in FF and Safari
              var editor = $find('<%= RadWindow1.ContentContainer.FindControl("RadEditor1").ClientID %>');
              editor.onParentNodeChanged();
              var style = editor.get_contentArea().style;
              style.backgroundImage = "none";
              style.backgroundColor = "white";
          }
      </script>
  </div>
  </form>

You see the code CS on follow :

public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.RadEditor1.Content="hello 1";
            this.RadEditor2.Content="hello 2";
 
            this.TextBox1.Text = "";
            this.TextBox2.Text = "";
 
        }
 
        protected void btn_save_Click(object sender, EventArgs e)
        {
            this.TextBox1.Text = this.RadEditor1.Content;
            this.TextBox2.Text = this.RadEditor2.Content;
        }
 
    }

Ianko
Telerik team
 answered on 13 Aug 2013
7 answers
784 views
Hello,

I have a hierarchical RadGrid with a MasterTableView and DetailTables. In order to only allow only one EditForm form visible at a time, I have added the following code to clear any outstanding add or edit form.
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
    {
 
        //Clear and reset all outstanding edit form
        e.Item.OwnerTableView.IsItemInserted = false;
        e.Item.OwnerTableView.ClearEditItems();
        e.Item.OwnerTableView.ClearChildEditItems();
The above code will prevent multiple outstanding add/edit forms where clicking on one insert/update will also automatically validate the other outstanding form (see attached picture). Is there a way to prevent this?

Unfortunately, after adding the above code, none of the grid events (see below) is fired. I was unable to add or update any item after clicking the Insert or Update link.

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
    OnNeedDataSource="RadGrid1_NeedDataSource"
    OnDetailTableDataBind="RadGrid1_DetailTableDataBind"
    OnInsertCommand="RadGrid1_InsertCommand"
    OnUpdateCommand="RadGrid1_UpdateCommand"
    OnDeleteCommand="RadGrid1_DeleteCommand"
    OnEditCommand="RadGrid1_EditCommand"
     OnItemCreated="RadGrid1_ItemCreated"
     OnItemDataBound="RadGrid1_ItemDataBound"
      OnItemCommand="RadGrid1_ItemCommand"
       OnPreRender="RadGrid1_OnPreRender"
    >
This is a show stopper for us. Your help is greatly appreciated. I can provide the complete source code if needed.

Thank you.
Andrey
Telerik team
 answered on 13 Aug 2013
2 answers
526 views
Hello team,

I am having one small issue. I have a save button on my aspx page. I want to redirect to the previous page after a successful save operation, But before redirecting I want to show an alert message saying 'Service Engineer Notified.'
I have used radalert before response.redirect call, but it is not showing the radalert message and directly redirecting to the previous page.
I don't want to modify the radalert template.
What can be done?
Kavita
Top achievements
Rank 1
 answered on 13 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?