471,337 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Need help with Gridview

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.
Jun 27 '08 #1
1 1085
On 5 May, 23:56, "Durango2008" <el_dura...@yah00.c0mwrote:
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

Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by mosscliffe | last post: by
1 post views Thread by Durango2008 | last post: by
reply views Thread by rosydwin | last post: by

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.