ValidatorCalloutExtender inside a DetailsView

Last post 07-24-2007 7:34 AM by sergiopc. 5 replies.

Sort Posts:

  • ValidatorCalloutExtender inside a DetailsView

    07-19-2007, 6:31 AM
    • Loading...
    • sergiopc
    • Joined on 07-19-2007, 6:16 AM
    • Posts 4

    Hi all

     i'm using a detailsview to do the usual insert/edit job on a webproject, and i want to use the ValidatorCalloutExtender to perform the validations.

    the validations are working fine but the callout with the arrow arent correctly displayed!...the box and the arow are spread apart from one another, so i'm losing that sense of unity, if u know what i mean.

    NOTE
    if i use the ValidatorCalloutExtender outside the detailsview it displays correctly.

    if theres no solution for this i wont be able to use this extender.

    any help would be much aprecciated.

    thanks

    SergioPC
    one more in the sea
  • Re: ValidatorCalloutExtender inside a DetailsView

    07-23-2007, 12:14 PM
    • Loading...
    • sergiopc
    • Joined on 07-19-2007, 6:16 AM
    • Posts 4

    i think that a detailsview with text boxes and validators its a common thing!

    so I dont believe that no one has this problem!...or that this cant be fixed!...or that its just happening to me.

    help?

     

    SergioPC
    one more in the sea
  • Re: ValidatorCalloutExtender inside a DetailsView

    07-23-2007, 10:30 PM

    Hi,

    This seems to be an issue with the style of the popup.

    Can you post a sample page here? 

  • Re: ValidatorCalloutExtender inside a DetailsView

    07-24-2007, 5:39 AM
    • Loading...
    • sergiopc
    • Joined on 07-19-2007, 6:16 AM
    • Posts 4

    thanks for your reply

    i have a ValidatorCalloutExtender inside a DetailsView.....but i have the DetailsView inside an EditItemTemplate of a GridView ...dont know if this makes a difference

     the code its straight forward:

    <asp:GridView ID="gvMaster" DataKeyNames="ID" runat="server" SkinID="GridViewCSS" Width="75%">
    <Columns>

    <asp:TemplateField HeaderText="CÓDIGO" HeaderStyle-HorizontalAlign="Center">
        <ItemStyle Width="25%" Wrap="false" />
        <ItemTemplate><asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Select" Text='<%# Eval("COD") %>'></asp:LinkButton></ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField ShowHeader="False">
        <ItemStyle HorizontalAlign="Center" Width="5%" Wrap="false" />
    <EditItemTemplate>

    <asp:DetailsView ID="DVdetail" AutoGenerateRows="false" DataKeyNames="ID" runat="server" Height="50px" Width="100%" OnModeChanging="DVdetail_ModeChanging" 
    OnDataBound
    ="DVdetail_DataBound"    OnItemCommand="DVdetail_ItemCommand" OnItemUpdating="DVdetail_ItemUpdating">
    <Fields>
    <asp:TemplateField>
         <HeaderTemplate>Código:</HeaderTemplate>
          <ItemTemplate><asp:Label ID="lblCod" runat="server" Text='<%# Eval("COD") %>'></asp:Label></ItemTemplate>
    <EditItemTemplate>

    <asp:TextBox ID="tboxCod" CssClass="tboxpeq" MaxLength="5" runat="server" Text='<%# Eval("COD") %>'></asp:TextBox>
    <asp:RequiredFieldValidator ControlToValidate="tboxCod" runat="server" ID="rfvCod"
    ErrorMessage="<b>Campo Obrigatório</b><br /> <span class='alerta'>O código é obrigatório.</span>"
    Display="None" SetFocusOnError="true"></asp:RequiredFieldValidator>
    <ajaxToolkit:ValidatorCalloutExtender runat="server" ID="reqExNome" TargetControlID="rfvCod" />

    </EditItemTemplate>
    </asp:TemplateField>
    (.......)

    the Width, the WarningIconImageUrl and the HighlightCssClass of the ValidatorCalloutExtender i set it on a Skin.

    like i said before...this working fine outside the Detailsview ( and GridView)

    thank you once again for your interest.

    SergioPC
    one more in the sea
  • Re: ValidatorCalloutExtender inside a DetailsView

    07-24-2007, 7:14 AM
    Answer
    • Loading...
    • valenumr
    • Joined on 12-31-2006, 1:27 PM
    • Posts 372

    It is a CSS problem with padding or margins. I use the following css, and it seems to not bother the callout in a gridview:

     

    .GridView th,
    .GridView td
    {
        padding-left: 8px;
        padding-right: 8px;
        vertical-align: top;
        white-space: nowrap;
    }
    
    .GridView td tbody tr td
    {
        padding-left: 0px;
        padding-right: 0px;
    }
    
     

    I can't really remember exactly, but I think it is the ".GridView td tbody tr td" nastiness that fixes the validator formatting... I had this problem a while back, so I don't remember for sure.

  • Re: ValidatorCalloutExtender inside a DetailsView

    07-24-2007, 7:34 AM
    • Loading...
    • sergiopc
    • Joined on 07-19-2007, 6:16 AM
    • Posts 4

    Thanks a million!!

     in my case i just had to put in the ".GridView td" the padding-right to 0px !...didnt need it anyway :)

    SergioPC
    one more in the sea
Page 1 of 1 (6 items)
Microsoft Communities
Page view counter