Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / April 2008

Tip: Looking for answers? Try searching our database.

Newbie GridView question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Durango2008 - 01 Apr 2008 22:27 GMT
Hello I have a form that uses a Gridview to display data obtained from the
database.
The problem I am having is that the data I receive is tremendous amount of
text.
Each cell basically gets elongated vertically and hence the page streches
due to this large amount of data.
My solution is to create uniform sized cells where when you click the cell a
multi-line textbox at the bottom will display the full data for the user to
read through.

My problem is the sizing of each cell.
I am trying to set the width and height of the TemplateField so that each
cell can be resized to a smaller size, but it does not seem to be working.
I have also tried resizing the control items (asp:label, asp:textbox) that
reside within the TemplateField items, but still not change.

Here is a simplified version of code that shows what my Gridview looks like:

<asp:Panel ID="panelGV" runat="server">
<asp:GridView ID="GridView1" runat="server" DatasourceID="sqldataABC" >
<Columns>
<asp:TemplateField HeaderText="Function" >
<EditItemTemplate>
<asp:TextBox ID="functionTB" runat="server" text="'<%# Bind("Function")
%>'/>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="FunctionLbl" runat="server" text="'<%# Bind("Function") %>'/>
</ItemTemplate>
</asp:TemplateField>
.
.
.
</Columns>
</asp:GridView>

If anyone has any suggestion/advice I'd appreciate it.

thank you.
Ignacio Machin ( .NET/ C# MVP ) - 02 Apr 2008 20:55 GMT
> Hello I have a form that uses a Gridview to display data obtained from the
> database.
[quoted text clipped - 35 lines]
>
> thank you.

Hi,

You could use a TemplatedColumn and putting a control that with a
hover  display the entire string in a DIV por example. Take a look at
the RowCreated event.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.