Need help with Gridview

Discussion in 'ASP .Net' started by Durango2008, May 5, 2008.

  1. Durango2008

    Durango2008 Guest

    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.
     
    Durango2008, May 5, 2008
    #1
    1. Advertising

  2. Durango2008

    Stan Guest

    On 5 May, 23:56, "Durango2008" <0m> wrote:
    > 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
     
    Stan, May 6, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    1,861
  2. Miguel Dias Moura
    Replies:
    1
    Views:
    6,047
  3. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    17,981
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  4. mosscliffe

    GridView.SelectedRow - need Help Please

    mosscliffe, May 25, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    5,704
    =?Utf-8?B?RGF2aWQgSmVzc2Vl?=
    May 25, 2006
  5. Replies:
    0
    Views:
    1,684
Loading...

Share This Page