Solved

RadDatePicker Cast

Posted on 2010-11-23
3
1,015 Views
Last Modified: 2012-05-10
What type should a RadDatePicker be cast? I used the following code -

TextBox txtID = (TextBox)Grid1.Rows[e.RowIndex].FindControl("txtID");
DropDownList ddlRec = (DropDownList)Grid1.Rows[e.RowIndex].FindControl("ddlRec");
DropDownList ddlDate = (DropDownList)Grid1.Rows[e.RowIndex].FindControl("RadDate");

I got the following casting error for the third line -
Unable to cast object of type 'Telerik.Web.UI.RadDatePicker' to type 'System.Web.UI.WebControls.DropDownList'.

I appreciste any of your help.
0
Comment
Question by:minglelinch
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
gemailj earned 500 total points
ID: 34196632
use this code instead of the last line
Telerik.Web.UI.RadDatePicker ddlDate = (Telerik.Web.UI.RadDatePicker)Grid1.Rows[e.RowIndex].FindControl("RadDate");

Open in new window

0
 
LVL 1

Author Comment

by:minglelinch
ID: 34197340
Thank you. It works.
0
 
LVL 5

Expert Comment

by:gemailj
ID: 34332703
could you please close this question if this helps you?
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now