TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Johann Montfort
NA
4
0
problems with dynamically created radiobuttonlist
May 10 2006 5:16 AM
Dear All, I have to problems regarding radiobuttonlists. 1) How can i position a radiobuttonlist on screen dynamically? 2) How can i get the selectedIndexChanged of the dynamically generated radiobuttonlist? Here is my present code to generate the radiobuttonlists:- private void Add_More_Rooms() { int iRoomNo = Convert.ToInt32(ViewState["AddRooms"]); iRoomNo ++; ViewState["AddRooms"] = iRoomNo; StringBuilder sb = new StringBuilder(); sb.Append("
"); sb.Append("Room " + iRoomNo); sb.Append("
"); sb.Append(" "); phMoreRooms.ID = "phMoreRooms" + iRoomNo; phMoreRooms.Controls.Add(new LiteralControl(sb.ToString())); //create dynmic radiobuttonlist RadioButtonList rdoMoreRooms = new RadioButtonList(); //get the first word before the space rdoMoreRooms.ID = "rdoMoreRooms" + iRoomNo; rdoMoreRooms.CssClass = "label"; rdoMoreRooms.AutoPostBack = true; //rdoMoreRooms.SelectedIndexChanged += new System.EventHandler(this.radioButton_Check_Changed); rdoMoreRooms.RepeatDirection = RepeatDirection.Horizontal; rdoMoreRooms.Items.Add(new ListItem("Double", "Double")); rdoMoreRooms.Items.Add(new ListItem("Twin", "Twin")); rdoMoreRooms.Items.Add(new ListItem("Single", "Single")); rdoMoreRooms.Items.Add(new ListItem("Triple", "Triple")); phMoreRooms.Controls.Add(rdoMoreRooms); phMoreRooms.Controls.Add(new LiteralControl("
")); } Thanks for all your help and time Johann
Reply
Answers (
0
)
Update table in database through datagridview in winform
Setup.exe