Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > binding to data table

Reply
Thread Tools

binding to data table

 
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      08-29-2005
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
 
Reply With Quote
 
 
 
 
tom pester
Guest
Posts: n/a
 
      08-29-2005

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



 
Reply With Quote
 
 
 
 
Chris Botha
Guest
Posts: n/a
 
      08-30-2005
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:5DA64362-8F5C-45AE-B18F-...
> 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



 
Reply With Quote
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      08-30-2005
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:5DA64362-8F5C-45AE-B18F-...
> > 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

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Binding Problem in DropDownList Control SelectedValue to Table text field Tom Jorgenson ASP .Net 3 03-09-2007 10:42 AM
Complex data binding question, binding child objects of a custom collection. JcFx ASP .Net Datagrid Control 0 06-01-2005 04:01 PM
Binding multiple table to a Data Grid Nita Raju ASP .Net 1 12-09-2004 10:44 AM
Table/table rows/table data tag question? Rio HTML 4 11-05-2004 08:11 AM
Data Binding - using inline code vs. functions vs. straight binding Jordan ASP .Net 2 02-10-2004 08:32 PM



Advertisments