468,247 Members | 1,324 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,247 developers. It's quick & easy.

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

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>
....
Oct 20 '08 #1
1 1513
i found it:
in itemtemplate working with substring ...

"Eric" <er*@sdsclem.poschreef in bericht
news:%2****************@TK2MSFTNGP05.phx.gbl...
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>
...


Oct 20 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

44 posts views Thread by Mariusz Jedrzejewski | last post: by
1 post views Thread by sck10 | last post: by
3 posts views Thread by dennist685 | last post: by
1 post views Thread by =?Utf-8?B?RGF2ZQ==?= | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.