473,398 Members | 2,368 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,398 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 7382
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.