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
muthukumar Durai
NA
20
9.2k
customvalidator inside gridview doesnot work inside gridview
Mar 19 2015 10:40 AM
CustomValidator custval = new CustomValidator();
custval = (CustomValidator)sender;
GridViewRow gvr = custval.NamingContainer as GridViewRow;
TextBox txtGender = (TextBox)gvr.FindControl("txtGender");
Label lblRequired = (Label)gvr.FindControl("lblRequired");
DataTable dt = (DataTable)ViewState["ValidationData"];
string qry = string.Empty;
DataRow[] drow;
qry = qry + " Gender = '" + txtGender.Text + "'";
//bool _isValid = (string.IsNullOrEmpty(txtNm.Text));
if (dt.Rows.Count > 0)
{
drow = dt.Select(qry);
if (drow.Length > 0)
{
args.IsValid=false;
}
else
{
args.IsValid=true;
}
Reply
Answers (
0
)
Check if datagridview check box is checked
c# Pipe seperated file(.psv) Issue with \r\n character