how to show only part of text in normal mode in detailsview?

Discussion in 'ASP .Net' started by Eric, Oct 20, 2008.

  1. Eric

    Eric Guest

    Hi,

    I have a detailsview which shows large text. What i want is to show only the
    beginning of the text in normal mode and the full text in edit mode.
    Here the code:

    Thanks
    Eric

    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    ConnectionString="<%$ ConnectionStrings:myconn %>"
    SelectCommand="SELECT .... FROM mytable"
    UpdateCommand="UPDATE ...." >
    <UpdateParameters>
    <asp:parameter Name="id" Type="Int32" />
    ....
    </UpdateParameters>
    </asp:SqlDataSource>

    <asp:DetailsView ID="DetailsView1" runat="server" ... >
    <Fields>
    <asp:TemplateField >
    <ItemTemplate>
    <asp:Label ID="Label1" runat="server" Text='<%# Bind("n1")
    %>'></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
    <asp:TextBox ID="TextBox1" TextMode="MultiLine" runat="server" Text='<%#
    Bind("n1") %>' ></asp:TextBox>
    </EditItemTemplate>
    </asp:TemplateField>
    ....
    Eric, Oct 20, 2008
    #1
    1. Advertising

  2. Eric

    Eric Guest

    i found it:
    in itemtemplate working with substring ...

    "Eric" <> schreef in bericht
    news:%...
    > Hi,
    >
    > I have a detailsview which shows large text. What i want is to show only
    > the beginning of the text in normal mode and the full text in edit mode.
    > Here the code:
    >
    > Thanks
    > Eric
    >
    > <asp:SqlDataSource ID="SqlDataSource1" runat="server"
    > ConnectionString="<%$ ConnectionStrings:myconn %>"
    > SelectCommand="SELECT .... FROM mytable"
    > UpdateCommand="UPDATE ...." >
    > <UpdateParameters>
    > <asp:parameter Name="id" Type="Int32" />
    > ....
    > </UpdateParameters>
    > </asp:SqlDataSource>
    >
    > <asp:DetailsView ID="DetailsView1" runat="server" ... >
    > <Fields>
    > <asp:TemplateField >
    > <ItemTemplate>
    > <asp:Label ID="Label1" runat="server" Text='<%# Bind("n1")
    > %>'></asp:Label>
    > </ItemTemplate>
    > <EditItemTemplate>
    > <asp:TextBox ID="TextBox1" TextMode="MultiLine" runat="server" Text='<%#
    > Bind("n1") %>' ></asp:TextBox>
    > </EditItemTemplate>
    > </asp:TemplateField>
    > ...
    >
    >
    Eric, Oct 20, 2008
    #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. John J Lee
    Replies:
    3
    Views:
    470
    bruno at modulix
    Dec 1, 2005
  2. Edward Loper
    Replies:
    0
    Views:
    457
    Edward Loper
    Aug 7, 2007
  3. Leo Jay
    Replies:
    1
    Views:
    287
  4. Feege
    Replies:
    0
    Views:
    444
    Feege
    Dec 20, 2005
  5. Replies:
    2
    Views:
    92
    Tom Cole
    Aug 24, 2006
Loading...

Share This Page