473,386 Members | 2,078 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,386 software developers and data experts.

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 1656
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
by: Mariusz Jedrzejewski | last post by:
Hi, I'll be very grateful if somebody can explain me why my Opera 7.23 (runing under linux) doesn't show me inner tables. Using below code I can see only "inner table 1". There is no problem with...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
1
by: sck10 | last post by:
Hello, I am trying to change a value when a user goes into edit mode on a DetailsView control. I am trying to use the following, but can not figure out how to get to the bound field...
3
by: dennist685 | last post by:
Format text as a heading I'm progressing through a walkthrough on DetailsView control Early on it says Type Edit Employees, select the text, and then format the text as a heading. I clicked...
5
by: dpomt | last post by:
When the ASP.NET menu is rendered on downlevel browers, the text "^ up one level" is displayed. Any ideas how I can change that text? I did not find a property for the menu control where I can...
1
by: Mark Stafford | last post by:
I am attempting to use a DetailsView control to view some data where the fields returned by the database are determined at runtime. I create the TemplateFields on the fly using a class that...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
1
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
When I click the "Edit" hyperlink, my DetailsView doesn't enter Edit mode. It will if I set the DefaultMode="Edit". Any thoughts? Thanks. <asp:DetailsView ID="DetailsView1"...
1
by: ajrock2000 | last post by:
I am using a DetailsView to display some data. I am basically getting a firstname, and lastname fields from a database (the database cannot be changed, nor the queries), and I must concatenate the ,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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...

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.