Solved

RadDatePicker Cast

Posted on 2010-11-23
3
1,020 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

914 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

17 Experts available now in Live!

Get 1:1 Help Now