binding to data table

Discussion in 'ASP .Net' started by =?Utf-8?B?cm9kY2hhcg==?=, Aug 29, 2005.

  1. hey all,

    i'm binding my datagrid to a data table (not within a dataset) and am trying
    to format a column as a date, can someone please show me how to do that?

    thanks,
    rodchar
     
    =?Utf-8?B?cm9kY2hhcg==?=, Aug 29, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?cm9kY2hhcg==?=

    tom pester Guest

    It's somewhere in this gem :

    http://aspnet.4guysfromrolla.com/articles/040502-1.aspx

    Let me know if you have any more questions...

    Cheers,
    Tom Pester

    > hey all,
    >
    > i'm binding my datagrid to a data table (not within a dataset) and am
    > trying to format a column as a date, can someone please show me how to
    > do that?
    >
    > thanks,
    > rodchar
     
    tom pester, Aug 29, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?cm9kY2hhcg==?=

    Chris Botha Guest

    Here is an example to change email text into hyperlinks, your code should be
    pretty much the same.

    DataGrid1.DataSource = myTable
    DataGrid1.DataBind()
    Dim oneDataGridItem As DataGridItem
    For Each oneDataGridItem In DataGrid1.Items
    Dim emailText As String = oneDataGridItem.Cells(INX_EMAIL).Text.Trim()
    If emailText <> "&nbsp;" Then ' Not empty
    oneDataGridItem.Cells(INX_EMAIL).Text = "<a href='mailto:" & emailText
    & "'>" & emailText & "</a>"
    End If
    Next

    "rodchar" <> wrote in message
    news:...
    > hey all,
    >
    > i'm binding my datagrid to a data table (not within a dataset) and am
    > trying
    > to format a column as a date, can someone please show me how to do that?
    >
    > thanks,
    > rodchar
     
    Chris Botha, Aug 30, 2005
    #3
  4. thanks everyone for the help.

    "Chris Botha" wrote:

    > Here is an example to change email text into hyperlinks, your code should be
    > pretty much the same.
    >
    > DataGrid1.DataSource = myTable
    > DataGrid1.DataBind()
    > Dim oneDataGridItem As DataGridItem
    > For Each oneDataGridItem In DataGrid1.Items
    > Dim emailText As String = oneDataGridItem.Cells(INX_EMAIL).Text.Trim()
    > If emailText <> " " Then ' Not empty
    > oneDataGridItem.Cells(INX_EMAIL).Text = "<a href='mailto:" & emailText
    > & "'>" & emailText & "</a>"
    > End If
    > Next
    >
    > "rodchar" <> wrote in message
    > news:...
    > > hey all,
    > >
    > > i'm binding my datagrid to a data table (not within a dataset) and am
    > > trying
    > > to format a column as a date, can someone please show me how to do that?
    > >
    > > thanks,
    > > rodchar

    >
    >
    >
     
    =?Utf-8?B?cm9kY2hhcg==?=, Aug 30, 2005
    #4
    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. Tom Jorgenson
    Replies:
    3
    Views:
    7,031
  2. Jordan
    Replies:
    2
    Views:
    2,538
    Jordan
    Feb 10, 2004
  3. Nita Raju

    Binding multiple table to a Data Grid

    Nita Raju, Dec 9, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,266
    Eliyahu Goldin
    Dec 9, 2004
  4. Rio
    Replies:
    4
    Views:
    1,202
  5. JcFx
    Replies:
    0
    Views:
    281
Loading...

Share This Page