网格视图模板字段值从复选框获取 [英] grid view template field value get from check box
问题描述
大家好..
我正在使用来自linq数据源的gridview asp.net3.5,并且现在将所有databount列转换为模板字段格式,现在我将值选中了复选框以供使用.这里复选框不获取值,否则我正在尝试boundfield和checkbox选项s正常工作,现在我使用了所有字段模板格式,同时使用checkbox选项也模板字段....这是我的要求,这就是为什么我要问任何人都知道这个plz的原因推荐给我.
谢谢与问候
Karthik
hi all..
i am using gridview asp.net3.5 from linq datasource and i am convert the all databount column to template field format now i am get the value to checkbox checked option to use. here checkbox dont get the values otherwise i am trying to boundfield and checkbox option s working fine now i am used all field template format using checkbox option also template field.... this is my requirement thats why i am asking any body know this plz refer me.
Thanks & Regards
Karthik
推荐答案
这是我使用的代码. "URLval"是一个字符串值,如果为空,则该复选框将显示为已选中....
Here is code I use. "URLval" is a string value, if it is empty, then the checkbox will appear checked....
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="myCheckbox" Checked=''<%# Convert.ToString(Eval("URLval"))!="" %>'' Runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
这篇关于网格视图模板字段值从复选框获取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!