如何在gridview中使用复选框 [英] How to use checkbox in gridview
本文介绍了如何在gridview中使用复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的gridview
Hi,
This is my gridview
<asp:GridView ID="gvAvailabledoctors" runat="server" AutoGenerateColumns="False"
AllowPaging="true" PageSize="10" CellPadding="4" CellSpacing="1"
Font-Names="Verdana" Width="570px"
Font-Size="9pt" ForeColor="#333333" BorderStyle="Solid"
BorderColor="White" GridLines="none"
onrowcommand="gvAvailabledoctors_RowCommand"
onselectedindexchanged="gvAvailabledoctors_SelectedIndexChanged">
<RowStyle BackColor="#F7F6F3" ForeColor="black" CssClass="gridrowstyle" />
<Columns>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<input name="RadioButtondoc" type="radio" value='<%# Eval("DoctorID") %>' />
</ItemTemplate>
<ItemStyle Width="50px" CssClass="gridcol" Wrap="false"/>
<HeaderStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:BoundField DataField="Name" HeaderText="Doctor Name">
<HeaderStyle Width="150px" HorizontalAlign="Center" />
<ItemStyle Width="150px" CssClass="gridcol" Wrap="false"/>
</asp:BoundField>
<asp:BoundField DataField="Specialist" HeaderText="Specialized IN">
<HeaderStyle Width="220px" HorizontalAlign="Center" />
<ItemStyle Width="220px" CssClass="gridcol" Wrap="false"/>
</asp:BoundField>
<asp:BoundField DataField="City" HeaderText="Location">
<HeaderStyle Width="300px" HorizontalAlign="Center" />
<ItemStyle Width="150px" CssClass="gridcol" Wrap="true"/>
</asp:BoundField>
</Columns>
<FooterStyle BackColor="#D4A97F" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#D4A97F" ForeColor="Black" HorizontalAlign="Center" Wrap="False" Font-Bold="True" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#d4a97f" Font-Bold="True" ForeColor="black" Height="20" Wrap="False" Width="75" />
<EditRowStyle BackColor="#999999" />
<AlternatingRowStyle BackColor="#E2DED6" ForeColor="black" />
</asp:GridView>
当我连续选择一个单选按钮时,应检查医生ID是否是可在诊所就诊。我已在
When i select a radio button in a row the doctor id should be checked whether he is available in clinic. i have return that functionality in
gvAvailabledoctors_RowCommand
中返回该功能。但是当我选择radiobutton行命令时没有被调用。我怎么能这样做
. but when i select the radiobutton row command is not called. how can i do this
推荐答案
请为Eg写。怎么做。?
Please For Eg Write .What to do.?
这篇关于如何在gridview中使用复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文