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
Qing Ryder
NA
202
17.4k
Form2 Populates on ButtonClik
Oct 21 2017 9:21 AM
i have two forms.
on form1 is a datagridview and button.
On ButtonClick event, the datagridview is being validated and if null or empty, it returns back else form2 should open. (that is the syntax)
but when the application runs, and form2 is to be open, it populates about 15 of form2.
please how do i stop the population
here is the code
private
void
button3_Click(
object
sender, EventArgs e)
{
this
.dataGridView1.ClearSelection();
foreach
(DataGridViewRow row
in
dataGridView1.Rows)
{
if
(row.IsNewRow) {
return
; }
foreach
(DataGridViewCell cell
in
row.Cells)
{
// Validating cell value
var regexItem =
new
System.Text.RegularExpressions.Regex(
"^[a-zA-Z0-9 ]$"
);
if
(cell.Value ==
null
|| !regexItem.IsMatch(cell.Value.ToString()))
{
cell.Style.BackColor = Color.Red;
}
}
}
this
.Hide();
resultVV f2 =
new
resultVV();
f2.Show();
}
Reply
Answers (
4
)
Biometric Data Capture and Verification
Tableau in c#.net