Need help with Gridview

  • Thread starter Thread starter Durango2008
  • Start date Start date
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.
 
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
 
Back
Top