Solved

RadDatePicker Cast

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
looking for an ASP.net report designer 4 42
Making exceptions for ValidationAttribute 2 27
Need help with a query 14 39
CSS for Popup in ASP.NET 4 19
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…

733 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