Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
137 views
Hello,

I am using RadTabStrip. Inside this multiple tab strip there are usercontrols loaded. In one of the user control I have a RadComboBox with OnItemRequested even. I want to load this combobox with the selected values using OnItemRequested event.

But the OnItemRequested  event handeler is not envoked when i try to enter some text in the RadComboBox.

Can you please guide me ? what could be the possible way to make to enable to call this event handler ?

Note: I used EnableAutomaticLoadOnDemand="true" and also put the all controls in UpdatePanel.

Thanks,
Prayag
Ivana
Telerik team
 answered on 06 Jan 2012
1 answer
127 views

Our application has RadWindow ,which is displayed as pop up window with some information.We are trying to open the links in the RadWindow in a new browser window - through the Ajax Manager by adding the Javascript method to the RadAjaxManager response scripts and sending the parameters from code behind.The script has been added to the Response scripts.but the javascript is not getting executed.

Is there any other way to do this? or is this the right approach.



Thanks
Chandra
Marin Bratanov
Telerik team
 answered on 06 Jan 2012
2 answers
149 views
1) RadScheduler context menu does not fire AppointmentContextMenuItemClicked event.

(version 2011.3.1227.40)

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Web.Script.Services;
using System.Web.Services;
using Telerik.Web.UI;
 
namespace Naucrates.Formcrates.Web.Form
{
    [WebService]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ScriptService]
    public partial class TestScheduler : System.Web.UI.Page
    {
        protected void Page_Init(object sender, EventArgs e)
        {
            var Control = new RadScheduler();
            Control.ID = "test";
            Page.Form.Controls .Add(Control);
            Control.AllowDelete = false;
            Control.AllowEdit = false;
            Control.AllowInsert = false;
            Control.FirstDayOfWeek = DayOfWeek.Monday;
            Control.LastDayOfWeek = DayOfWeek.Sunday;
            Control.ShowFullTime = false;
 
 
            Control.SelectedView = SchedulerViewType.MonthView;
            Control.ShowViewTabs = true;
 
            Control.ShowAllDayRow = true;
            Control.DayView.UserSelectable = false;
            Control.WeekView.UserSelectable = false;
            Control.TimelineView.UserSelectable = false;
 
            Control.WebServiceSettings.Path = Request.Url.AbsoluteUri;
            Control.WebServiceSettings.ResourcePopulationMode = SchedulerResourcePopulationMode.ClientSide;
 
 
            Control.TimeZoneOffset = TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now);
            Control.VisualTimeZoneOffset = Control.TimeZoneOffset;
            Control.Culture = new CultureInfo("cs-CZ");
 
            Control.ShowDateHeaders = false;
            var menu = new RadSchedulerContextMenu();
            menu.Items.Add(new RadMenuItem("test1"));
            menu.Items.Add(new RadMenuItem("test2") { PostBack = true, Value = "val" });
            Control.AppointmentContextMenus.Add(menu);
 
            Control.AppointmentContextMenuItemClicked += Control_AppointmentContextMenuItemClicked;
            Control.AppointmentContextMenuItemClicking += Control_AppointmentContextMenuItemClicking;
        }
 
        void Control_AppointmentContextMenuItemClicking(object sender, AppointmentContextMenuItemClickingEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("CLICKING!");
        }
 
        protected void Control_AppointmentContextMenuItemClicked(object sender, AppointmentContextMenuItemClickedEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("CLICK!");
        }
 
        [WebMethod]
        public static IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo)
        {
            var data = new List<AppointmentData>();
            data.Add(new AppointmentData {Start = DateTime.Today, End = DateTime.Today.AddDays(2),Description = "TEST", Subject = "test"});
            return data;
        }
 
        [WebMethod]
        public static IEnumerable<ResourceData> GetResources(SchedulerInfo schedulerInfo)
        {
            return new List<ResourceData>();
        }
    }
}



2) Culture property does not working properly (see image).

What am I doing wrong?
Thanks,
Tomas Svec


Ivana
Telerik team
 answered on 06 Jan 2012
3 answers
581 views
Hi I have a RadWindow Generated at runtime based on certain condition , it also attaches itself to the RadWindowManager...
On first page load, the ID is set to "wndSetUp"... and on that page i have a button, when i click on the button to execute an onclick to display the radwindow, it postback , so on the next page load, i try to find the RadWindow using the FindControl("wndSetUp")  but coudlnt find it... it turned out the ID has changed to a defaut "ctl02" rather than "wndSetUp" ( which it was correct on first page load)...

In the Watch Window, the ID clearly changes when I click on the button.
Can anyone explain to me why the ID?

Code of Master Page which has the onClick Button
 
        protected void Page_Load(object sender, EventArgs e)
        {
            //Check if Calling Pages Require New User Set Up
            if (SessionContext.NeedUserSetUp)
            {
                // Find Reference to Window Set Up
                RadWindow wndSetUp = GetUserSetUpWindow();
                if (wndSetUp != null)
                {// Show Set Up Button and Add Ajax Settings
                    btNewUserSetUp.Visible = true;
                    RadAjaxManager_GM.AjaxSettings.AddAjaxSetting(btNewUserSetUp, wndSetUp);
                }
                else
                {
                    btNewUserSetUp.Visible = false;
                }
            }
            else
            {
                btNewUserSetUp.Visible = false;
            }
        }
 
      /// <summary>
        /// Handles the Click event of the btNewUserSetUp control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void btNewUserSetUp_Click(object sender, EventArgs e)
        {
            RadWindow wndSetup = GetUserSetUpWindow();
            if (wndSetup != null)
            {
                wndSetup.Visible = true;
                wndSetup.VisibleOnPageLoad = true;
            }
        }
 
        /// <summary>
        /// Gets the user set up window. Find the Reference to the Window Set Up generated dynamically
        /// </summary>
        /// <returns></returns>
        private RadWindow GetUserSetUpWindow()
        {
            switch (sectionName)
            {
                case "SavingsCenter":
                case "ShoppingLists":
                case "BrowseItems":
                case "FindDeals":
                default:
                    return (RadWindow)Page.Form.FindControl("RadWindowManager_GM").FindControl("wndSetUp");
            }
        }
 
 
 
HTML
            <telerik:RadWindowManager ID="RadWindowManager_GM" runat="server">
            </telerik:RadWindowManager>
 
                <telerik:RadButton ID="btNewUserSetUp" runat="server" Visible="false" Width="98"
                    Height="21" OnClick="btNewUserSetUp_Click">
                    <Image ImageUrl="../Images/btNewUserSetUp.gif" HoveredImageUrl="../Images/btNewUserSetUp_up.gif" />
                </telerik:RadButton>

On My PageBASE class, inheritted by my pages, it checks a wnSetUp needs to be created using the 3 conditions: NeedUserSetUp, IsValidContext and !IsPostBack. My Work around is tp force a new creation of "wndSetUp" RadWindow (by removing the !IsPOstBack)... but in the end i had 2 RadWindows ( one with "ct02" and the other one since I recreated it on the postback with "wndSetUp")

protected override void OnLoad(EventArgs e)
 {
         _SessionContext.CallingPage = this;
     //Check for New User Set Up
     if (SessionContext.NeedUserSetUp && IsValidContext() && !IsPostBack)
     {
         RadWindow wndSetUp = CreateNewUserSetUpWindow(true);
     }
 
 
     base.OnLoad(e);
 }
 
 /// <summary>
 /// Determines whether [is valid context] only if PageBase called within the ApplicationLayer.
 /// </summary>
 /// <returns>
 ///   <c>true</c> if [is valid context]; otherwise, <c>false</c>.
 /// </returns>
 private bool IsValidContext()
 {
     MasterPage master = GetRootLevelMaster();
     return (master != null ? (master.GetType().Name.IndexOf("applicationlayer") > 0) : false);
 }
 
 
 /// <summary>
 /// Creates the new user set up window.
 /// </summary>
 /// <param name="manualSetUp">if set to <c>true</c> [manual set up].</param>
 /// <returns></returns>
 public RadWindow CreateNewUserSetUpWindow(bool manualSetUp)
 {
     RadWindow wndSetUp = new RadWindow();
     WindowSetUpConfigurations(wndSetUp, manualSetUp);
 
     RadWindowManager wndManager = (RadWindowManager)GetWindowManager();
     wndManager.Windows.Add(wndSetUp);
 
     //Attach RadWindow to the Form
     //this.Page.Form.Controls.Add(wndSetUp);
     return wndSetUp;
 }
 
 private Control GetWindowManager()
 {
     MasterPage master = GetRootLevelMaster();
     return master.FindControl("RadWindowManager_GM");
 }
 
 private MasterPage GetRootLevelMaster()
 {
     MasterPage master = Page.Master;
     MasterPage prevMaster = null;
 
     while (master != null)
     {
         prevMaster = master;
         master = master.Master;
     }
     return prevMaster;
 }
 
 
 /// <summary>
 /// Windows the set up configurations.
 /// Requirement: CSS Skin is loaded for RadWindow in Master
 /// </summary>
 /// <param name="wndSetUp">The WND set up.</param>
 private void WindowSetUpConfigurations(RadWindow wndSetUp,bool manualSetUp)
 {
     wndSetUp.ID = "wndSetUp";
     if (manualSetUp)
     {
         RadButton btSetUp = (RadButton)GetWindowManager().FindControl("btNewUserSetUp");
         wndSetUp.OpenerElementID = btSetUp.ClientID;
     }
     wndSetUp.Title = "First Time Setup";
     wndSetUp.Skin = "gmBlue";
     wndSetUp.NavigateUrl = "../Pages/InitialSetUp.aspx";
     wndSetUp.Height = 730;
     wndSetUp.Width = 900;
     wndSetUp.KeepInScreenBounds = true;
     wndSetUp.Modal = true;
     wndSetUp.Overlay = true;
     wndSetUp.ShowContentDuringLoad = true;
     wndSetUp.Visible = false;
     wndSetUp.VisibleStatusbar = false;
     wndSetUp.VisibleTitlebar = true;
     wndSetUp.Behaviors = WindowBehaviors.Close | WindowBehaviors.Move;
     wndSetUp.EnableEmbeddedSkins = false;
     wndSetUp.EnableShadow = false;
 }
Marin Bratanov
Telerik team
 answered on 06 Jan 2012
1 answer
128 views
Hi,
I have rad scheduler  and i have some appointments in my Scheduler.How i can Open a Modal popup to show appointment  details by click on a particular Appointment.Can any one help me asap

Thanks And Regards
N.Vishnu Vardhan Reddy
Peter
Telerik team
 answered on 06 Jan 2012
3 answers
286 views
Hi,

I have a requirement of binding Daily points on to the Charts. On the X-Axis i am trying to show the Label of some 5 dates and hiding all the other labels. I want to show the major ticks for which Dates are being displayed and hide all the minor ticks. Is this possible to show only Major and not the Minor ticks when binding dynamically. 
Peshito
Telerik team
 answered on 06 Jan 2012
5 answers
407 views
Hi,
i am using RadWindow in my Portal and i have few text box on my Radwindow and one Image Button..... i want to know that how to Close my Radwindow and Redirect page to parent page when i click on Image button which is on Radwindow ..can any one help me???
Marin Bratanov
Telerik team
 answered on 06 Jan 2012
3 answers
159 views

My Set up consist of a Grid and a ClientClick on the Row to open a RadWindow using the ClientSide  radopen. The problem I am encountering is that none of the RadWindow attributes are working... as if whatever i've defined in the RadWindow Attributes are ignored.
Below is the code snippet from my user control where the RadGrid is located and it's associated code.

<telerik:RadWindowManager ID="wndManager" runat="server" EnableShadow="False">
    <Windows>
        <telerik:RadWindow ID="wndShoppingListItem" runat="server" Title="Shopping List Item"
            ReloadOnShow="true" ShowContentDuringLoad="false" KeepInScreenBounds="True" Modal="True"
            VisibleStatusbar="False" Height="525" Width="725px" VisibleTitlebar="True" Behavior="Close, Move"
            Behaviors="Close, Move" Skin="gmBlue" EnableEmbeddedSkins="false" />
    </Windows>
</telerik:RadWindowManager>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function ShowEditForm(accountId, listId, itemId, productId, rowIndex) {
            //alert('ShowEditForm');
            var grid = $find("<%= grdSelectedList.ClientID %>");
            var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
            grid.get_masterTableView().selectItem(rowControl, true);
 
            var wnd = window.radopen("wndShoppingListItem.aspx?accountId=" + accountId +
                                                    "&listId=" + listId +
                                                    "&itemId=" + itemId +
                                                    "&productId=" + productId
                                                    , "<%= wndShoppingListItem.ClientID %>");
            return false;
        }
        function ShowInsertForm() {
            //alert('ShowInsertForm');
            var wnd = window.radopen("wndShoppingListItem.aspx", "<%= wndShoppingListItem.ClientID %>");
            return false;
        }
        function refreshGrid(arg) {
            //alert('refresgGrid' + arg);
            var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
            if (!arg) {
                ajaxManager.ajaxRequest("Rebind");
            }
            else {
                ajaxManager.ajaxRequest("RebindAndNavigate");
            }
        }
        function RowClick(sender, eventArgs) {
            //alert('RowClick' + eventArgs);
            var wnd = window.radopen("wndShoppingListItem.aspx?accountId=" + eventArgs.getDataKeyValue("Account_ID") +
                                                    "&listId=" + eventArgs.getDataKeyValue("List_ID") +
                                                    "&itemId=" + eventArgs.getDataKeyValue("Item_ID") +
                                                    "&productId=" + eventArgs.getDataKeyValue("Product_ID")
                                                    , "<%= wndShoppingListItem.ClientID %>");
        }
    </script>
</telerik:RadCodeBlock>


Below is the actual content of the RadWindow

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wndShoppingListItem.aspx.cs"
    Inherits="GrocerMania.AppServer0001.Pages.wndShoppingListItem" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>Shopping List Item</title>
    <link href="../Lib/shoppinglist.css" rel="stylesheet" type="text/css" />
    <link href="../Lib/wndMain.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <script type="text/javascript">
        function CloseAndRebind(args) {
            //alert('CloseAndRebind' + args);
            GetRadWindow().BrowserWindow.refreshGrid(args);
            GetRadWindow().close();
        }
 
        function GetRadWindow() {
            //alert('GetRadWindow');
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
 
            return oWindow;
        }
 
        function CancelEdit() {
            //alert('CancelEdit');
            GetRadWindow().close();
        }
    </script>
    <asp:ScriptManager ID="ScriptManager2" runat="server" />
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <div class="sliHeader">
        <div class="sliItemImage">
            <asp:Image ID="imgItem" runat="server" ImageUrl="~/AppServer0001/Data_Images/default.gif"
                Height="80" Width="80" BorderColor="black" BorderWidth="1"/>
        </div>
        <div class="sliItemDescription">
            <asp:Label ID="lblItemName" runat="server" CssClass="lblItemName">Milk, Lowfat 1%</asp:Label>
            <div class="smallLabel">
                Last purchased:</div>
            <asp:Label ID="lblLastPurchased" runat="server" CssClass="smallFont"> October 1, 2011 (2 gallons)</asp:Label><br />
            <div class="smallLabel">
                How much I have:</div>
            <asp:Label ID="lblHowMuch" runat="server" CssClass="smallFont">None!</asp:Label>
        </div>
    </div>
    <div class="sliBody">
        <div class="sliColName">
            Quantity:</div>
        <div class="sliColControl">
            <div class="divQtyWrapper">
                <div class="divPlusMinus" id="qtyMinus">
                    <img alt="minus" src="../Images/btMinusGray.gif" /></div>
                <div class="divQty">
                    <asp:TextBox ID="txtQty" runat="server" value="1" CssClass="txtQtyInput"></asp:TextBox></div>
                <div class="divPlusMinus" id="qtyPlus">
                    <img alt="plus" src="../Images/btPlusGray.gif" /></div>
            </div>
        </div>
        <div class="sliSeparator">
        </div>
        <div class="sliColName">
            Item type:</div>
        <div class="sliColControl">
            <telerik:RadComboBox ID="cmbType" runat="server" Width="345px">
            </telerik:RadComboBox>
        </div>
        <div class="sliSeparator">
        </div>
        <div class="sliColName">
            Item size:</div>
        <div class="sliColControl">
            <telerik:RadComboBox ID="cmbSize" runat="server" Width="345px">
            </telerik:RadComboBox>
        </div>
        <div class="sliSeparator">
        </div>
        <div class="sliColName">
            Brand:</div>
        <telerik:RadComboBox ID="cmbBrand" runat="server" Width="345px">
        </telerik:RadComboBox> <asp:HyperLink ID="lnkBrandPref" runat="server" Text="Brand preferences" NavigateUrl="#"></asp:HyperLink>
        <div class="sliSeparator">
        </div>
        <div class="sliColName">
            Allow substitute items?</div>
        <div class="sliColControl">
            <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="345px">
            </telerik:RadComboBox>
        </div>
        <div class="sliSeparator">
        </div>
        <div class="sliColName">
            Allow bulk discounts?</div>
        <div class="sliColControl">
            <telerik:RadComboBox ID="RadComboBox2" runat="server" Width="345px">
            </telerik:RadComboBox>
        </div>
        <div class="sliSeparator">
        </div>
        <div class="sliColName">
            Price alert?</div>
        <div class="sliColControl">
            <div class="divRadioButtons">
                <telerik:RadButton ID="btnPriceAlert" runat="server" ButtonType="ToggleButton" ToggleType="Radio"
                    Text="No" GroupName="grpPriceAlert">
                </telerik:RadButton>
                <br />
                <telerik:RadButton ID="RadButton1" runat="server" ButtonType="ToggleButton" ToggleType="Radio"
                    Text="Automatic - When GrocerMania finds a bargain price" GroupName="grpPriceAlert">
                </telerik:RadButton>
                <br />
                <telerik:RadButton ID="RadButton2" runat="server" ButtonType="ToggleButton" ToggleType="Radio"
                    Text="Manual - When the price is at or below $" GroupName="grpPriceAlert">
                </telerik:RadButton>
                <telerik:RadTextBox ID="priceLimit" runat="server" Width="50">
                </telerik:RadTextBox><br />
            </div>
        </div>
        <div class="sliSeparator">
        </div>
        <div class="centeredContent">
            <telerik:RadButton ID="btnSubmit" runat="server" OnClientClicking="OnClientClicking"
                Width="111" Height="31">
                <Image ImageUrl="../Images/btSubmitDarkBlue.gif" />
            </telerik:RadButton>
              
            <telerik:RadButton ID="btnAddToWishList" runat="server" OnClientClicking="OnClientClicking"
                Width="130" Height="31">
                <Image ImageUrl="../Images/btAddToWishListCharcoal.gif" />
            </telerik:RadButton>
              
            <telerik:RadButton ID="btnCancel" runat="server" OnClientClicking="CancelEdit" Width="72"
                Height="31">
                <Image ImageUrl="../Images/btCancelCharcoal.gif" />
            </telerik:RadButton>
        </div>
    </div>
    </form>
</body>
</html>


What am I doing wrong? The Window when it opens, is smaller in size ( about 250px bx 250px) and then readjust based on the content...I need to have it open the correct fixed size as defined in the RadWindow. Also the CSS skin is also ignored...although i have the csslink in the parent page!

Marin Bratanov
Telerik team
 answered on 06 Jan 2012
3 answers
96 views
Hi,
I have to modifiy a working web application which I did back in 2009.

The application has some RadGrids which only accept numeric value on their cells.

Currently it is possible to leave the cells blank.

Can you please show me how to force empty grid cells to a certain value (in this case 0)?

The RadGrid cells are created as follows:

protected void rgOutages_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        GridEditableItem item = (GridEditableItem)e.Item;
        GridNumericColumnEditor editor = (GridNumericColumnEditor)item.EditManager.GetColumnEditor("Unit_Outage_CountInflexible");
        editor.NumericTextBox.EmptyMessage = "0";
        editor.NumericTextBox.MaxLength = 8;
        editor.NumericTextBox.MaxValue = 999;
        editor.NumericTextBox.MinValue = 0;
        editor.NumericTextBox.NumberFormat.AllowRounding = true;
        editor.NumericTextBox.NumberFormat.DecimalDigits = 0;
        editor.NumericTextBox.Width = Unit.Percentage(100);
    }
}
Veli
Telerik team
 answered on 06 Jan 2012
1 answer
102 views
We are using Google like Filtering for the columns in a grid. The Filtering works fine for all the columns except for two columns which are displaying dates. The Format for the column in the Grid as well as the format for the date in the RadCombo(used for type ahead) is

"{0:dd-MMM-yyyy}".
Please suggest a solution.We are using a class file for this which is like your Demo File (CustomFilteringColumn.cs)

Shinu
Top achievements
Rank 2
 answered on 06 Jan 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?