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
Kriti
NA
60
0
handle dynamic insertion and deletion of textboxes depending upon the checkboxes checked.
May 28 2010 5:13 AM
In my GUI page,I have
1.
AddButton
//
It creates textbox and checkbox (beside textbox).
2.
RemoveButton
//
It deletes the textboxes(and the data) for which the checkboxes are checked
3.
Updatebuton
//
Finally it updates total no. of textboxes(its content) in the database
.
//Code for dynamic creation of textbox and chechbox when Add button is clicked.
public int topPosition = 30;
private void btnAdd_Click(object sender, EventArgs e)
{
TextBox newtxt = new TextBox();
CheckBox newchkbox = new CheckBox();
newchkbox.Location = new System.Drawing.Point(230, 72 + topPosition);
newtxt.Location = new System.Drawing.Point(27, 72 + topPosition);
newtxt.Size = new System.Drawing.Size(187, 20);
this.btnAdd.Location = new System.Drawing.Point(27, 109 + topPosition);
this.btnRem.Location = new System.Drawing.Point(113, 109 + topPosition);
groupBox1.Controls.Add(newtxt);
groupBox1.Controls.Add(newchkbox);
topPosition += 30;
}
How Could I write a code which deletes the textboxes for which checkboxes are clicked
because all are dynamically created.
And finally how to update in the database getting the total number of textboxes and its data.
And i am using System.windows.Forms which doesnt allow to use Id related to each textbox or checkbox.
Reply
Answers (
1
)
Text Alignment problem in picturebox...
XML Read innermost element/node