[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to loop through a list to datetime pickers ?

Posted on 2009-12-28
2
Medium Priority
?
370 Views
Last Modified: 2012-06-27
hello i am having 12 datetime pickers in a form (AppDate1,AppDate2...)
. I am trying to get their values like this

for(i=0;i<n;i++)
{
          RadDateTimePicker Date = new RadDateTimePicker();
          Date.ID = "AppDate" + i.ToString();
          values.text + = values.text + Date.SelectedDate.Value.ToString();
}
 this is not working ?
0
Comment
Question by:kreddy01
2 Comments
 
LVL 58

Accepted Solution

by:
amit_g earned 2000 total points
ID: 26132471
You are creating a new RadDateTimePicker at runtime. They have no association with the one that you have on the page. You have not shown the aspx side but the code should be something like this

for(i=0;i<n;i++)
{
          RadDateTimePicker Date;
          Date = (RadDateTimePicker) Page.FindControl("AppDate" + i.ToString());
          //Make sure Date is not null here
          values.text + = values.text + Date.SelectedDate.Value.ToString();
}

Page.FindControl could be something different if your date pickers are not directly in the page.
0
 

Author Closing Comment

by:kreddy01
ID: 31670462
THANK YOU VERY MUCH IT WORKED LIKE MAGIC
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

This article discusses how to implement server side field validation and display customized error messages to the client.
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Suggested Courses

873 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