473,320 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

MaskedEdit Control in Gridview

parshupooja
159 100+
Hey All,

I am trying to used Masked Edit controls of Ajax in gridview. I have 14 rows in gridview,but masked edit control only works for first row. Any Idea. Plz Help

[HTML]<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDataBound="gvOnRowDataBound" CellPadding="6" CssClass="GridStyle" Width="600" ShowFooter="True">
<RowStyle CssClass="GridItem" />
<AlternatingRowStyle CssClass="GridAltItem" />
<Columns>
<asp:TemplateField HeaderText="Day">
<ItemTemplate>
<asp:Label id="lblDay" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Date">
<ItemTemplate>
<asp:Label id="lblDate" runat="server" Text='<%# Bind("Date") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="In">
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("MorningIn") %>' Width="50px"></asp:TextBox>
<cc1:MaskedEditValidator ID="MaskValMin" runat="server"
ControlExtender="MaskedEditExtender3"
ControlToValidate="TextBox1"
IsValidEmpty="True"
EmptyValueMessage="Time is required"
InvalidValueMessage="Time is invalid"
TooltipMessage="Input a time"
EmptyValueBlurredText="*"
InvalidValueBlurredMessage="*"
ValidationGroup="MKE" />
<cc1:MaskedEditExtender ID="MaskedEditExtender3" runat="server"
TargetControlID="TextBox1"
Mask="99:99"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Time"
AcceptAMPM="True"
ErrorTooltipEnabled="True" />
</ItemTemplate>

</asp:TemplateField></GridView>[/HTML]

thank u in advance
Oct 1 '07 #1
3 7374
parshupooja
159 100+
I figured out. I just took out ValidationGroup="MKE" and it worked


Hey All,

I am trying to used Masked Edit controls of Ajax in gridview. I have 14 rows in gridview,but masked edit control only works for first row. Any Idea. Plz Help

[HTML]<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDataBound="gvOnRowDataBound" CellPadding="6" CssClass="GridStyle" Width="600" ShowFooter="True">
<RowStyle CssClass="GridItem" />
<AlternatingRowStyle CssClass="GridAltItem" />
<Columns>
<asp:TemplateField HeaderText="Day">
<ItemTemplate>
<asp:Label id="lblDay" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Date">
<ItemTemplate>
<asp:Label id="lblDate" runat="server" Text='<%# Bind("Date") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="In">
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("MorningIn") %>' Width="50px"></asp:TextBox>
<cc1:MaskedEditValidator ID="MaskValMin" runat="server"
ControlExtender="MaskedEditExtender3"
ControlToValidate="TextBox1"
IsValidEmpty="True"
EmptyValueMessage="Time is required"
InvalidValueMessage="Time is invalid"
TooltipMessage="Input a time"
EmptyValueBlurredText="*"
InvalidValueBlurredMessage="*"
ValidationGroup="MKE" />
<cc1:MaskedEditExtender ID="MaskedEditExtender3" runat="server"
TargetControlID="TextBox1"
Mask="99:99"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Time"
AcceptAMPM="True"
ErrorTooltipEnabled="True" />
</ItemTemplate>

</asp:TemplateField></GridView>[/HTML]

thank u in advance
Oct 1 '07 #2
sriken
2
I am having a similar problem.

I have a GridView inside an update panel as follows:

Expand|Select|Wrap|Line Numbers
  1. <asp:GridView id="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" AutoGenerateColumns="false" OnRowCommand="gvSessions_RowCommand" Visible="false" ShowFooter="true" OnRowEditing="gvSessions_RowEditing" OnRowUpdating="gvSessions_RowUpdating" OnRowDeleting="gvSessions_RowDeleting" OnRowCancelingEdit="gvSessions_RowCancelingEdit">
  2.  
  3. <Columns>
  4.     <asp:TemplateField HeaderText="Details">
  5.     <ItemTemplate>
  6.     <table>
  7.     <tr>
  8.     <td>
  9.     <%--
  10.         Some fields come over here...
  11.      --%>
  12.     </td>
  13.     </tr>
  14.     </table>
  15.     </ItemTemplate>
  16.     <EditItemTemplate>
  17.     <table>
  18.     <tr>
  19.     <td>From:</td>
  20.     <td>
  21.     <cc1:MaskedEditValidator ID="maskEditValidator1" 
  22.     runat="server" ControlExtender="maskEditExtender1"
  23.     ControlToValidate="TextBox1" IsValidEmpty="false" 
  24.     EmptyValueBlurredText="*" InvalidValueBlurredMessage="*"
  25.     Display="static" TooltipMessage="Input from time"
  26.     EmptyValueMessage="From time required" InvalidValueMessage="Invalid time format" ValidationGroup="MKE1"></cc1:MaskedEditValidator>
  27.     <br />
  28.     <asp:TextBox ID="TextBox1" Columns="6" runat="server" Text='<%# ((DateTime)Eval("StartDateTime")).ToString("hh:mm tt") %>' />
  29.     <cc1:MaskedEditExtender id="maskEditExtender1" runat="server" TargetControlID="TextBox1" Mask="99:99" MessageValidatorTip="true" MaskType="Time" ErrorTooltipCssClass="textBoxInvalidTooltip" OnInvalidCssClass="textBoxInvalidInput" ErrorTooltipEnabled="true" AcceptAMPM="true"></cc1:MaskedEditExtender>
  30.     </td>
  31.     </tr>
  32.     </table>
  33.     </EditItemTemplate>
  34.     </asp:TemplateField>
  35.     </Columns>
  36.     </asp:GridView>
The MaskEditExtender works just fine giving me __:__ AM and __:__ PM correctly, but when I enter a wrong time the MaskEditValidator does not work.
It doesn't show any invalid messages.


Does anybody have a solution for this?


Thanks in advance...

Regards
Sriken

I figured out. I just took out ValidationGroup="MKE" and it worked
Feb 6 '08 #3
acoder
16,027 Expert Mod 8TB
This belongs to the .NET forum.
Feb 6 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: | last post by:
Hello, I have created an ASP.NET 2.0 application that utilized a Gridview Control to display and update/delete data. The problem I am having is that the gridview control is displaying the data...
2
by: Agnes | last post by:
I read some old news. someone post that " There will be a MaskedEdit control included in .NET for the next version release " is that mean .net 2003 ???
3
by: patang | last post by:
I want to restrict users to enter only numbers in a textbox control. I have written a code in keypress to prevent user to enter other than numeric values. I have also read many places that I can...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
0
by: Carmon | last post by:
If I set KeyEventArgs.SuppressKeyPress to true in a MaskedEdit box and have a mask assigned, it will still allow backspace to erase data. I attempted the same thing in C# and it allowed it as...
5
by: Siva | last post by:
Hello I have a dropdownlist inside the gridview as a template column defined as follows: <asp:TemplateField HeaderText="Choose Location"> <ItemTemplate> <asp:DropDownList ID="ddlChooseLoc"...
0
by: John Smith | last post by:
ASP.Net 2.0 / C# / IIS 6 I have 2 pages. The master page consists of a tabbed menu created using the Menu and MultiView controls. Something like this: ...
0
by: John Smith | last post by:
If anyone can help, I would very muchly appreciate it. I have a main page that uses the .net 2.0 menu control with the multiview controls as the menu choices. This works fine. One of the menu...
0
by: Paul Marrero | last post by:
I am using the AJAX ToolKit 1.0.20229.20821 with VS 2005. I have created a data-entry screen that will allow people to enter time and save it to the database. The MaskedEdit AJAX Extender works...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.