9 Replies - 2828 Views - Last Post: 13 November 2008 - 11:23 AM Rate Topic: -----

#1 spr_vivega  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-October 08

Help with DropDownList in ASP.NET

Posted 11 November 2008 - 11:14 AM

hi all,
am new to dis site.here is my thread.am doing a small project in asp.net using C#.i had some prob using drop down list tool.that is,i wanted to display not the present date but i wanted d-m-y to display just like how v use calender.whatever the d-m-y i wanted,it will get selected by the user from drop down list. It may be today's date-m-y r previous d-m-y r etc.etc. I think i explained well.plz clear it asap.it's very imp n urgent.

thanks in advance,

Is This A Good Question/Topic? 0
  • +

Replies To: Help with DropDownList in ASP.NET

#2 spr_vivega  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-October 08

Re: Help with DropDownList in ASP.NET

Post icon  Posted 11 November 2008 - 11:15 AM

hi all,
am new to dis site.here is my thread.am doing a small project in asp.net using C#.i had some prob using drop down list tool.that is,i wanted to display not the present date but i wanted d-m-y to display just like how v use calender.whatever the d-m-y i wanted,it will get selected by the user from drop down list. It may be today's date-m-y r previous d-m-y r etc.etc. I think i explained well.plz clear it asap.it's very imp n urgent.

thanks in advance,
Was This Post Helpful? 0
  • +
  • -

#3 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: Help with DropDownList in ASP.NET

Posted 11 November 2008 - 11:17 AM

so you want a drop down list that is populated with dates in the format of "d-m-y"?
Was This Post Helpful? 1

#4 jjsaw5  Icon User is offline

  • I must break you
  • member icon

Reputation: 90
  • View blog
  • Posts: 3,060
  • Joined: 04-January 08

Re: Help with DropDownList in ASP.NET

Posted 11 November 2008 - 12:01 PM

Do you have any code to post that we can look at? Or are you expecting us to do this for you?
Was This Post Helpful? 0
  • +
  • -

#5 spr_vivega  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-October 08

Re: Help with DropDownList in ASP.NET

Posted 12 November 2008 - 07:16 AM

View Postjjsaw5, on 11 Nov, 2008 - 11:01 AM, said:

Do you have any code to post that we can look at? Or are you expecting us to do this for you?



sorry sir.i dont have any codings. i dont have any idea on codings also.plz provide me any example or any website abt ddl r if poss plz send me the full codings.am fresher so no idea abt codings.

View Posteclipsed4utoo, on 11 Nov, 2008 - 10:17 AM, said:

so you want a drop down list that is populated with dates in the format of "d-m-y"?


yes sir.u got it.thnx.i dont have any codings. i dont have any idea on codings also.plz provide me any example or any website abt ddl r if poss plz send me the full codings.am fresher so no idea abt codings.
Was This Post Helpful? 0
  • +
  • -

#6 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: Help with DropDownList in ASP.NET

Posted 12 November 2008 - 08:34 AM

how many dates do you want in the box? from the beginning of time to the end of time?

why not use a Calender control?

This post has been edited by eclipsed4utoo: 12 November 2008 - 08:34 AM

Was This Post Helpful? 0
  • +
  • -

#7 spr_vivega  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-October 08

Re: Help with DropDownList in ASP.NET

Posted 12 November 2008 - 07:50 PM

View Posteclipsed4utoo, on 12 Nov, 2008 - 07:34 AM, said:

how many dates do you want in the box? from the beginning of time to the end of time?

why not use a Calender control?


in my project i need to use this type of date format so i cant use calednder ctrl. it's like how date time picker works in windows application. but d diff is i want to display only d-m-y and not time.i dont know how to create this.so if u have a n idea help me.

thnx in advance,
Was This Post Helpful? 0
  • +
  • -

#8 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: Help with DropDownList in ASP.NET

Posted 13 November 2008 - 08:03 AM

using a DropDownList/ComboBox

DateTime startDate = DateTime.Now.AddDays(-30);

for (int i = 1; i <= 60; i++)
{
    dropDownList.Items.Add(startDate.AddDays(i).ToString("dd-MM-yyyy"));
}



this will start 30 days in the past(from the current date), and go ~30 days into the future. You can make the range as wide as you would like it.

This post has been edited by eclipsed4utoo: 13 November 2008 - 08:03 AM

Was This Post Helpful? 0
  • +
  • -

#9 spr_vivega  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 23-October 08

Re: Help with DropDownList in ASP.NET

Posted 13 November 2008 - 09:22 AM

View Posteclipsed4utoo, on 13 Nov, 2008 - 07:03 AM, said:

using a DropDownList/ComboBox

DateTime startDate = DateTime.Now.AddDays(-30);

for (int i = 1; i <= 60; i++)
{
    dropDownList.Items.Add(startDate.AddDays(i).ToString("dd-MM-yyyy"));
}



this will start 30 days in the past(from the current date), and go ~30 days into the future. You can make the range as wide as you would like it.



thnx for d reply.but no use.bcoz my thread is totally diff n u did not get my doubt.no probs.
Was This Post Helpful? 0
  • +
  • -

#10 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: Help with DropDownList in ASP.NET

Posted 13 November 2008 - 11:23 AM

View Postspr_vivega, on 13 Nov, 2008 - 11:22 AM, said:

View Posteclipsed4utoo, on 13 Nov, 2008 - 07:03 AM, said:

using a DropDownList/ComboBox

DateTime startDate = DateTime.Now.AddDays(-30);

for (int i = 1; i <= 60; i++)
{
    dropDownList.Items.Add(startDate.AddDays(i).ToString("dd-MM-yyyy"));
}



this will start 30 days in the past(from the current date), and go ~30 days into the future. You can make the range as wide as you would like it.



thnx for d reply.but no use.bcoz my thread is totally diff n u did not get my doubt.no probs.


do what?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1