Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
227 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
128 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
318 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
176 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
758 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
496 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
5 answers
149 views

We ran in to an issue with page size combobox events being null in Rad Ajax when paging is enabled with mode.
Error at:

 

 

$removeHandler=Sys.UI.DomEvent.removeHandler=

function(a,e,f){var d=null,c=a._events[e];for(var b=0,g=c.length;b<g;b++)if(c[b].handler===f){d=c[b].browserHandler;break}if(a.removeEventListener)a.removeEventListener(e,d,false);else if(a.detachEvent)a.detachEvent("on"+e,d);c.splice(b,1)};
Microsoft JScript runtime error: '_events' is null or not an object.

Here is the code we are using..
Menu.XML:

<?xml version="1.0" encoding="utf-8" ?>
<Menu>
  <Group Flow="Horizontal">
    <Item  Text="Home" NavigateUrl="~/Default.aspx">
    </Item>
    <Item IsSeparator="True" />
    <Item  Text="Help" ></Item>
  </Group>
</Menu>

MasterPage.aspx


<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" method="post" runat="server" style="height: 100%;" enctype="multipart/form-data">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="True"
        OutputCompression="Forced">
    </telerik:RadScriptManager>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    <telerik:RadSkinManager ID="RadSkinManager1" Skin="Office2007" runat="server" />
    <div style="width: 99%; height: 15%; float: left; padding-left: 1%;" class="body">
        <table width="100%">
            <tr>
                <td align="left">
                    <asp:ContentPlaceHolder ID="ContentPageMenu" runat="server">
                        <div style="width: 100%; padding-bottom: 4px; padding-top: 3px; float: left;">
                            <asp:UpdatePanel ID="UpdPanelPageContainerHeader" runat="server" UpdateMode="Always">
                                <ContentTemplate>
                                    <telerik:RadMenu runat="server" ID="RadMainMenu" DataFieldID="ID" Skin="Office2007"
                                        CssClass="menu" DataFieldParentID="ParentID" EnableRoundedCorners="true" EnableShadows="true">
                                        <DataBindings>
                                            <telerik:RadMenuItemBinding Depth="0" TextField="Text" Value="Key" />
                                            <telerik:RadMenuItemBinding Depth="1" ImageUrlField="ImageUrl" TextField="Text" />
                                        </DataBindings>
                                    </telerik:RadMenu>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </div>
                    </asp:ContentPlaceHolder>
                </td>
                <td align="right" style="vertical-align: top;">
                              Welcome <asp:Label ID="LblUName"
                        runat="server" ForeColor="Blue" Text="Indira"></asp:Label>   <asp:Label
                            ID="LblSystem" runat="server" Text="" ForeColor="Blue"></asp:Label>   
                    <span style="color: Blue; font-size: 9pt; color: Black;" id="dt"></span>
                </td>
            </tr>
        </table>
    </div>
    <div style="width: 95%; height: 85%; float: left; padding-left: 5%;" class="body">
        <table style="border: solid 1px white; height: 100%" cellpadding="0" cellspacing="0"
            width="100%">
            <tr>
                <td>
                    <asp:ContentPlaceHolder ID="ContentPage" runat="server">
                    </asp:ContentPlaceHolder>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>

MasterPage.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
  
public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetNoStore();
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetExpires(DateTime.Now.AddDays(-1)); 
        if (!IsPostBack)
        {
            this.RadMainMenu.LoadContentFile("~/resources/Menu.xml");
        }        
  
    }
}

DemoUserControl.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="DemoUserControl.ascx.cs" Inherits="controls_DemoUserControl" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadAjaxManager ID="RadAjaxManagerSCRList" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGridSCRList">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGridSCRList" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxPanel ID="PanelSCRList" runat="server">
</telerik:RadAjaxPanel>
<asp:Label ID="LblErrorMessage" runat="server" ForeColor="Red" Visible="false"></asp:Label><br />
<asp:Label ID="LblHeader" runat="server" Text="Change Requests:" Font-Bold="true"></asp:Label>
<telerik:RadGrid ID="RadGridSCRList" runat="server" Skin="Office2007" AutoGenerateColumns="false"
    PageSize="5" Width="75%" AllowPaging="true"  AllowSorting="true"
    PagerStyle-Mode="NextPrevAndNumeric" PagerStyle-Position="Top" PagerStyle-HorizontalAlign="Center"
    OnNeedDataSource="RadGridSCRList_NeedDataSource">
    <MasterTableView Name="SCRListMasterTable"
        runat="server" EnableViewState="true" AllowNaturalSort="false" ShowHeadersWhenNoRecords="true"
        CommandItemDisplay="Top" EditMode="InPlace" NoMasterRecordsText="" GroupLoadMode="Client">        
        <Columns>
            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="LinkButton"
                EditText="View" ItemStyle-Width="5%">
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn UniqueName="Name" HeaderText="SCR/PTR" HeaderButtonType="TextButton"
                DataField="SCR_NAME" ForceExtractValue="Always" ItemStyle-Width="13%" Groupable="true"
                 Resizable="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="ChangeNumber" HeaderText="Change Number" HeaderButtonType="TextButton"
                DataField="ChangeNumberString" ForceExtractValue="Always" ItemStyle-Width="10%"
                Groupable="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="DLTName" HeaderText="DLT" ForceExtractValue="Always"
                HeaderButtonType="TextButton" DataField="DLTName" ItemStyle-Width="16%" Groupable="true"
                DataType="System.String">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="LibraryName" HeaderText="Release Library" DataField="LibraryName"
                ForceExtractValue="Always" ItemStyle-Width="21%" HeaderButtonType="TextButton"
                SortExpression="LIBRARY_INDEX asc" Groupable="true">
            </telerik:GridBoundColumn>
        </Columns>
        <GroupHeaderItemStyle BackColor="Transparent" />
    </MasterTableView>
    <SortingSettings EnableSkinSortStyles="false" />
    <ClientSettings EnableRowHoverStyle="true" AllowDragToGroup="true" 
        EnableAlternatingItems="true" EnablePostBackOnRowClick="false">
    </ClientSettings>
</telerik:RadGrid>

DemoUserControl.ascx.cs

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
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 System.Collections.Generic;
using System.ComponentModel.Design;
using Telerik.Web;
using Telerik.Web.UI;
  
public partial class controls_DemoUserControl : System.Web.UI.UserControl
{
    public int RowSize
    {
        set;
        get;
    }
      
    protected void RadGridSCRList_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        DataTable dt = new DataTable();
        DataRow dr;
        dt.Columns.Add(new DataColumn("SCR_NAME"));
        dt.Columns.Add(new DataColumn("ChangeNumberString"));
        dt.Columns.Add(new DataColumn("DLTName", typeof(System.String)));
        dt.Columns.Add(new DataColumn("LibraryName"));
        dt.Columns.Add(new DataColumn("LIBRARY_INDEX"));
        int rowsLength = 5;
        if (RowSize > 0)
            rowsLength = RowSize;
        for (int i = 1; i < rowsLength + 1; i++)
        {
            dr = dt.NewRow();
            dr[0] = "SCR_NAME" + i.ToString();
            dr[1] = i;
            dr[2] = "DLT_NAME" + i.ToString();
            dr[3] = "LibraryName" + i.ToString();
            dr[4] = i;
            dt.Rows.Add(dr);
        }
        this.RadGridSCRList.DataSource = dt;
    }
    public void LoadData(int Rows)
    {
        if (Rows > 0)
            this.RowSize = Rows;
        this.RadGridSCRList.Rebind();
    }
}

Demo.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Demo.aspx.cs" Inherits="views_Demo" MasterPageFile="~/MasterPage.master" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="~/controls/DemoUserControl.ascx" TagName="SCRControl" TagPrefix="UC" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPage" Runat="Server">
        <fieldset style="float: left; display: inline-block;">
            <legend style="font-weight: bold; color: Black">Search Change Requests:</legend>
            <asp:UpdatePanel ID="UpdatePanelSCRSearch" runat="server" RenderMode="Inline" UpdateMode="Always">
                <ContentTemplate>
                    <table border="0" cellpadding="0" cellspacing="0" width="80%" style="padding-left: 18px;">
                        <tr style="height: 35px;">
                  <td  style="width: 5%; padding-top: 10px;">
                                Rows to Display<br />
                                <asp:DropDownList ID="DDLRows" runat="server" AutoPostBack="false">
                                    <asp:ListItem Text="5" Value="5" Selected ="True"></asp:ListItem>
                                    <asp:ListItem Text="10" Value="10"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                    <table border="0" cellpadding="0" cellspacing="0" width="84%" style="padding-left: 18px;">
                        <tr style="height: 25px; padding-top: 10px;">
                            <td align="right" style="padding-right: 10px;">
                                <asp:Button ID="BtnSearch" runat="server" Text="Search" OnClick="BtnSearch_Click"
                                    CausesValidation="false" />
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </asp:UpdatePanel>
        </fieldset>
        <asp:UpdatePanel ID="UpdatePanelSCRSearchResults" runat="server" UpdateMode="Conditional"
            RenderMode="Inline" ChildrenAsTriggers="false">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="BtnSearch" EventName="click" />
            </Triggers>
            <ContentTemplate>
                <asp:Label ID="LblErrorMessage" runat="server" ForeColor="Red" Visible="false"></asp:Label>
                <div id="SearchResultsDiv" runat="server" style="width: 100%; table-layout: fixed;"
                    visible="false">
                    <uc:scrcontrol id="SCRSearchList" runat="server"/>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Content>

Demo.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
  
public partial class views_Demo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
  
    }
    protected void BtnSearch_Click(object sender, EventArgs e)
    {
        this.LblErrorMessage.Visible = false;
        this.SearchResultsDiv.Visible = true;
        this.SCRSearchList.LoadData(Convert.ToInt32(this.DDLRows.SelectedValue));
          
    }
}


 Appreciate quick response hopefully with a solution.

Thanks!

Maria Ilieva
Telerik team
 answered on 13 Aug 2013
1 answer
43 views
Hello everyone,

I want to Show My own Customized HTML Tooltip on Mouseover of grid Cell usinng javascrpt.

can anyone help me out?

Thanks,
Marin Bratanov
Telerik team
 answered on 13 Aug 2013
2 answers
1.6K+ views
I'm trying to implement a radcombobox with checkboxes for multiselection. I'm using an ItemTemplate with an asp:CheckBox.

The data is populated fine but the functionality I'm trying to acheive is:

-The user should be able to select multiple values while the drop down is open, and then as soon as the drop down closes a postback to the server should happen where I have an event handler to handle the newly selected/deselected check boxes. Right now I set autopost back to true on the check box and it posts back every time there is an individual a check change. How do I fix this so it happens only when the drop down closes? (And not a client side side event, I want server side).

-Also the user should not be able to select an item in the combobox. The user should be able to check the check boxes on and off but not select a value. How do I fix this? Or if the user does select a value then the check mark should toggle on and off, not set the text of the combo box to the single selected value. (The text value should be ALL checked boxes, not just 1)


 
Nahwin
Top achievements
Rank 1
 answered on 13 Aug 2013
3 answers
262 views
I would like to load an entire list of tiles from a database. 
Is there any way to add Tiles programmatically via codebehind ( Radtilelist1.Tiles.Add ( new (radtile ....... '
or build tiles dynamically via databinding?


I did find  Databind and EnableDynamicData  methods but I could not find any documentation on how to implement that.
Any hint appreciated :)
Marin Bratanov
Telerik team
 answered on 13 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?