Need help with Gridview

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Durango2008

    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 "onDatabind ing" or "onDataboun d" 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.


  • Stan

    #2
    Re: Need help with Gridview

    On 5 May, 23:56, "Durango200 8" <el_dura...@yah 00.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 "onDatabind ing" or "onDataboun d" 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

    Comment

    Working...