数据网格问题. [英] Datagrid Problem.

查看:64
本文介绍了数据网格问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨...大家好,
我如何在datgrid control.eg中验证组合框:
假设没有选择组合框列表项.它将很亲密.我们使用asp.net + c#.但是在验证部门中,我们用jsp验证编写.
如何验证?
帮帮我.
鼓励您考虑这一点...

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...

推荐答案


您可以在GridView的RowDataBind事件期间编写
Hi
You can write during RowDataBind event of GridView
GridView1_RowDataBinding(...)
{
    DropDownList drp = (DropDownList e.Row.FindControl("DropDownList1");
    drp.Attributes.Add("onblur","checkValidation(this);");
}



在Java脚本中,您应该定义chcekValidation函数,例如



in java script you should define chcekValidation function like

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



如有任何疑问,请让我知道.

如果对您有帮助,请提供投票.

谢谢,
Imdadhusen



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

Please provide Vote if this would be helpful to you.

Thanks,
Imdadhusen


这篇关于数据网格问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆