Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
168 views
Hi,

I had two user-controls on asp.net webpage. One had a dropdown selection listbox to select a value and other had a RadGridView to display the columns, I want to show / hide columns of RadGridView on drop-down selection. But I am unable to do not. Kindly help me on it. Below i am adding the code-snippet.


Default.aspx
------------------
<%@ Page Title="Home Page" Language="C#" MasterPageFile="" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<%--<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>--%>
<%@ Register Src="~/Selection.ascx" TagName="Selection" TagPrefix="uc2" %>
<%@ Register Src="~/Display.ascx" TagName="Display" TagPrefix="uc1" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <uc2:Selection ID="ucSelection" runat="server" />
    </div>
    <div>
        <uc1:Display ID="ucDisplay" runat="Server" />
    </div>
    </form>
</body>
</html>



Default.aspc.cs
--------------------
<%@ Page Title="Home Page" Language="C#" MasterPageFile="" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<%--<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>--%>
<%@ Register Src="~/Selection.ascx" TagName="Selection" TagPrefix="uc2" %>
<%@ Register Src="~/Display.ascx" TagName="Display" TagPrefix="uc1" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <uc2:Selection ID="ucSelection" runat="server" />
    </div>
    <div>
        <uc1:Display ID="ucDisplay" runat="Server" />
    </div>
    </form>
</body>
</html>

Selection.ascx
----------------------
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Selection.ascx.cs" Inherits="WebApplication1.Selection" %>
<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always" RenderMode="Inline">
    <ContentTemplate>
            <table border="0" cellpadding="5" cellspacing="0">
                <tr class="valigntop">
                <td>
                        Payment Type :
                        
                    </td>
                    <td>
                        <asp:DropDownList ID="cmbPaymentType" runat="server" OnSelectedIndexChanged="cmbPaymentType_SelectedIndexChanged"
                            AutoPostBack="true">
                            <asp:ListItem Text="11"></asp:ListItem>
                            <asp:ListItem Text="AA"></asp:ListItem>
                            <asp:ListItem Text="BB"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
            </table>
    </ContentTemplate>
</asp:UpdatePanel>

Selection.ascx.cs
---------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class Selection : System.Web.UI.UserControl
    {
        int i = 0;
        public event EventHandler PaymentTypeChange;

        public string PaymentType
        {
            get
            {
                return cmbPaymentType.SelectedItem.Text;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

      

        protected void cmbPaymentType_SelectedIndexChanged(object sender, EventArgs e)
        {
                PaymentTypeChange(this, e);
        }
    }
}

Display.ascx
-------------------
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Display.ascx.cs" Inherits="WebApplication1.Display" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="always" RenderMode="Inline">
    <ContentTemplate>
    <asp:Label ID="lblTest1" Text="Test" runat="server" Visible="false"></asp:Label>
    <telerik:RadGrid ID="rgTest" runat="server" GridLines="None" AutoGenerateColumns="False"
           EnableEmbeddedSkins="false" >
        <MasterTableView CommandItemDisplay="Top" EditMode="InPlace" TableLayout="Fixed">
            <Columns>
               <telerik:GridTemplateColumn DataField="ID" UniqueName="TestID" Visible="False">
                   <ItemTemplate>
                        <asp:Label ID="DisplayId" runat="server" Text="Id"></asp:Label>
                   </ItemTemplate>
               </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn DataField="Name" UniqueName="TestName" Visible="False">
                   <ItemTemplate>
                        <asp:Label ID="DisplayName" runat="server" Text="Name"></asp:Label>
                   </ItemTemplate>
               </telerik:GridTemplateColumn>
            </Columns>    
        </MasterTableView>
    </telerik:RadGrid>
    </ContentTemplate>
</asp:UpdatePan

Display.ascx.cs
--------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using Telerik.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class Display : System.Web.UI.UserControl
    {
                
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public void SetVisiblity(bool enableVisiblity)
        {
            if (enableVisiblity == true)
            {
                foreach(GridColumn gd in rgTest.Columns)
                {
                    gd.Visible = true;
                }
                lblTest1.Visible = true;
            }
            else
            {
                foreach (GridColumn gd in rgTest.Columns)
                {
                    gd.Visible = false;
                }
                lblTest1.Visible = false;
            }
        }
    }
}
Angel Petrov
Telerik team
 answered on 17 Jun 2013
1 answer
51 views

Hi,
  I have used Radcontrol in Radcombobox, Radtextbox In Grid(See my grid row screen shot)
 Item list selected to assign Descrption also.
Then i have entered remaining fileds.
 Rate Column Entered to Tab Key Press Next Row Item filed to focus set.
How to Row Create and radcombobox to bind

Example:
 Default Grid Row set 5 Rows
  I have Entered 4th row Rate to Tab Key Press add one Row With radCombobox Bind.


Thanks,
Ansari
Eyup
Telerik team
 answered on 17 Jun 2013
1 answer
248 views
Hi,

We have an application built in Silverlight, in it we are using RadDateTimePickerControl for Silverlight which shows Date and time together in the popup windows.

We also have few ASP.Net pages which we are showing in the above Silverlight application.

In ASP.net pages we are also using the RadDateTimePickercontral for ASP.net but in it Date and Time comes as separate selectable icons and user has to click date icon to select date and clock icon to select time.

We want both the control to behave same for consistency.
Could you suggest some approch or way to make the ASP.net RadDateTimePickerControl to behave same as Silverlight RadDataTimePickerControl.

Thanks and Regards,
Nitin Garg

Kostadin
Telerik team
 answered on 17 Jun 2013
1 answer
197 views
Hello!

I have a 'classic' RadMenu with different items. My goal is to read the text of the menu items from a funtion in code behind. Reading from resx works (first item). The other menu items don't show any text.

ASPX:
         <radM:RadMenu ID="phMenu" runat="server" IsContext="True" ContextMenuElementID="none"
            CausesValidation="false">
            <Items>
               <radM:RadMenuItem runat="server" Text="<%$Resources:InputControlsRes,menuAddFiltername_Text %>" Value="AddFiltername" />
               <radM:RadMenuItem runat="server" Text='<%# GetStringResource("ActionId") %>' Value="AddActionId" />
               <radM:RadMenuItem runat="server" Text='<%# GetStringResourceActionId %>' Value="AddActionIdFix" />
               <radM:RadMenuItem runat="server" Text='<%= GetStringResourceActionIdPro100 %>' Value="AddActionIdFixPro100" />
            </Items>
         </radM:RadMenu>

Code Behind:
   Protected Function GetStringResource(key As String) As String
      Return key
   End Function

   Protected Function GetStringResourceActionId() As String
      Return "ActionId"
   End Function

   Protected Function GetStringResourceActionIdPro100() As String
      Return "GetStringResourceActionIdPro100"
   End Function

Functions in code behind are never called, even if I do a DataBind.

Regards,
Tonino.
Kate
Telerik team
 answered on 17 Jun 2013
1 answer
100 views
Hi 
I have time DateTimePicker On my radscheduler. I am trying to bind my time that starts from 4:00 am and goes next day till 3:30. 

This is how i am binding my time.
 startpicker.TimeView.CustomTimeValues = Assistant.TimeList(Assistant.GetStartTimeOfDay(this.TrmUsageSettingList["StartTimeOfDay"].ReturnValue));
 startpicker.TimeView.DataList.DataSource = Assistant.TimeList(Assistant.GetStartTimeOfDay(this.TrmUsageSettingList["StartTimeOfDay"].ReturnValue));
 startpicker.TimeView.DataList.DataBind();

But my screen looks like this(see attached file). I cannot see any time there but if i click there is a value. 

Thank you.

  
Vasil
Telerik team
 answered on 17 Jun 2013
5 answers
548 views
We're migrating to Azure and need to figure out how to configure the RadUpload control to write binary files (images specifically) to Azure Blob storage.  Can someone point me to documentation that demonstrates how to accomplish this? Thanks!
Peter Filipov
Telerik team
 answered on 17 Jun 2013
1 answer
77 views
Hi, 
How can i hide resource type if my ClientFormCreated function is in javascript.
Thanks in advance.
Plamen
Telerik team
 answered on 17 Jun 2013
7 answers
102 views
Hi,

I have a web page containing a RadTabStrip which has its orientation set to VerticalLeft.  It works fine in all browsers except IE7.  You can see the same behaviour off the demo page.  To reproduce:

In IE7, open http://demos.telerik.com/aspnet-ajax/tabstrip/examples/functionality/orientation/defaultcs.aspx then select the VerticalLeftOrientation.  You will get a HorizontalTop orientation instead.  See attached screen shot.

I've also noticed that VerticalRight actually behaves as HorizontalBottom.

Does anyone have a woraround for this?

Thanks,

-- Joel
Ivan Zhekov
Telerik team
 answered on 17 Jun 2013
7 answers
152 views
I am using the following css to change the default Metro Skin for the toolbar control. I need the toolbar to be a different color other that white (by the way, white was an odd choice for the primary color of a control that needs to be as prominent as a toolbar). Nevertheless, everything in my style works (I remove the toolbar borders as well), however, now I see that dropdown buttons aren't showing their text. This is because I set the button text color to white so it shows up against the now colored toolbar background. How do I set the background-color and/or text color of dropdown items only (ie dropdown buttons, splitbars buttons, etc.) and leave the main toolbar text as white?

Thanks.
.FullBorderlessToolbar .rtbOuter, .rtbMiddle
{
    background-color: #4BB0E7 !important;  
border: 0px !important;
}
 
.FullBorderlessToolbar .rtbTemplate, .rtbWrap {
  color: #ffffff !important;
}
 
.FullBorderlessToolbar .rtbSplBtnFocused .rtbWrap,
.FullBorderlessToolbar .rtbItemFocused .rtbWrap,
.FullBorderlessToolbar .rtbItemHovered .rtbWrap {
  background-color: #1485ba !important; }
Ivan Zhekov
Telerik team
 answered on 17 Jun 2013
5 answers
307 views
Hello,

I'm trying to set the crop width and height to 100 on start, and I don't want people change the crop box size.
How to make the with/height static and unchangeable?

I use the latest version 2011.2.712.40

Thanks

Dobromir
Telerik team
 answered on 17 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?