<EditItemTemplate>
<asp:RadioButton id="rb_3" runat="server" Text="男" AutoPostBack="false" Checked='<%# Convert.ToInt32(DataBinder.Eval(Container.DataItem,"sex"))==1?true:false %>' GroupName="iSign">
</asp:RadioButton>
<asp:RadioButton id="rb_4" runat="server" Text="女" AutoPostBack="false" Checked='<%# Convert.ToInt32(DataBinder.Eval(Container.DataItem,"sex"))==0?true:false %>' GroupName="iSign">
</asp:RadioButton>
</EditItemTemplate>
在点了编辑以后我在cs页面怎么才能取到这个值??
string city = ((TextBox)e.Item.Cells[1].Controls[1]).Text;文本框的话是这样取道的,单选框怎么取到呢??
<asp:RadioButton id="rb_3" runat="server" Text="男" AutoPostBack="false" Checked='<%# Convert.ToInt32(DataBinder.Eval(Container.DataItem,"sex"))==1?true:false %>' GroupName="iSign">
</asp:RadioButton>
<asp:RadioButton id="rb_4" runat="server" Text="女" AutoPostBack="false" Checked='<%# Convert.ToInt32(DataBinder.Eval(Container.DataItem,"sex"))==0?true:false %>' GroupName="iSign">
</asp:RadioButton>
</EditItemTemplate>
在点了编辑以后我在cs页面怎么才能取到这个值??
string city = ((TextBox)e.Item.Cells[1].Controls[1]).Text;文本框的话是这样取道的,单选框怎么取到呢??
大概是这样吧对c#不是很熟。vb的话应该是
ctype(e.Item.Cells(1).Controls(1),RadioButton).checked
这个取得是<ItemTemplate></ItemTemplate>这个里面的值,怎样才能取到<EditItemTemplate></EditItemTemplate>的值呢??
还不明白的话,mail给我好了[email protected]
如果你一定要用,值还是可以获得的,上面的很多人都说过了.
读的时候就用rdo.SelectedValue获取该RadioButtonList的值。
当然要将EnableViewState=true设定
要想了解它,可以找一下相关的帮助
http://datagridgirl.com/customcolumns.aspx
http://218.27.204.17/aspnet/a_user.aspx