Need help with Gridview

D

Durango2008

Hi, I am trying to display data from a database on to the website in a table
format using Gridview.
The problem is that each cell contains alot of data and so, when I try to
show this in the gridview the cells get stretched too large to show it
properly on the page.
One idea I had to remedy this is to have the data "cutoff" at a certain
number of characters and have the cell so that when it is clicked a
Multiline Textbox at the bottom of page show entire content of the "clicked"
cell.
My question is, how can I take the data and modify it for the gridview
before the page loads?
I am new to this, but I am looking at the Gridview events and I am wondering
if using the "onDatabinding" or "onDatabound" event is what I can use to
accomplish this?

If anyone has other advice or a workaround to my issue, I greatly appreciate
it.

thank you in advance.
 
S

Stan

Hi, I am trying to display data from a database on to the website in a table
format using Gridview.
The problem is that each cell contains alot of data and so, when I try to
show this in the gridview the cells get stretched too large to show it
properly on the page.
One idea I had to remedy this is to have the data "cutoff" at a certain
number of characters and have the cell so that when it is clicked a
Multiline Textbox at the bottom of page show entire content of the "clicked"
cell.
My question is, how can I take the data and modify it for the gridview
before the page loads?
I am new to this, but I am looking at the Gridview events and I am wondering
if using the "onDatabinding" or "onDatabound" event is what I can use to
accomplish this?

If anyone has other advice or a workaround to my issue, I greatly appreciate
it.

thank you in advance.

It's much easier to modify the databinding expression rather than mess
around with text in controls after they have loaded. For example:

For a label control in the item template the text attribute could be

text='<%# (Eval("BigField").ToString()).SubString(1, 10) %>'

in place of the 10 put whatever maximum length you require
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top