2012-09-19 63 views
1

我需要限制在gridview編輯模式下只輸入時間(HH:mm:ss)我該怎麼做?在gridview編輯模式下蒙面文本時間(HH.mm.ss)

<asp:GridView runat="server" ID="gvListele" Visible="False" 
    CellPadding="4" ForeColor="#333333" GridLines="Horizontal" Width="950px" RowStyle-Height="30px" 
       onselectedindexchanged="gvListele_SelectedIndexChanged" 
       onsorting="gvListele_Sorting" 
       onpageindexchanging="gvListele_PageIndexChanging" 
       onrowcancelingedit="gvListele_RowCancelingEdit" 
       onrowediting="gvListele_RowEditing" 
       onrowupdating="gvListele_RowUpdating" 
       onrowdeleting="gvListele_RowDeleting" 
       onrowdatabound="gvListele_RowDataBound" PageSize="20" 
       EmptyDataText="Görüntülenecek Öğe Bulunmamaktadır....." > 
     <RowStyle BackColor="#FFFBD6" ForeColor="#333333" HorizontalAlign="Center"/> 
     <Columns> 

      <asp:CommandField CancelText="İptal" DeleteText="Sil" EditText="Düzenle" 
       InsertText="Ekle" NewText="Yeni" SelectText="Seç" ShowEditButton="True" 
       UpdateText="Güncelle" /> 
      <asp:CommandField CancelText="İptal" DeleteText="Sil" EditText="Düzenle" 
       ShowDeleteButton="True" /> 
     </Columns> 
     <FooterStyle BackColor="#29abe2" ForeColor="White" HorizontalAlign="Center" /> 
     <PagerStyle BackColor="#29abe2" ForeColor="#333333" 
     HorizontalAlign="Center" /> 
     <SelectedRowStyle BackColor="#29abe2" ForeColor="Navy" HorizontalAlign="Center" /> 
     <HeaderStyle BackColor="#29abe2" ForeColor="White" HorizontalAlign="Center" Font-Size="Small" Height="20px" /> 
     <AlternatingRowStyle BackColor="White" /> 

    </asp:GridView> 

這是我的gridview代碼,我需要在編輯模式下屏蔽columb 4,5和6。

回答

0

你可以這樣使用;

<Columns> 
<asp:TemplateField HeaderText="Header Text"> 
    <ItemTemplate> 
     <asp:TextBox ID="txt" runat="server" Width="150" ValidationGroup="MKE" ></asp:TextBox> 
     <asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server" 
      TargetControlID="txt" 
      Mask="99,99,9999 99:99" 
      MessageValidatorTip="true" 
      OnFocusCssClass="MaskedEditFocus" 
      OnInvalidCssClass="MaskedEditError" 
      MaskType="DateTime" 
      AcceptAMPM="True" 
      ErrorTooltipEnabled="True"/> 
     <asp:MaskedEditValidator ID="MaskedEditValidator1" runat="server" 
      ControlExtender="MaskedEditExtender1" 
      ControlToValidate="txt" 
      IsValidEmpty="False" 
      EmptyValueMessage="EmptyValueMessage" 
      InvalidValueMessage="InvalidValueMessage" 
      Display="Dynamic" 
      TooltipMessage="TooltipMessage" 
      EmptyValueBlurredText="EmptyValueBlurredText" 
      InvalidValueBlurredMessage="InvalidValueBlurredMessage" 
      ValidationGroup="MKE" /> 
    </ItemTemplate> 
</asp:TemplateField> 

相關問題