Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi...every one ,
how do i validate the combobox in datgrid control.eg:
suppose am not select the combo box list item.it will be intimate me.we r using asp.net+c#.but in validation sector we wrote in jsp validation.
how do i validate it?
help me.
encourage u regards this...
Posted
Updated 17-Sep-10 0:13am
v2

1 solution

Hi
You can write during RowDataBind event of GridView
C#
GridView1_RowDataBinding(...)
{
    DropDownList drp = (DropDownList e.Row.FindControl("DropDownList1");
    drp.Attributes.Add("onblur","checkValidation(this);");
}


in java script you should define chcekValidation function like

C#
function chcekValidation(_this)
{
if(_this.value=='Please select' || if(_this.value=='' )
{
   alert('Please select item from list');
   return false;
}
return true;
}


Please do let me know, if you have any doubt.

Please provide Vote if this would be helpful to you.

Thanks,
Imdadhusen
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900