Results 1 to 2 of 2

Thread: [RESOLVED] [02/03] Datagrid and huge field that needs to be bound...

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Resolved [RESOLVED] [02/03] Datagrid and huge field that needs to be bound...

    hey,
    I got a pretty big field in my database that the user wants bound in a datagrid along with all kinds of other normal sized fields. It's in vs2003 which I don't use often but I am working with somebody's legacy code. Anyways I would like to use a template field with something to contain the data so it doesn't stretch out my rows too badly. The question is what control should I bind the data to? I pretty much want it to be like a multiline read only textbox but I noticed in the page source that I couldn't use the text property to bind the data to.

    anyone got a suggestion?

    Thanks!

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: [RESOLVED] [02/03] Datagrid and huge field that needs to be bound...

    nvm got it, did it in the itemdatabound event.

    vb Code:
    1. Private Sub dgJobs_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgJobs.ItemDataBound
    2.         Try
    3.             Dim txtBox As TextBox = e.Item.FindControl("TextBox2")
    4.             txtBox.Text = dgJobs.DataKeys.Item(e.Item.ItemIndex)
    5.         Catch ex As Exception
    6.  
    7.         End Try
    8.     End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width