Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 998
  • Last Modified:

RadGrid cell format

In my attached code the forecolor part is working fine...

However...I can't get the cell to show the date as "MM/dd/yyyy"

Tried everthing I can think of.
If TypeOf e.Item Is GridDataItem Then
            Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
            Format(Convert.ToDateTime(item.Cells(6).Text), "d")
            item.Cells(6).ForeColor = Drawing.Color.DarkRed
        End If

Open in new window

0
lrbrister
Asked:
lrbrister
1 Solution
 
gamarrojgqCommented:
Hi,

Try this

item.Cells(6).Text = Convert.ToDateTime(item.Cells(6).Text).ToString("MM/dd/yyyy")
0
 
lrbristerAuthor Commented:
Man!  Thanks!

Remind me to buy you a sody-pop sometime!

I was about to go postal on this thing!
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now