web datagrid ButtonColumn 按钮隐藏与显示

创建书籍管理的网页,其中书籍一览表格用的datagrid显示 ,只想在在书籍状态列显示借出的时候,ButtonColumn里面显示返却按钮
<asp:DataGrid ID="MyGrid"
          AutoGenerateColumns="False"
           CssClass="table" 
           GridLines="Horizontal"          
          runat="server" BorderStyle="None" BorderWidth="2px" BorderColor="Black" ShowFooter="True"
             AllowSorting="True" AllowPaging="True" OnItemDataBound="MyGrid_ItemDataBound" AllowCustomPaging="True"  
             OnSelectedIndexChanged="MyGrid_SelectedIndexChanged1" OnItemCommand="MyGrid_ItemCommand1">
     <ItemStyle   BackColor="white" />
      <AlternatingItemStyle BackColor="#eeeeee" />
      <Columns  >
        <asp:BoundColumn   HeaderStyle-Width="300px" DataField="BookName" HeaderText ="書名"   >
<HeaderStyle Width="300px"  ></HeaderStyle>
          </asp:BoundColumn>
        <asp:BoundColumn   DataField="Author"  HeaderText ="著者" />
        <asp:BoundColumn DataField="Publisher" HeaderText ="出版社"/>
        <asp:BoundColumn DataField="PublicationDate" DataFormatString="{0:yyyy年MM月}" HeaderText ="出版日"  />
        <asp:BoundColumn DataField="Purchase"  DataFormatString="{0:yyyy年MM月dd日}" HeaderText ="購入日" />
        <asp:BoundColumn  HeaderStyle-Width="300px" DataField="Status"  HeaderText ="貸出状態">
<HeaderStyle Width="300px"></HeaderStyle>
          </asp:BoundColumn>
        <asp:ButtonColumn ButtonType="PushButton"  CommandName="lend" HeaderStyle-Width="80px" Text=" 貸出 " HeaderText ="貸出"/>
     <asp:ButtonColumn ButtonType="PushButton" Visible="false" HeaderStyle-Width="80px" Text=" 返却 " HeaderText ="返却"  />_**
        <asp:ButtonColumn ButtonType="PushButton" CommandName="selectedIndexChanged1" HeaderStyle-Width="80px" Text=" 詳細 " HeaderText ="詳細" />


你好,
我的建议是你用dropdownlist 去显示状态。返回按钮初始是隐藏。当你选择状态为贷出时,返回按钮显示。这些操作都在后台写判断。 如果有需要写后台,请把datagrid 的后台事件代码发一下。

<asp:TemplateColumn>
                        <ItemTemplate>
                            <asp:DropDownList ID="DropDownList1" runat="server">
                                <asp:ListItem Value="貸出">貸出</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn>
                        <ItemTemplate>
                            <asp:Button ID="Button1" runat="server" Text="返却" Visible="false" />
                        </ItemTemplate>
                    </asp:TemplateColumn>