Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
76 views
Heey Guys 

Is there an example of how to show a Combo Box item, say "Admin" only when a user acting in the role of administrator is currently logged in?

Thanks for help and fast answer ! `^
Nikola
Top achievements
Rank 2
 answered on 06 Nov 2012
1 answer
144 views

I have a RadScheduler where I use the AdvancedInsertTemplate and AdvancedEditTemplate.

In the AdvancedForm user control I want to show different controls depending on the logged in user is Administrator or a normal user. So I've added a LoginView like this:

<asp:Panel runat="server" ID="AdvancedControlsPanel" CssClass="rsAdvMoreControls">                  
<asp:Panel runat="server">
<%-- RESOURCE CONTROLS --%> 
<ul class="rsResourceControls">
<li>
<asp:LoginView ID="LoginView1" runat="server">
<RoleGroups>
<asp:RoleGroup Roles="Administrator">
<ContentTemplate>
                                              
<!-- Resource controls should follow the convention Res[Resource Name] for ID -->
 <scheduler:ResourceControl runat="server" ID="ResCustomer" Type="Customer" Label="Customer: "
Skin='<%# Owner.Skin %>' />
                                                          
 <telerik:RadComboBox runat="server" ID="EmployeeComboBox" Label="Employee: " Visible="true"
Skin="Outlook" Width="300px" CausesValidation="false" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged"
OnClientLoad="employeeClientLoad">
</telerik:RadComboBox>
                                              
</ContentTemplate>
</asp:RoleGroup>
<asp:RoleGroup Roles="User">
<ContentTemplate>
<asp:Label ID="LabelCustomer" runat="server" Text="CustomerName" />
</ContentTemplate>
</asp:RoleGroup>
</RoleGroups>
</asp:LoginView>
  
...

When compiling I then get an error saying "ResCustomer does not exist in current context":

[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
        public object Customer
        {
            get
            {
                return ResCustomer.Value;
            }
  
            set
            {
                ResCustomer.Value = value;
            }
        }

I then try to access the controls within the LoginView, but I can't find them:

LoginView lv = FindControl("LoginView1") as LoginView;
RadComboBox employeeComboBox = lv.FindControl("EmployeeComboBox") as RadComboBox;
Label customerLabel = lv.FindControl("LabelCustomer") as Label;

But now both the employeeComboBox and the customerLabel are null? The LoginView1 has been found, though.

And how do I find the ResCustomer?

On the page where the RadScheduler is I have a similar scenario, and there the controls within the LoginView are found without any problem.

What am I missing?

Regards, Jill-Connie Lorentsen

Plamen
Telerik team
 answered on 06 Nov 2012
0 answers
95 views


we are  using RadTabStrip in our project.functionality wise its works good.However,its giving me designing issues,tabs are overlapping with each other .please see attached screenshot  

below is my code

<telerik:RadTabStrip ID="RadTabStrip1" Skin="Default" Orientation="HorizontalTop" runat="server" SelectedIndex="0" MultiPageID="RadMultipage1"
            ShowBaseLine="true" >
            <Tabs>
                <telerik:RadTab Text="Advanced Search" Selected="true">
                </telerik:RadTab>
            </Tabs>
            <Tabs>
                <telerik:RadTab Text="Skill Search">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
Parimal
Top achievements
Rank 1
 asked on 06 Nov 2012
2 answers
77 views
Good morning,
I've a RadComboBox that used as "Multicolumn RadListBox".
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multicolumncombo/defaultcs.aspx

I would that the list of items is opened when I load the page (as click on right arrow of RadComboBox).
Is possible force this beahavior ?

Thanks,
Godd job
lupotana
Top achievements
Rank 1
 answered on 06 Nov 2012
1 answer
47 views
Hello,

I have a radwindow inside that i have places an aspx page. In that page I have placed a RadSplitter with two radpanes. And in each radpane I have placed an usercontrol. Both of the radpanes contains same usercontrol. So the control hierarchy is somthing like this :

RadWindow -> aspx page -> RadSplitter

Inside radSplitter there are two RadPanes separated by RadSplitBar. And Each RadPane contains an usercontrol inside.

All this stuff works fine in all other browsers except IE 8. Resize of split bar is working fine in IE 8 but expand and collapse is not working.
The two major problm IE 8 is creating is

1) Expand and collapse hides whole radPane
2) Background image of radWindow is not loading.

Please see images attached.

Kindly provide the solution if you have any idea regarding this.

Thanks in advance..




Vessy
Telerik team
 answered on 06 Nov 2012
2 answers
94 views
What I have right now is a RadGrid populated by the NeedDataSource event.  I'm tryin to add a details level.

Do I understand correctly?  If I want to set up a RadGrid with one or more detail levels, each detail level must be separately bound in it's own DetailTableDataBind event?  (The NeedDataSource event can only provide for the top level?)
Boris
Top achievements
Rank 1
 answered on 06 Nov 2012
6 answers
128 views
Hi,

I have tried to implement a load-on-demand scenario as per this demo, but have run into problems. When I first load the page, the first tab is populated properly. If I then click on the 2nd tab and then click back to the first one, the first tab is blank.

Here is my code:
CustomerDetails.aspx
    <script type="text/javascript">
 
        function onTabSelecting(sender, args) {
            if (args.get_tab().get_pageViewID()) {
                args.get_tab().set_postBack(false);
            }
        }
         
    </script>
 
<h1>Customer Details</h1>
 
<div class="normalPanel"><asp:Label ID="CustomerIdLabel" runat="server" Text="Customer ID: " /></div>
 
<telerik:RadTabStrip ID="CustomerDetailsRadTabStrip" ClientIDMode="Static" ShowBaseLine="true"
                     OnClientTabSelecting="onTabSelecting" runat="server" MultiPageID="CustomerDetailsRadMultiPage"
                     OnTabClick="RadTabStrip1_TabClick" Orientation="HorizontalTop">
</telerik:RadTabStrip>
 
<telerik:RadMultiPage ID="CustomerDetailsRadMultiPage" ClientIDMode="Static" runat="server" SelectedIndex="0"
                      OnPageViewCreated="RadMultiPage1_PageViewCreated">
</telerik:RadMultiPage>

CustomerDetails.aspx.cs
using System;
using Microsoft.Practices.ObjectBuilder;
using System.Collections;
using AWModel;
using System.Data.Objects;
using Telerik.Web.UI;
using System.Web.UI;
using AdvWorksWCSF.Shared.Code;
 
namespace AdvWorksWCSF.Customer.Views
{
    public partial class CustomerDetails : Microsoft.Practices.CompositeWeb.Web.UI.Page, ICustomerDetailsView
    {
        private CustomerDetailsPresenter _presenter;
        private ViewStateValue<int> customerID;
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this._presenter.OnViewInitialized();
 
                this.AddTab("Customer Details", "CustomerDetailsControl");
                this.AddPageView(this.CustomerDetailsRadTabStrip.FindTabByValue("CustomerDetailsControl"));
                this.AddTab("Demographics", "DemographicInfoControl");
 
                CustomerDetailsControl customerDetailsControl = this.CustomerDetailsRadMultiPage.FindControl("CustomerDetailsControl_userControl") as CustomerDetailsControl;
                customerDetailsControl.CustomerID = int.Parse(Request.QueryString["CustomerID"]);
                this.CustomerIdLabel.Text += customerDetailsControl.CustomerID.ToString();
            }
            this._presenter.OnViewLoaded();
        }
 
        [CreateNew]
        public CustomerDetailsPresenter Presenter
        {
            get
            {
                return this._presenter;
            }
            set
            {
                if (value == null)
                    throw new ArgumentNullException("value");
 
                this._presenter = value;
                this._presenter.View = this;
            }
        }
 
        private void AddTab(string tabName, string tabValue)
        {
            RadTab tab = new RadTab();
            tab.Text = tabName;
            tab.Value = tabValue;
            this.CustomerDetailsRadTabStrip.Tabs.Add(tab);
        }
 
        protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
        {
            string userControlToLoad = this.AppRelativeTemplateSourceDirectory +
                string.Format(Constants.BuildTabString, e.PageView.ID);
 
            Control userControl = Page.LoadControl(userControlToLoad);
            userControl.ID = string.Format(Constants.BuildUserControlString, e.PageView.ID);
 
            e.PageView.Controls.Add(userControl);
        }
 
        private void AddPageView(RadTab tab)
        {
            RadPageView pageView = new RadPageView();
            pageView.ID = tab.Value;
            this.CustomerDetailsRadMultiPage.PageViews.Add(pageView);
            //pageView.CssClass = "pageView";
            tab.PageViewID = pageView.ID;
        }
 
        protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
        {
            AddPageView(e.Tab);
            e.Tab.PageView.Selected = true;
        }
    }
}

CustomerDetailsControl.ascx
<%@ Control Language="C#" AutoEventWireup="true" Codebehind="CustomerDetailsControl.ascx.cs" Inherits="AdvWorksWCSF.Customer.Views.CustomerDetailsControl" %>
 
<%@ Import Namespace="AWModel" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
    <asp:FormView ID="CustomerDetailsFormView" runat="server" CssClass="customerDetailsForView">
        <ItemTemplate>
        <asp:Panel ID="NameDetailsPanel" runat="server" ClientIDMode="Static" GroupingText="Name and Title" CssClass="normalPanel">
            <div class="customerDetailsRow">
                <div class="customerDetailsLeftCell">
                    <div class="customerDetailsLabel">Title:</div>
                    <div class="customerDetailsValue"><asp:Label ID="TitleLabel" Text='<%# Eval("Title") %>' runat="server" /></div>
                </div>
                <div class="customerDetailsRightCell">
                    <div class="customerDetailsLabel">Last Name:</div>
                    <div class="customerDetailsValue"><asp:Label ID="LastNameLabel" Text='<%# ((GetDetailsForIndividualCustomerCT)Container.DataItem).LastName.ToString() %>' runat="server" /></div>
                </div>
            </div>
            <div class="customerDetailsRow">
                <div class="customerDetailsLeftCell">
                    <div class="customerDetailsLabel">First Name:</div>
                    <div class="customerDetailsValue"><asp:Label ID="FirstNameLabel" Text='<%# ((GetDetailsForIndividualCustomerCT)Container.DataItem).FirstName.ToString() %>' runat="server" /></div>
                </div>
                <div class="customerDetailsRightCell">
                    <div class="customerDetailsLabel">Middle Name:</div>
                    <div class="customerDetailsValue"><asp:Label ID="MiddleNameLabel" Text='<%# Eval("MiddleName") %>' runat="server" /></div>
                </div>
            </div>
        </asp:Panel>
        <asp:Panel ID="ContactDetailsPanel" GroupingText="Contact Details" runat="server" CssClass="normalPanel">
            <div class="customerDetailsRow">
                <div class="customerDetailsLeftCell">
                    <div class="customerDetailsLabel">Email:</div>
                    <div class="customerDetailsValue"><asp:Label ID="EmailLabel" Text='<%# ((GetDetailsForIndividualCustomerCT)Container.DataItem).EmailAddress.ToString() %>' runat="server" /></div>
                </div>
                <div class="customerDetailsRightCell">
                    <div class="customerDetailsLabel">Phone:</div>
                    <div class="customerDetailsValue"><asp:Label ID="PhoneLabel" Text='<%# Eval("Phone") %>' runat="server" /></div>
                </div>
            </div>
            <div class="customerDetailsRow">
                <div class="customerDetailsLeftCell">
                    <div class="customerDetailsLabel">Address:</div>
                    <div class="customerDetailsValue"><asp:Label ID="AddressLine1Label" Text='<%# ((GetDetailsForIndividualCustomerCT)Container.DataItem).AddressLine1.ToString() %>' runat="server" /></div>
                </div>
                <div class="customerDetailsLeftCell">
                    <div class="customerDetailsLabel"></div>
                    <div class="customerDetailsValue"><asp:Label ID="AddressLine2Label" Text='<%# Eval("AddressLine2") %>' runat="server" /></div>
                </div>
            </div>
            <div class="customerDetailsRow">
                <div class="customerDetailsLeftCell">
                    <div class="customerDetailsLabel">City:</div>
                    <div class="customerDetailsValue"><asp:Label ID="CityLabel" Text='<%# ((GetDetailsForIndividualCustomerCT)Container.DataItem).City.ToString() %>' runat="server" /></div>
                </div>
                <div class="customerDetailsRightCell">
                    <div class="customerDetailsLabel">Post code:</div>
                    <div class="customerDetailsValue"><asp:Label ID="PostalCodeLabel" Text='<%# Eval("PostalCode") %>' runat="server" /></div>
                </div>
            </div>
            <div class="customerDetailsRow">
                <div class="customerDetailsLeftCell">
                    <div class="customerDetailsLabel">State/Province:</div>
                    <div class="customerDetailsValue"><asp:Label ID="Label1" Text='<%# ((GetDetailsForIndividualCustomerCT)Container.DataItem).State_Province.ToString() %>' runat="server" /></div>
                </div>
                <div class="customerDetailsRightCell">
                    <div class="customerDetailsLabel">Sales Territory:</div>
                    <div class="customerDetailsValue"><asp:Label ID="Label2" Text='<%# ((GetDetailsForIndividualCustomerCT)Container.DataItem).Sales_Territory.ToString() %>' runat="server" /></div>
                </div>
            </div>
        </asp:Panel>
        </ItemTemplate>
    </asp:FormView>

CustomerDetailsControl.ascx.cs:
using System;
using Microsoft.Practices.ObjectBuilder;
using AWModel;
using System.Data.Objects;
 
namespace AdvWorksWCSF.Customer.Views
{
    public partial class CustomerDetailsControl : Microsoft.Practices.CompositeWeb.Web.UI.UserControl, ICustomerDetailsControlView
    {
        private CustomerDetailsControlPresenter _presenter;
        private int customerID;
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this._presenter.OnViewInitialized();
            }
            this._presenter.OnViewLoaded();
        }
 
        [CreateNew]
        public CustomerDetailsControlPresenter Presenter
        {
            get
            {
                return this._presenter;
            }
            set
            {
                if (value == null)
                    throw new ArgumentNullException("value");
 
                this._presenter = value;
                this._presenter.View = this;
            }
        }
 
        public int CustomerID
        {
            get
            {
                return customerID;
            }
            set
            {
                customerID = value;
            }
        }
 
        public ObjectResult<GetDetailsForIndividualCustomerCT> CustomerDetailsFormDataSource
        {
            set
            {
                this.CustomerDetailsFormView.DataSource = value;
                this.CustomerDetailsFormView.DataBind();
            }
        }
    }
}

There's another interesting thing which happens. If I add a RadAjaxManagerProxy to the aspx page setting the tabstrip as the source and updated controls along with the Multipage as a second updated control (as is done in the demo referred to above, a javascript error (null reference) is thrown.

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="CustomerDetailsRadTabStrip">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="CustomerDetailsRadTabStrip" />
                <telerik:AjaxUpdatedControl ControlID="CustomerDetailsRadMultiPage" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="CustomerDetailsRadMultiPage">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="CustomerDetailsRadMultiPage" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

Here is a screenshot of the error.

Can anyone see why there is a problem? What have I done wrong?

Cheers
Kwok (Andrew)
Top achievements
Rank 1
 answered on 06 Nov 2012
1 answer
242 views
hi there,
i have read many blog posts and have tried several different things and am stuck.

I have a Radwindow which contains a YouTube video. When I close the window, the audio continues to play.

I read all the blog posts (http://blogs.telerik.com/blogs/posts/09-06-04/common-radwindow-issues-and-their-solution.aspx) and attempted to perform the same methodology.

Here is my code on the aspx page:

<telerik:RadWindow ID="rwOrgDetails" runat="server" Modal="true"
       Behaviors="Close,Move"
        ShowContentDuringLoad="False" AutoSize="true"
        AutoSizeBehaviors="Default" MinWidth="400px" Animation="FlyIn"
        KeepInScreenBounds="True" VisibleStatusbar="False"
        OnClientShow="re" DestroyOnClose="true" OnClientClose="OnClientClose" EnableViewState="False">
     <ContentTemplate>
        <asb:organization ID="detailedView" runat="server" />
        <div align="center" class="hiddenClose" style="display:none" >
          <telerik:RadButton ID="RadButton6" SkinID="Close" runat="server" OnClientClicking="cw">
            </telerik:RadButton>      
        </div>
     </ContentTemplate>  
    </telerik:RadWindow>

Within the same page I have the following script:

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
 
    function OnClientClose(oWnd) {
        oWnd.setUrl("about:blank"); // Sets url to blank
  
   </script>
  </telerik:RadScriptBlock>

The function is being accessed, as I have put some alert("test") code in there to make sure but the video continues to play and I dont know if about:blank is being set correctly.

Any help is much appreciated.
Marin Bratanov
Telerik team
 answered on 06 Nov 2012
1 answer
113 views

Hi,

I have filtering enabled in my RadGrid.The filter row is visible, but don't want the filter icons in each table cell. Please provide a method to hide all filter buttons.

Thanks,

Shinu
Top achievements
Rank 2
 answered on 06 Nov 2012
4 answers
660 views
Hi, I want to change background color of selected date in RadCalendar. I need to change backgound color of selected date to be RED , GREEN, YELLOW or ORANGE depending upon selection made by user. I found SelectedDayStype property but could not make it work on through java script.

Can someone please help me?
Eyup
Telerik team
 answered on 06 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?