Here is the code :
string msg = "";
if (RadGrid1.MasterTableView.Items.Count > 0)
{
foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
{
if ((item.FindControl("RadioButtonList1") as RadioButtonList).SelectedValue.ToString() == "Continue")
{
if ((item.FindControl("txtamount") as TextBox).Text == "" || (item.FindControl("txtddamount") as TextBox).Text == "" || (item.FindControl("txtddnumber") as TextBox).Text == "" || (!(item.FindControl("rdpdddate") as RadDatePicker).SelectedDate.HasValue) || (item.FindControl("txtbankname") as DropDownList).SelectedItem.ToString() == "--na--")
{
msg = "Please Enter DD Details for Reg No " + (item.FindControl("RegisterationNumberLabel") as Label).Text;
break;
}
}
}
if (msg != "")
{
DisplayAJAXMessage(this, msg);
}
else
{
InsertRecord();
}
}
else
{
DisplayAJAXMessage(this, "No record found to submit. Please check your entry");
}
string msg = "";
if (RadGrid1.MasterTableView.Items.Count > 0)
{
foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
{
if ((item.FindControl("RadioButtonList1") as RadioButtonList).SelectedValue.ToString() == "Continue")
{
if ((item.FindControl("txtamount") as TextBox).Text == "" || (item.FindControl("txtddamount") as TextBox).Text == "" || (item.FindControl("txtddnumber") as TextBox).Text == "" || (!(item.FindControl("rdpdddate") as RadDatePicker).SelectedDate.HasValue) || (item.FindControl("txtbankname") as DropDownList).SelectedItem.ToString() == "--na--")
{
msg = "Please Enter DD Details for Reg No " + (item.FindControl("RegisterationNumberLabel") as Label).Text;
break;
}
}
}
if (msg != "")
{
DisplayAJAXMessage(this, msg);
}
else
{
InsertRecord();
}
}
else
{
DisplayAJAXMessage(this, "No record found to submit. Please check your entry");
}
Comments
Post a Comment