Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
193 views

Request is not available in this context
Referred this but no help.

  

at System.Web.UI.Page.get_Request()  
  at Telerik.Web.UI.RadGrid.BrowserIsCrawler()
  at Telerik.Web.UI.RadGrid.OnInit(EventArgs e)
  at System.Web.UI.Control.InitRecursive(Control namingContainer)
  at System.Web.UI.Control.AddedControl(Control control, Int32 index)
  at System.Web.UI.ControlCollection.Add(Control child)
  at MyPage.productControl(Page& Page, Control& ctrl, HttpServerUtility& Server) in C:\inetpub\wwwroot\Test\test.vb:line 45
  at testControl() in C:\inetpub\wwwroot\TestC\Ctrl1.ascx.vb:line 37
  at page_Load(Object sender, EventArgs e) in C:\inetpub\wwwroot\TestC\Ctrl1.ascx.vb:line 15
  at System.Web.UI.Control.OnLoad(EventArgs e)
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.AddedControl(Control control, Int32 index)
  at System.Web.UI.ControlCollection.Add(Control child)
  at tabMultiPage1_PageViewCreated(Object sender, RadMultiPageEventArgs e) in C:\inetpub\wwwroot\Product.aspx.vb:line 324
  at Telerik.Web.UI.RadMultiPage.OnPageViewCreated(RadMultiPageEventArgs eventArgs)
  at Telerik.Web.UI.RadMultiPage.AddedControl(Control control, Int32 index)
  at System.Web.UI.ControlCollection.Add(Control child)
  at Telerik.Web.UI.RadPageViewCollection.Add(RadPageView pageView)
  at Home.AddTab(String stringName, XmlNode xNode,String ctrlName) in C:\inetpub\wwwroot\Product.aspx.vb:line 192
  at Handler.Submit(RadMultiPage& tabMultiPage, XmlDocument docRequest) in C:\inetpub\wwwroot\Handling.vb:line 101
  at TreeControl.Button2_Click(Object sender, EventArgs e) in C:\inetpub\wwwroot\Controls\TreeControl.ascx.vb:line 424
  at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
  at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
  at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
  at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
  at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
  at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Pavlina
Telerik team
 answered on 23 Jul 2010
4 answers
138 views
How do I get the hidden value after the ajax postback so that the menu can enable/disable the menu item?
Thanks.
Yana
Telerik team
 answered on 23 Jul 2010
3 answers
154 views

Hi all

I'm writing a web to manage image. I have an database name 'Manage_Image' with one table 'images' (int- id, nvarchar- imagesource) and I have a web page. Now I can load images to Datalist, but I wonder can I drag and drop a image to a nother position of the Datalist(as window explorer). Please help me at this
thank you very much!

Phuoc
Sebastian
Telerik team
 answered on 23 Jul 2010
1 answer
126 views
Hi,

I am working on RadGrid. I want to add Checkbox itemtamplate on runtime using C#.Net code. 
Please guide me.

Thanks
Shinu
Top achievements
Rank 2
 answered on 23 Jul 2010
2 answers
165 views
Hi,

I am trying to add a Programmtically databound Telerik TreeView in Combo Box just like you showed it in your tutorial for combo box application scenarios. I am trying to do this in a sharepoint webpart , that'S why I have to do every thing with code. I tried adding treeview to Combobox's controls collection, it did not work.
Could you give me an example how to achieve this programmatically?



Regards

Bhupinder
Kalina
Telerik team
 answered on 23 Jul 2010
7 answers
375 views
I'm having some issues with the RadFilter.

I'm using an Image Folder as a datasource and using the following command to pull all the DataFields within the folder;

Dim dirInfo As New DirectoryInfo(Server.MapPath("~/GalleryFiles"))

RadListView1.DataSource = dirInfo.GetFiles("*.jpg")
RadListView1.DataBind() 

from all the possible DataFields I'm only using the "Name" and "LastWriteTime" Fields. I want to be able to use the "LastWriteTime" field and filter it purely based on the date it pulls. Is there a way to get RadFilter to ignore the Time parameter as images will be created regularly and the time filter is too precise.

Any feedback would be much appreciated.

Thank you 


Nikolay Rusev
Telerik team
 answered on 23 Jul 2010
3 answers
89 views
2009.3.1503.35

If I tab off a textbox configured using AjaxMgr with AutoPostback=true, the screen shows that the next control gets focus then the loadingpanel shows, after Ajax the next field loses focus.

Is there a way to make the next control get the focus after Ajax?
Maria Ilieva
Telerik team
 answered on 23 Jul 2010
5 answers
166 views
I have a RadCalendar that it use to update the content in a Iframe when the date selected has changed.  It seems when I use the arrows to change the month or year, it appears to make a new request as opposed to an Ajax Request.  I see in a tool it contains the entire page content.  When I put break points in my code I do see the request going to the page load.  any ideas why it is doing this?




    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        onajaxrequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting  AjaxControlID="rcStartDate">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rcStartDate"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="lbTitle" />
                    <telerik:AjaxUpdatedControl ControlID="lbFilename" />
                    <telerik:AjaxUpdatedControl ControlID="lbStartDate" />
                    <telerik:AjaxUpdatedControl ControlID="iframe"  />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

             <telerik:RadCalendar ID="rcStartDate"  runat="server" Font-Names="Arial, Verdana, Tahoma"
                    ForeColor="Black" FirstDayOfWeek="Monday"  AutoPostBack=true  
                    Skin="Web20" ondayrender="rcStartDate_DayRender"  
                    onselectionchanged="rcStartDate_SelectionChanged" MultiViewRows=2
                    EnableMultiSelect="False">
                            <SelectedDayStyle CssClass="SelectedDatesCSS" />
                            <ClientEvents OnDayRender="OnDayRender" />
                    </telerik:RadCalendar>



             <telerik:RadCalendar ID="rcStartDate"  runat="server" Font-Names="Arial, Verdana, Tahoma"
                    ForeColor="Black" FirstDayOfWeek="Monday"  AutoPostBack=true  
                    Skin="Web20" ondayrender="rcStartDate_DayRender"  
                    onselectionchanged="rcStartDate_SelectionChanged" MultiViewRows=2
                    EnableMultiSelect="False">
                            <SelectedDayStyle CssClass="SelectedDatesCSS" />
                            <ClientEvents OnDayRender="OnDayRender" />
                    </telerik:RadCalendar>
Maria Ilieva
Telerik team
 answered on 23 Jul 2010
1 answer
171 views
Hi All,

I'm creating a little custom control that encapsulates the RadCombobox.
For my custom control, I created an ItemTemplate that adds a checkbox and changes the background of the items added to the radcombobox.

It seems that the databinding events are not triggered...

In my ItemTemplate.CS i've added the following code:

public void InstantiateIn(Control container)
 {
     if (null != container)
     {
         // Create the panel
         using (Panel categoryPanel = new Panel())
         {
             categoryPanel.ID = "CategoriesDropDownPanel";
             categoryPanel.Width = Unit.Percentage(100);
             categoryPanel.DataBinding += new EventHandler(CategoryPanel_DataBinding);
 
             // Create the checkbox
             using (CheckBox checkBox = new CheckBox())
             {
                 checkBox.ID = "CategoriesDropDownCheckBox";
                 checkBox.Text = "Category";
                 checkBox.DataBinding += new EventHandler(CheckBox_DataBinding);
                 categoryPanel.Controls.Add(checkBox);
             }
             container.Controls.Add(categoryPanel);
         }
     }
 }

private void CategoryPanel_DataBinding(object sender, EventArgs e)
{
    // TODO: Never gets called!
    Panel target = (Panel)sender;
    RadComboBoxItem container = (RadComboBoxItem)target.BindingContainer;
    Category category = (Category)container.DataItem;
    target.BackColor = System.Drawing.Color.FromArgb(category.Color);
}

private void CheckBox_DataBinding(object sender, EventArgs e)
{
    // TODO: Never gets called!
    CheckBox target = (CheckBox)sender;
    RadComboBoxItem container = (RadComboBoxItem)target.BindingContainer;
    target.Text = (string)DataBinder.Eval(container.DataItem, "Name");
}

I've been able to get around this, by adding the code to the of RadCategoryDropDown_ItemDataBound my custom control.
My Custom control looks like:

using System;
using System.Globalization;
using System.Collections;
using System.ComponentModel;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Collections.ObjectModel;
using System.Web.UI.HtmlControls;
using System.Data;
using CategoryDropDownTest.Entities;
 
namespace CategoryDropDownTest.CustomControls
{
    /// <summary>
    /// USG Web Server Control for displaying a category dropdown in a website
    /// </summary>
    [ToolboxData("<{0}:CategoryDropDown runat=server></{0}:CategoryDropDown>"),
     /*ParseChildren(false),*/
    ParseChildren(ChildrenAsProperties = true),
    PersistChildren(false),
    DefaultProperty("Text")]
    public class CategoryDropDown : CompositeControl, INamingContainer
    {
 
        #region Private Members
 
        private RadComboBox radCategoryDropDown;
        private Collection<Category> items = new Collection<Category>();
 
        #endregion
 
        #region Public Properties
 
        /// <summary>
        /// gets the collection of Category
        /// </summary>
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
        PersistenceMode(PersistenceMode.InnerProperty),
        MergableProperty(false),
        Category("CategoryDropDown Properties"), Description("Categories of the dropdown menu.")]
        public Collection<Category> Items
        {
            get { return items; }
        }
         
        /// <summary>
        /// Gets or sets the Text to be displayed
        /// </summary>
        [Category("CategoryDropDown Properties"), Description("Text for the categoryDropDown")]
        public string Text { get; set; }
 
        #endregion
 
        #region Overriden Methods
 
        #region RenderContents
 
        /// <summary>
        /// Overridden RenderContents
        /// </summary>
        /// <param name="writer">HmltTextWriter parameter</param>
        protected override void RenderContents(HtmlTextWriter writer)
        {
 
            if (this.DesignMode)
            {
                // In design mode, display only the id
                if (writer != null) writer.WriteLine(this.ID);
            }
            else
            {
            }
            base.RenderContents(writer);
        }
 
        #endregion
 
        #region OnInit
 
        /// <summary>
        /// Overridden OnInit
        /// </summary>
        /// <param name="e">EventArfs parameter</param>
        protected override void OnInit(EventArgs e)
        {
            // Initialize the controls
            this.InitControl();
            base.OnInit(e);
        }
 
        #endregion
 
        #region OnLoad
 
        /// <summary>
        /// Overriden OnLoad
        /// </summary>
        /// <param name="e">EventArgs parameter</param>
        protected override void OnLoad(EventArgs e)
        {
            // Load the control
            this.LoadControl();
            base.OnLoad(e);
        }
 
        #endregion
 
        #endregion
 
        #region Private Methods
 
        /// <summary>
        /// Initialize the control
        /// </summary>
        private void InitControl()
        {
            // Create the RadCategoryDropDown
            this.radCategoryDropDown = new RadComboBox();
        }
 
        #region LoadControl
 
        /// <summary>
        /// Load the control
        /// </summary>
        private void LoadControl()
        {
            // Set fixed properties
            //this.radCategoryDropDown.HeaderTemplate = new HeaderTemplate();
            this.radCategoryDropDown.ItemTemplate = new ItemTemplate();
            this.radCategoryDropDown.ChangeTextOnKeyBoardNavigation = false;
            this.radCategoryDropDown.EnableTextSelection = false;
            this.radCategoryDropDown.HighlightTemplatedItems = true;
            this.radCategoryDropDown.EnableViewState = false;
 
            // Bind the events
            this.radCategoryDropDown.ItemDataBound += new RadComboBoxItemEventHandler(RadCategoryDropDown_ItemDataBound);
          
            // Add the properties
            this.radCategoryDropDown.Text = this.Text;
            if ((null != this.items) && (this.items.Count > 0))
            {
                this.radCategoryDropDown.DataSource = this.items;
                this.radCategoryDropDown.DataTextField = "Name";
                this.radCategoryDropDown.DataValueField = "Id";
                this.radCategoryDropDown.DataBind();
            }
 
            // Add the control
            this.Controls.Add(radCategoryDropDown);
        }
 
        #endregion
 
        #region Events
 
        /// <summary>
        /// ItemDataBound event of the radCategoryDropDown
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void RadCategoryDropDown_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
        {
            if (e != null)
            {
                // Get the category
                Category category = (Category) e.Item.DataItem;
                // Find the panel
                Panel itemPanel = (Panel)e.Item.FindControl("CategoriesDropDownPanel");
                if (null != itemPanel)
                {
                    // TODO: Check if it can be added through the item template
                    //itemPanel.BackColor = System.Drawing.Color.FromArgb(category.Color);
                    // Find the checkbox
                    CheckBox itemCheckBox = (CheckBox) itemPanel.FindControl("CategoriesDropDownCheckBox");
                    if (null != itemPanel)
                    {
                        // TODO: Remove, should be added through the item template
                        //itemCheckBox.Text = category.Name;
                    }
                }
            }
        }
 
        #endregion
 
        #endregion
 
    }
}

However, I believe this is not the right way to do this.

Anyone an idea how to get the databinding events in the ItemTemplate to work? Perhaps It's possible to set the values in the InstantiateIn Mehtod???

Kind regards,

Michel
Helen
Telerik team
 answered on 23 Jul 2010
3 answers
161 views
Hey guys,

i`have noticed an issue with RadAsyncUpload.It occurs that the AsyncUpload controls doesn`t work within Firefox?

In IE and Webkit it runs perfectly but in in Firefox it shows no function. I even can`t select a file.

It is curious because on your Demo site it is working very well within firefox.

I`m using the new Q2 2010.02.713 release of the controls.

Any suggestions out there?
Chris
Top achievements
Rank 1
 answered on 23 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?