datagridview模板字段 [英] datagridview template field

查看:81
本文介绍了datagridview模板字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户选择下拉列表字段并单击复选框以选择行数后,我想使用driop下拉列表在perticulor列的gridview中使用,并且我想完成与一列关联的复选框,选择后他将单击Submit(提交)按钮,它将触发更新查询.有人可以引导我,因为我没有在intellisense

i want to use driop downlist to be used in my gridview in a perticulor column and i want done checkbox associated in one column ,when user select the dropdownlist field and click the checkbox to select number of rows after selecting he will click submit button and it will fire update query.can anyone guide me as i am not getting the dropdown list name in intellisense

推荐答案

中获得下拉列表名称.您不会在Intellisence中获得下拉列表名称原因是,它是Gridview内部的嵌入式控制,而Micrososft没有提供此功能.

如果要访问这些控件,请按照以下步骤操作:
假设gridview的名称为"grdView1"

1>将一个新变量声明为Dropdonlist.

例如DropDownList d =新的DropDownList();

2>然后使用方法"findControl()"来访问资源.

例如d =(DropDownList)grdView1.FindControl(''Dropdownlist_to which_you_want_access_to'');

3>现在,此(下拉列表)d将获得嵌入GridView的控件的值(在本例中为Dropdownlist).
You will not get the dropdown list name in Intellisence.The reason is that ,it is an Embedded contol inside the Gridview and this facility in not provided from the Micrososft.

If you want to acces those Control,please follow the following steps :
Let the name of gridview be " grdView1 "

1> Declare a new variable as Dropdonlist .

e.g. DropDownList d=new DropDownList();

2> Then use the method "findControl()" to get the access to the resource.

e.g. d=(DropDownList)grdView1.FindControl(''name_of_the_Dropdownlist_to which_you_want_access_to'');

3>Now this (dropdown list) d will get the value of the control (i.e. Dropdownlist in this case )embedded inside GridView.


这篇关于datagridview模板字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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