Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6845705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:32:00+00:00 2026-05-27T00:32:00+00:00

When I add any validators to any template type inside of a gridview it

  • 0

When I add any validators to any template type inside of a gridview it seems that the validators change the height, width and alignment of the cell/column. I can strip out all formatting [remove the stylesheet and any other attributes] and when I add the validators to the template the formatting changes – implicating the validators. I am very new to .net – how do I prevent any formatting impact from validators? I would think they would have zero impact!

Thanks!

below is one example of a column:

<asp:TemplateField HeaderText="Paid" SortExpression="PaidPrice" ControlStyle-Width="50px" ItemStyle-HorizontalAlign="center">
        <EditItemTemplate>
            <asp:TextBox ID="PaidPrice" runat="server" Text='<%# Eval("PaidPrice","{0:f}") %>' ></asp:TextBox>
            <asp:CompareValidator ID="CompareValidator2" Runat="server" ControlToValidate="PaidPrice" Operator="DataTypeCheck" Type="Currency"
                ErrorMessage="You must provide a valid currency value for the Paid Price." >*</asp:CompareValidator>
        </EditItemTemplate>
        <ItemTemplate>
            <asp:Label ID="lblPaidPrice" runat="server" Text='<%# Eval("PaidPrice","{0:c}") %>' ></asp:Label>
        </ItemTemplate>
    </asp:TemplateField>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:32:01+00:00Added an answer on May 27, 2026 at 12:32 am

    You didn’t really specify what is changing on the formatting, but based on your code I have a good guess. I’d bet the width of the columns is wider than you want and showing white space.

    If this is the case, this may be the cure:

    Set the Display property of the vlaidators to “Dynamic”. Then they will only take up space if there is a validaiton error.

    The default value of this property is “Static”, which causes it to take up the same amount of space, whether the message is visible or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any add-in for VS2008 Pro that provides me the ability to expand
Do you know if there is any add-in for Visual Studio, that shows the
How to register listening for any Contact (add/remove contact, change in email/phone ) changes
Is there any way to add any sort of debugging to a Lego Mindstorms
Is there a way to have TortoiseSVN (or any other tool) auto-add any new
I don't understand how using a 'challenge token' would add any sort of prevention:
How would one display any add content from a dynamic aspx page? Currently I
My URL is: http://www.metroflatsmiami.com/listing/add.html Any help?
Debugging a PHP program, is there any add-on/plug-in for browser which I can view
Can anyone recommend any good add-ons or plugins for Microsoft Visual Studio ? Freebies

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.