C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Its very urgent... Please help


Posted Date: 09 Aug 2007      Posted By: Krishnan      Member Level: Bronze     Points: 2   Responses: 1



I want to load the DropDownList dynamically... I want to add different number of space before each item using for loop... If i used empty space its not working... I tried to use ' ' but i cant convert it... I am using c# as back end....




Responses

Author: Vijay Kumar Naidu    09 Aug 2007Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi,


DropdownList drp = new DropdownList();

... // Code for fetching data
while(dr.Read())
{
for(int i=1; i<=3;i++)
drp.Items.Add(" "); //Add No. of Spaces
drp.Items.Add(dr[0].ToString());
}

...// Rest of the code.

this.form1.Controls.Add(drp); // Add the Dropdownlist on the page.





Please revert back if your question is still unanswered.

-Vijay Kumar.



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : updation in hosted website
Previous : Setting Dateformat in Calendar Control in ASP.NET2.0
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use