MaskedEditExtender with existing

Discussion in 'ASP .Net' started by David C, Nov 2, 2009.

  1. David C

    David C Guest

    I am trying to use the Ajax toolkit control MaskedEditExtender. I find that
    when I use it on a control that already has a date in it the date goes away
    in edit. Can I make it so that the date and time that is already bound
    shows up in the mask? Below is what I am using in my GridView. Thanks.
    David

    <asp:TemplateField HeaderText="Start Time"
    SortExpression="StartTime">
    <EditItemTemplate>
    <asp:TextBox ID="txtStartTime" runat="server"
    Text='<%# Bind("StartTime") %>'></asp:TextBox>
    <cc1:MaskedEditExtender ID="MaskedEditExtender1"
    runat="server" AcceptAMPM="True"
    TargetControlID="txtStartTime"
    MaskType="DateTime" Mask="99/99/9999 99:99">
    </cc1:MaskedEditExtender>
    </EditItemTemplate>
    <ItemTemplate>
    <asp:Label ID="LblStartTime" runat="server"
    Text='<%# Bind("StartTime", "{0:h:mm tt}") %>'></asp:Label>
    </ItemTemplate>
    </asp:TemplateField>
     
    David C, Nov 2, 2009
    #1
    1. Advertising

  2. On Nov 2, 11:59 pm, "David C" <> wrote:
    > I am trying to use the Ajax toolkit control MaskedEditExtender. I find that
    > when I use it on a control that already has a date in it the date goes away
    > in edit.  Can I make it so that the date and time that is already bound
    > shows up in the mask?  Below is what I am using in my GridView.  Thanks.
    > David
    >
    >                 <asp:TemplateField HeaderText="Start Time"
    > SortExpression="StartTime">
    >                     <EditItemTemplate>
    >                         <asp:TextBox ID="txtStartTime" runat="server"
    > Text='<%# Bind("StartTime") %>'></asp:TextBox>
    >                         <cc1:MaskedEditExtender ID="MaskedEditExtender1"
    > runat="server" AcceptAMPM="True"
    >                                 TargetControlID="txtStartTime"
    > MaskType="DateTime" Mask="99/99/9999 99:99">
    >                         </cc1:MaskedEditExtender>
    >                     </EditItemTemplate>
    >                     <ItemTemplate>
    >                         <asp:Label ID="LblStartTime" runat="server"
    > Text='<%# Bind("StartTime", "{0:h:mm tt}") %>'></asp:Label>
    >                     </ItemTemplate>
    >                 </asp:TemplateField>


    Hi David,

    please look at the following example, I think this is exactly how you
    want to do this
    http://www.obout.com/grid/grid_integration_ajax_toolkit.aspx

    Hope this helps
     
    Alexey Smirnov, Nov 5, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nrm
    Replies:
    3
    Views:
    535
  2. Abhi
    Replies:
    0
    Views:
    849
  3. egsdar
    Replies:
    1
    Views:
    810
    Hans Kesting
    Oct 27, 2008
  4. Bobby Edward

    MaskedEditExtender Question

    Bobby Edward, Oct 27, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    493
    Bobby Edward
    Oct 27, 2008
  5. Replies:
    0
    Views:
    192
Loading...

Share This Page