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

Hi,

I want to create a webpage which contains an imagemap with hotspots. On mouse move over the hotspots I want to display a tool tip, not just the alt.Text, but rather more information with another image and some text. I was following the RadToolTip demo (First Look) and adapted the same method to create this. But it is not working. I am attaching the code (only two web pages). Please some one take a look and tell me what I am doing wrong.  The tool tip information is not pulled from any database but generated in the codebehind file based on the ID of the hotspot.

Since I spend almost a week playing with it with out any luck, any help is greately appreciated,
Thanks
Joe

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DefaultCS.aspx.cs" Inherits="tooltiptest.DefaultCS" %>
  
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Src="LocSummary.ascx" TagName="LocSummary" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head>
<title></title>
      
    <style type="text/css">
        .test
        {
            float: right;
        }
    </style>
</head>
  
<body class="BODY">
    <form id="form1" runat="server">
     
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
     
   <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <h1> Our Locations </h1>
      
     
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" 
        Skin="Forest" DecoratedControls="All" />
  
          <div id="mainimgdiv" style=" width:800px; height:500px">
              
             <asp:imageMap ID="cdslocations" runat="server" 
                ImageUrl="cdslocs.jpg"   
                HotSpotMode="PostBack"  Enabled="true" ViewStateMode="Enabled"
                    
                
  
            </asp:imageMap>
  
                  
                <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"  ></telerik:RadAjaxLoadingPanel>
  
                
                 <telerik:RadToolTipManager runat="server" AnimationDuration="300" ShowDelay="200"
            EnableShadow="True" HideDelay="1" ID="RadToolTipManager1" Width="453px" Height="210px"
            RelativeTo"BrowserWindow" Animation= "Slide" OnAjaxUpdate="OnAjaxUpdate"
            Skin="Telerik" Title = "Location Summary:" />
  
            <telerik:RadAjaxManager ID ="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadToolTipManager1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" 
                                LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
           
        </div>
    </form>
</body>
</html>
  
Code behind
  
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
using System.Threading;
using System.IO;
using Telerik;
  
namespace tooltiptest
{
    public partial class DefaultCS : System.Web.UI.Page
    {
         
        protected void Page_Load(object sender, EventArgs e)
        {
  
            // define the circle hotspot
            CircleHotSpot Circle1 = new CircleHotSpot();
            Circle1.HotSpotMode = HotSpotMode.PostBack;
            Circle1.NavigateUrl = "~/northnj.aspx";
            Circle1.X = 458;
            Circle1.Y = 120;
            Circle1.Radius = 15;
            Circle1.AlternateText = "WH";
              
            // Add Circle1 to the ImageMap's HotSpotCollection.    
            cdslocations.HotSpots.Add(Circle1);
             
  
            
            CircleHotSpot Circle2 = new CircleHotSpot();
            Circle2.HotSpotMode = HotSpotMode.PostBack;
           // Circle2.NavigateUrl = "~/lehighvalley.aspx";
            Circle2.X = 433;
            Circle2.Y = 128;
            Circle2.Radius = 15;
            Circle2.AlternateText = "AT";
            cdslocations.HotSpots.Add(Circle2);
  
            CircleHotSpot Circle3 = new CircleHotSpot();
            Circle3.HotSpotMode = HotSpotMode.PostBack;
           // Circle3.NavigateUrl = "~/fortwayne.aspx";
            Circle3.X = 352;
            Circle3.Y = 143;
            Circle3.Radius = 15;
            Circle3.AlternateText = "BF";
            cdslocations.HotSpots.Add(Circle3);
  
            CircleHotSpot Circle4 = new CircleHotSpot();
            Circle4.HotSpotMode = HotSpotMode.PostBack;
           // Circle4.NavigateUrl = "~/stlouis.aspx";
            Circle4.X = 317;
            Circle4.Y = 172;
            Circle4.Radius = 15;
            Circle4.AlternateText = "EV";
              
            cdslocations.HotSpots.Add(Circle4);
  
            CircleHotSpot Circle5 = new CircleHotSpot();
            Circle5.HotSpotMode = HotSpotMode.PostBack;
            //Circle5.NavigateUrl = "~/tulsa.aspx";
            Circle5.X = 263;
            Circle5.Y = 208;
            Circle5.Radius = 15;
            Circle5.AlternateText = "FG";
            cdslocations.HotSpots.Add(Circle5);
  
            CircleHotSpot Circle6 = new CircleHotSpot();
            Circle6.HotSpotMode = HotSpotMode.PostBack;
            //Circle6.NavigateUrl = "~/losangelos.aspx";
            Circle6.X = 49;
            Circle6.Y = 203;
            Circle6.Radius = 15;
            Circle6.AlternateText = "ON";
           
            cdslocations.HotSpots.Add(Circle6);
  
            foreach (CircleHotSpot spot in cdslocations.HotSpots)
            {
                //The first argument of add method requires the client Id 
                //the example implementation will set the id to be the name of the country itself
              this.RadToolTipManager1.TargetControls.Add(spot.AlternateText, spot.AlternateText, true);              
            }            
        }
        protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
        {
            this.UpdateToolTip(args.Value, args.UpdatePanel);
        }
        private void UpdateToolTip(string elementID, UpdatePanel panel)
        {
            Control ctrl = Page.LoadControl("LocSummary.ascx");
            panel.ContentTemplateContainer.Controls.Add(ctrl);
            LocSummary details = (LocSummary)ctrl;
            details.LocId = elementID;
              
        }
  
    }
}
  
LocSummary ASpx  - this is a user control file which should show as tooltip
  
  
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LocSummary.ascx.cs" Inherits="tooltiptest.LocSummary" %>
<asp:FormView ID="LocView" DataKeyNames="LocId"
    runat="server" OnDataBound="LocView_DataBound" Width="453px" 
    onpageindexchanging="LocView_PageIndexChanging" CellPadding="4" 
    ForeColor="#333333">
    <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
    <ItemTemplate>
        <div style="float: left; border: 1px solid #999999; margin-right: 20px; width: 200px;
            height: 200px; background-position: center; background-repeat: no-repeat;" >
            <asp:Image ID="LocImage"  runat="server" />
        </div>
        <div style="width: 200px; float: left;">
            <div style="float: left; padding-top: 20px;">
                <asp:Label CssClass="info" ID="LocationName" runat="server" Style="font-size: 24px; padding-left: 4px;"></asp:Label>
  
                <br />
                <br />
                <span class='title' style="color: #c98400">Highways:</span>
                <asp:Label CssClass="info" ID="LbHigways" runat="server"></asp:Label>
                <br />
                <span class='title' style="color: #c98400">Squre Foot:</span>
                <asp:Label CssClass="info" ID="LbSqFoot" runat="server"></asp:Label>
                <br />
                <span class='title' style="color: #c98400">Construction:</span>
                <asp:Label CssClass="info" ID="LbConstruction" runat="server"></asp:Label>
                <br />
            </div>
        </div>
    </ItemTemplate>
    <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
    <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
</asp:FormView>
  
Code behind
  
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Threading;
using System.IO;
  
namespace tooltiptest
{
    public partial class LocSummary : System.Web.UI.UserControl
    {
         public string LocId
        {
            get
            {
                if (ViewState["LocId"] == null)
                {
                    return "";
                }
                return (string)ViewState["LocId"];
            }
            set
            {
                ViewState["LocId"] = value;
            }
        }
        protected void LocView_PageIndexChanging(object sender, FormViewPageEventArgs e)
        {
        }
  
        protected void Page_Load(object sender, EventArgs e)
        {
            this.DataBind();
        }
  
        protected void LocView_DataBound(object sender, EventArgs e)
        {
  
            string lcID = e.ToString();
            string locName = "" ;
            string locHigWays = "";
            string locSqFoot = "";
            string locConstruction = "";
            string lcImageUrl = ""; 
            switch (LocId)
            {
  
                case "WH":
                    locName = "Wharton, NJ";
                    locHigWays = "80/46";
                    locSqFoot = "650000";
                    locConstruction = "Concrete";
                    lcImageUrl = "smallloc.png";
                    break;
                case "PA":
                    locName = "Pensilvania, PA";
                    locHigWays = "80/78";
                    locSqFoot = "650000";
                    locConstruction = "Concrete";
                    lcImageUrl = "smallloc.png";
                    break;
                case "CA":
                    locName = "Ontario, CA";
                    locHigWays = "100/80/35";
                    locSqFoot = "350000";
                    locConstruction = "Concrete";
                    lcImageUrl = "smallloc.png";
                    break;
                case "BF":
                    locName = "Bluffton, IN";
                    locHigWays = "200/145";
                    locSqFoot = "150000";
                    locConstruction = "Concrete";
                    lcImageUrl = "smallloc.png";
                    break;
                case "IL":
                    locName = "Edwardsville, IL";
                    locHigWays = "66/77";
                    locSqFoot = "650000";
                    locConstruction = "Steel";
                    lcImageUrl = "smallloc.png";
                    break;
  
                case "FG":
                    locName = "Fort Gibson, OK";
                    locHigWays = "35/76";
                    locSqFoot = "450000";
                    locConstruction = "Steel";
                    lcImageUrl = "smallloc.png";
                    break;
                default:
                    locName = "Wharton, NJ";
                    locHigWays = "80/78";
                    locSqFoot = "650000";
                    locConstruction = "Concrete";
                    lcImageUrl = "smallloc.png";
                    break;
            }
            //populate the summary information of the location
            System.Web.UI.WebControls.Image image = (System.Web.UI.WebControls.Image)this.FindControl("LocImage");
            if (image == null) return;
            if (!File.Exists(MapPath(image.ImageUrl)))
            {
  
                image.ImageUrl = lcImageUrl;
            }
            System.Web.UI.WebControls.Literal lit1 = (System.Web.UI.WebControls.Literal)this.FindControl("LocationName");
            lit1.Text = locName;
            System.Web.UI.WebControls.Literal lit2 = (System.Web.UI.WebControls.Literal)this.FindControl("LbHigways");
            lit2.Text = locHigWays;
            System.Web.UI.WebControls.Literal lit4 = (System.Web.UI.WebControls.Literal)this.FindControl("LbSqFoot");
            lit1.Text = locSqFoot;
            System.Web.UI.WebControls.Literal lit5 = (System.Web.UI.WebControls.Literal)this.FindControl("LbConstruction");
            lit1.Text = locConstruction;
             
        }
    }
}
Svetlina Anati
Telerik team
 answered on 20 Dec 2010
8 answers
255 views
Dear telerik,
I have create a listbox with template item, the problem when trying to transfer items it transfered but it appears empty

please help

ASPX:
<telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel3">
    <telerik:RadListBox ID="RadListBox5" runat="server" Height="150px" Width="215px" SelectionMode="Single"
        AutoPostBackOnTransfer="true" AllowTransfer="true"
        TransferToID="RadListBox6" OnTransferred="RadListBox5_Transferred">
        <ButtonSettings ShowTransferAll="false" VerticalAlign="Middle" />
        <ItemTemplate>
            <table cellpadding="1" cellspacing="0" border="0">
                <tr>
                    <td><b><%# Eval("Title") %></b></td>
                    <td> [Price:</td>
                    <td><%# Convert.ToInt32(Eval("Price")).ToString("C0")%>]</td>
                </tr>
            </table>
        </ItemTemplate>
    </telerik:RadListBox>
    <telerik:RadListBox ID="RadListBox6" runat="server" Height="150px" Width="200px" SelectionMode="Single">
        <ItemTemplate>
            <table cellpadding="1" cellspacing="0" border="0">
                <tr>
                    <td><b><%# Eval("Title") %></b></td>
                    <td> [Price:</td>
                    <td><%# Convert.ToInt32(Eval("Price")).ToString("C0")%>]</td>
                </tr>
                <tr>
                    <td colspan="3">
                        Quantity:
                        <telerik:RadNumericTextBox runat="server" ID="QuantityTextBox" Width="80px" MinValue="1" MaxValue="10" ShowSpinButtons="true" Value="1" NumberFormat-DecimalDigits="0" />
                        <asp:RequiredFieldValidator ID="RequiredQuantityTextBox" ControlToValidate="QuantityTextBox" runat="server" ErrorMessage="*">*</asp:RequiredFieldValidator>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </telerik:RadListBox>
</telerik:RadAjaxPanel>

CS:
      protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            RadListBox5_Load();
            RadListBox6_Load();
        }
    }
 
      public class Spinning
    {
        public string Title { get; set; }
        public double Price { get; set; }
        public int Quantity { get; set; }
    }
 
    void RadListBox5_Load()
    {
        List<Spinning> SpinningList = new List<Spinning>
        {
            new Spinning { Title = "Spinning Reel 1", Price = 100, Quantity = 1 },
            new Spinning { Title = "Spinning Reel 2", Price = 200, Quantity = 2 },
            new Spinning { Title = "Spinning Reel 3", Price = 300, Quantity = 3 }
        };
 
        RadListBox5.DataSource = SpinningList;
        RadListBox5.DataBind();
    }
 
    void RadListBox6_Load()
    {
        List<Spinning> SpinningList = new List<Spinning>
        {
            new Spinning { Title = "Spinning Reel 4", Price = 400, Quantity = 4 },
            new Spinning { Title = "Spinning Reel 5", Price = 500, Quantity = 5 },
            new Spinning { Title = "Spinning Reel 6", Price = 600, Quantity = 6 }
        };
 
        RadListBox6.DataSource = SpinningList;
        RadListBox6.DataBind();
    }
 
    protected void RadListBox5_Transferred(object sender, RadListBoxTransferredEventArgs e)
    {
        foreach (RadListBoxItem item in e.Items)
        {
            item.DataBind();
        }
    }

Dimitar Terziev
Telerik team
 answered on 20 Dec 2010
3 answers
132 views
At the moment i can access the controls already in my advanced customized template. I use the following code to do that:

protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
{
    Appointment appHuidig = e.Container.Appointment;
    RadScheduler scheduler = (RadScheduler)sender;
    RadDatePicker StartDate = (RadDatePicker)e.Container.Controls[1].FindControl("StartDate");
    RadTimePicker StartTime = (RadTimePicker)e.Container.Controls[1].FindControl("StartTime");
    RadDatePicker EndDate = (RadDatePicker)e.Container.Controls[1].FindControl("EndDate");
    RadTimePicker EndTime = (RadTimePicker)e.Container.Controls[1].FindControl("EndTime");
    RadComboBox rcb_AfspraakType = (RadComboBox)e.Container.Controls[1].FindControl("rcb_AfspraakType");
    RadTextBox SubjectText = (RadTextBox)e.Container.Controls[1].FindControl("SubjectText");
    RadTextBox DescriptionText = (RadTextBox)e.Container.Controls[1].FindControl("DescriptionText");
    RadComboBox rcb_Adviseurs = (RadComboBox)e.Container.Controls[1].FindControl("rcb_Adviseurs");
    int fiat = 1;
    RadComboBox rcb_Kamers = (RadComboBox)e.Container.Controls[1].FindControl("rcb_Kamers");
    CheckBox AllDayEvent = (CheckBox)e.Container.Controls[1].FindControl("AllDayEvent");
    RadTextBox rtb_ProspectID = (RadTextBox)e.Container.Controls[1].FindControl("rtb_ProspectID");

However, i also do have validation on the server side, but when i want to cancel the update and leave the advanced form template open I have a problem, since the AppointmentCommandEventArgs  doesnt have a cancel option. Besides this problem, I also want to implement drag and drop, however with drag and dropping i cannot access the Appointmentcommand as well.

So i want to move the update/insert from the appointmentcommand to the updatecommand/insertcommand:

protected void RadScheduler1_AppointmentInsert(object sender, Telerik.Web.UI.AppointmentInsertEventArgs e)
{
     
      
}
protected void RadScheduler1_AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e)
{
      
}

But from these e's i cannot access the cs_advancedform, how can i achieve this, so i can easely access my controls on my customized advanced form template?
Nikolay Tsenkov
Telerik team
 answered on 20 Dec 2010
9 answers
192 views
Hai,
I'm using a form decorator in a page.
The page contains two text boxes & one fieldset.
Its showing correctly in Firefox.
Bt in IE8 beta its showing this error Sys.ArgumentException:  does not derive from Sys.Component. Parameter name

plz help
Georgi Tunev
Telerik team
 answered on 20 Dec 2010
14 answers
857 views
http://www.telerik.com/help/aspnet-ajax/radgrid-filter-template.html
The first time run it's correctly displaying "All", after I select a different dropdown item, the grid filters correctly, but the FilterDropDown still indicates "All".    How do I make it display the value that was selected?

Update:  It works now after I change it to use the client side version of example:

                    OnClientSelectedIndexChanged="TitleIndexChanged" SelectedValue='<%# TryCast(Container,GridItem).OwnerTableView.GetColumn("Application").CurrentFilterValue %>'


The Server side still has the issue:

                    <FilterTemplate> 
                        <telerik:RadComboBox runat="server" ID="FilterCombo" DataSourceID="srcApplication" AppendDataBoundItems="true" 
                        DataValueField="Application" DataTextField="Application" AutoPostBack="true"
                        SelectedValue='<%# TryCast(Container,GridItem).OwnerTableView.GetColumn("Application").CurrentFilterValue %>'
                        OnSelectedIndexChanged="FilterCombo_SelectedIndexChanged"
                            <Items> 
                                <telerik:RadComboBoxItem Text="All" /> 
                            </Items>                         
                        </telerik:RadComboBox>            
                    </FilterTemplate>                     
                </telerik:GridBoundColumn>   

    Protected Sub FilterCombo_SelectedIndexChanged(ByVal o As ObjectByVal e As RadComboBoxSelectedIndexChangedEventArgs) 
        Dim filterExpression As String 
        filterExpression = "([Application] = '" + e.Value + "')" 
        RadGrid1.MasterTableView.FilterExpression = filterExpression 
        RadGrid1.MasterTableView.Rebind() 
    End Sub 
Pavlina
Telerik team
 answered on 20 Dec 2010
2 answers
88 views
Can we get the ability to render out a definable empty template if there's no data in the tree?

...or if not doable for Q1 2011, can you just put in the ability for it to render out an Empty Message?

(I know I can do it myself, but I have a bunch of treelists I plan to make so I dont want to have to keep hiding\showing based on dataset results)

Thanks,
Steve
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 20 Dec 2010
3 answers
649 views
I have 4 columns in rad grid and i set the 1st, 3rd, 4th column's width to 150 px (<HeaderStyle Width="150px" /> ),  How can i set the 2nd column's  size to auto fill to ocuppy all the empty space in grid?

Regards,
Kenghot.

Ps. I'm using rad asp.net q3 2009
Pavlina
Telerik team
 answered on 20 Dec 2010
1 answer
142 views
I have a .NET asp page that opens a RadWindow. Is there a way to know when the RadWindow is closed by the user? I have a function that I need to execute when the RadWindow is closed. I have tried setting DestroyOnClose to true and calling my function through the OnClientClose event, but setting DestroyOnClose to true causes a popup error on my page. The error says "Exception while executing client event OnClientClose Error:'this._iframe' is null or not an object." I have no idea what is causing that error. Is there a way to detect when the user closes the RadWindow without using DestroyOnClose and OnClientClose? Do you know what is causing my error when I do use those things?

I appreciate any help. Thanks,
Erika
Georgi Tunev
Telerik team
 answered on 20 Dec 2010
2 answers
120 views
Hi,

In this particular page RadAjaxLoadingPanel does not show up. Instead the Grid blinks. I have tried in other pages, it works. What cud be the issue?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Website1.Forecast_Default" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<head id="Head1" runat="server">
    <title>STATS</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadFormDecorator ID="RadFormDecorator1" DecoratedControls="All" runat="server" />
    <table border="0" cellpadding="2" style="width: 98%">
        <tr>
            <td>
                <asp:Label runat="server" ID="lblMessage" SkinID="infoLabel" />
            </td>
        </tr>
        <tr>
            <td>
                <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <table style="width: 100%">
                                    <tr>
                                        <td>
                                            <asp:Label ID="lblNewTitleQueue" runat="server" Text="New Title Queue"></asp:Label>
                                        </td>
                                        <td align="right">
                                            <asp:ImageButton ID="imgNewGridClearFilter" runat="server" ImageUrl="~/App_Themes/STATS/Images/filter_clear.png"
                                                ToolTip="Clear filter" OnClick="imgNewGridClearFilter_OnClick" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <telerik:RadGrid ID="rgNewQueue" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                                    AllowPaging="True" PageSize="5" AllowFilteringByColumn="true" OnSortCommand="rgNewQueue_OnSortCommand"
                                    OnPageIndexChanged="rgNewQueue_OnPageIndexChanged" OnPageSizeChanged="rgNewQueue_OnPageSizeChanged"
                                    OnItemCommand="rgNewQueue_OnItemCommand" Width="925px">
                                    <GroupingSettings CaseSensitive="false" />
                                    <MasterTableView AutoGenerateColumns="false" DataKeyNames="ProductId" GridLines="None"
                                        AllowSorting="true" AllowPaging="true" ShowHeadersWhenNoRecords="true" EnableNoRecordsTemplate="true"
                                        NoMasterRecordsText="No titles found" AllowNaturalSort="false">
                                        <Columns>
                                            <telerik:GridTemplateColumn UniqueName="unqTitle" HeaderText="Title" SortExpression="Title"
                                                AutoPostBackOnFilter="true" AllowFiltering="true" CurrentFilterFunction="Contains"
                                                ShowFilterIcon="False" FilterControlWidth="150px" DataField="Title">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="lnkTitle" CommandName="cmdTitleSelect" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("Title")))%>'></asp:LinkButton>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqStudio" HeaderText="Studio" SortExpression="StudioName"
                                                AutoPostBackOnFilter="true" AllowFiltering="true" CurrentFilterFunction="Contains"
                                                ShowFilterIcon="False" FilterControlWidth="100px" DataField="StudioName">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblStudio" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("StudioName")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqGenre" HeaderText="Genre" SortExpression="GenreName"
                                                AutoPostBackOnFilter="true" AllowFiltering="true" CurrentFilterFunction="Contains"
                                                ShowFilterIcon="False" FilterControlWidth="60px" DataField="GenreName">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblGenre" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("GenreName")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqSRP" HeaderText="SRP" SortExpression="SRP"
                                                AllowFiltering="false">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblCost" runat="server" Text='<%# DisplayCost(Convert.ToString(Eval("SRP")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqAWP" HeaderText="AWP" SortExpression="AWP"
                                                AllowFiltering="false">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblListPrice" runat="server" Text='<%# DisplayCost(Convert.ToString(Eval("AWP")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqConfig" HeaderText="Config" SortExpression="ConfigCode"
                                                AutoPostBackOnFilter="true" AllowFiltering="true" CurrentFilterFunction="Contains"
                                                ShowFilterIcon="False" FilterControlWidth="60px" DataField="ConfigCode">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblConfig" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("ConfigCode")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqReleaseDate" HeaderText="Release Date"
                                                SortExpression="ReleaseDate" AllowFiltering="false">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblReleaseDate" runat="server" Text='<%# DisplayDate(Convert.ToString(Eval("ReleaseDate")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqOrderDueDate" HeaderText="Order Due Date"
                                                SortExpression="OrderDueDate" AllowFiltering="false">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblOrderDueDate" runat="server" Text='<%# DisplayDate(Convert.ToString(Eval("OrderDueDate")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn UniqueName="unqExclusive" HeaderText="Exclusive?" SortExpression="Exclusive"
                                                AllowFiltering="false">
                                                <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                                <ItemTemplate>
                                                    <asp:Label ID="lblExclusive" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("Exclusive")))%>'></asp:Label></ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                    </table>
                </telerik:RadAjaxPanel>
            </td>
        </tr>
        <tr>
            <td style="height: 25px">
            </td>
        </tr>
        <tr>
            <td style="height: 2px; background-color: Black">
            </td>
        </tr>
        <tr>
            <td style="height: 25px">
            </td>
        </tr>
        <tr>
            <td>
                <table style="width: 100%">
                    <tr>
                        <td>
                            <asp:Label ID="lblSearchTitle" runat="server" Text="Search for Title"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" colspan="2">
                            <table cellspacing="15px" style="height: 100%">
                                <tr>
                                    <td>
                                        <telerik:RadTextBox ID="rtxtTitle" runat="server" Text="" Width="150px">
                                        </telerik:RadTextBox><br />
                                        <asp:Label ID="lblTitle" runat="server" Text="Title"></asp:Label>
                                    </td>
                                    <td>
                                        <telerik:RadTextBox ID="rtxtStudio" runat="server" Text="" Width="150px">
                                        </telerik:RadTextBox><br />
                                        <asp:Label ID="lblStudio" runat="server" Text="Studio"></asp:Label>
                                    </td>
                                    <td>
                                        <telerik:RadComboBox ID="rcbGenre" runat="server" Width="120px">
                                        </telerik:RadComboBox>
                                        <br />
                                        <asp:Label ID="lblGenre" runat="server" Text="Genre"></asp:Label>
                                    </td>
                                    <td>
                                        <telerik:RadComboBox ID="rcbConfig" runat="server" Width="75px">
                                        </telerik:RadComboBox>
                                        <br />
                                        <asp:Label ID="lblConfig" runat="server" Text="Config"></asp:Label>
                                    </td>
                                    <td valign="top">
                                        <telerik:RadNumericTextBox ID="rtxtSRP" runat="server" Width="80px">
                                        </telerik:RadNumericTextBox><br />
                                        <asp:Label ID="lblSRP" runat="server" Text="SRP"></asp:Label>
                                    </td>
                                    <td valign="top">
                                        <telerik:RadNumericTextBox ID="rtxtAWP" runat="server" Width="80px">
                                        </telerik:RadNumericTextBox><br />
                                        <asp:Label ID="lblAWP" runat="server" Text="AWP"></asp:Label>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <telerik:RadDatePicker ID="rdpRelDate" runat="server" Width="150px">
                                        </telerik:RadDatePicker>
                                        <br />
                                        <asp:Label ID="lblRelDate" runat="server" Text=" Release Date"></asp:Label>
                                    </td>
                                    <td>
                                        <telerik:RadDatePicker ID="rdpOrderDueDate" runat="server" Width="150px">
                                        </telerik:RadDatePicker>
                                        <br />
                                        <asp:Label ID="lblOrderDueDate" runat="server" Text="Order Due Date"></asp:Label>
                                    </td>
                                    <td colspan="2">
                                        <telerik:RadComboBox ID="rcbStatus" runat="server" Width="150px">
                                        </telerik:RadComboBox>
                                        <br />
                                        <asp:Label ID="lblStatus" runat="server" Text="Status"></asp:Label>
                                    </td>
                                    <td colspan="2">
                                        <asp:CheckBox ID="chkReturnItems" runat="server" Checked="true" Text="Return my items only"
                                            Width="150px" />
                                    </td>
                                    <td valign="top">
                                        <asp:Button ID="btnSearch" runat="server" Text="Search" Width="100px" OnClick="btnSearch_Click" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table style="width: 100%">
                                <tr>
                                    <td>
                                        <asp:Label ID="lblResults" runat="server" Text="Results:"></asp:Label>
                                    </td>
                                    <td align="right">
                                        <asp:ImageButton ID="imgResultsGridClearFilter" runat="server" ImageUrl="~/App_Themes/STATS/Images/filter_clear.png"
                                            ToolTip="Clear filter" OnClick="imgResultsGridClearFilter_OnClick" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <telerik:RadGrid ID="rgSearchTitle" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                                AllowPaging="True" PageSize="5" OnSortCommand="rgSearchTitle_OnSortCommand" OnItemDataBound="rgSearchTitle_ItemDataBound"
                                OnPageIndexChanged="rgSearchTitle_OnPageIndexChanged" OnPageSizeChanged="rgSearchTitle_OnPageSizeChanged"
                                Width="925px">
                                <GroupingSettings CaseSensitive="false" />
                                <MasterTableView AutoGenerateColumns="false" DataKeyNames="ProductId" GridLines="None"
                                    AllowSorting="true" AllowPaging="true" ShowHeadersWhenNoRecords="true" EnableNoRecordsTemplate="true"
                                    NoMasterRecordsText="No titles found" AllowNaturalSort="false">
                                    <Columns>
                                        <telerik:GridTemplateColumn UniqueName="unqTitle" HeaderText="Title" SortExpression="Title"
                                            DataField="Title">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                            <ItemTemplate>
                                                <asp:LinkButton ID="lnkTitle" PostBackUrl='<%# "~/Forecasting/TitleForecast.aspx?ProductId=" + Eval("ProductId").ToString()+"&ForecastId="+ Eval("ForecastId").ToString()%>'
                                                    runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("Title")))%>'></asp:LinkButton>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqConfig" HeaderText="Config" SortExpression="ConfigCode"
                                            DataField="Config">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblConfig" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("ConfigCode")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqStudio" HeaderText="Studio" SortExpression="StudioName"
                                            DataField="Studio">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblStudio" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("StudioName")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqGenre" HeaderText="Genre" SortExpression="GenreName"
                                            DataField="Genre">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Left" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblGenre" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("GenreName")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqSRP" HeaderText="SRP" SortExpression="SRP"
                                            AllowFiltering="false">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblCost" runat="server" Text='<%# DisplayCost(Convert.ToString(Eval("SRP")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqAWP" HeaderText="AWP" SortExpression="AWP"
                                            AllowFiltering="false">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblListPrice" runat="server" Text='<%# DisplayCost(Convert.ToString(Eval("AWP")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqReleaseDate" HeaderText="Release Date"
                                            SortExpression="ReleaseDate" AllowFiltering="false">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblReleaseDate" runat="server" Text='<%# DisplayDate(Convert.ToString(Eval("ReleaseDate")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqOrderDueDate" HeaderText="Order Due Date"
                                            SortExpression="OrderDueDate" AllowFiltering="false">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblOrderDueDate" runat="server" Text='<%# DisplayDate(Convert.ToString(Eval("OrderDueDate")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqStatus" HeaderText="Status" SortExpression="StatusName"
                                            AllowFiltering="false">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblStatus" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("ForecastStatusName")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="unqUpdatedBy" HeaderText="Last Updated By"
                                            SortExpression="LastUpdatedName" AllowFiltering="false">
                                            <ItemStyle VerticalAlign="Top" HorizontalAlign="Right" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblUpdatedBy" runat="server" Text='<%# DisplayInRadGrid(Convert.ToString(Eval("LastUpdatedName")))%>'></asp:Label></ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </td>
                    </tr>
                </table>
                <asp:HiddenField ID="hdnDefSearch" runat="server" />
            </td>
        </tr>
    </table>
    </form>
</body>
</html>

Rahul
Top achievements
Rank 1
 answered on 20 Dec 2010
4 answers
132 views
Hi,

I am having a problem that I can't figure out.  I am trying to use the RadGrid to manage a list, part of which is a LastUpdated for each item.  It is stored in a database as a DateTime and I am using a LINQ to SQL datasource object.  Everything works great in the grid except the date time picker.  I am using the following code for my Date Time column:

<telerik:GridDateTimeColumn DataField="LastUpdated" HeaderText="LastUpdated"  
                            SortExpression="LastUpdated" UniqueName="LastUpdated"  
                            DataType="System.DateTime" PickerType="DateTimePicker">
</telerik:GridDateTimeColumn> 

The date and time picker icons show up but they are grayed out and I can't do anything with them.  I have searched and searched and no one else seems to have had this problem and I have made sure my code is using the exact same syntax as others who have gotten theirs working.  What am I doing wrong.  Did I forget something important?  I am using the ASPNET AJAX Q2 2008.  Thanks in advance.

Brandon
Kiara
Top achievements
Rank 1
 answered on 20 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
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
Bronze
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?