I'm now to ASP.net and programming work i use the RADGridView in my website.
the question is how I can change the color of the cell based on a specific conditions that my column is a datetime. I want if the due date is pass the color should be RED.
thanks a lot for your great help Jayesh
I just convert your code to VB.NET and modifies a small issue
my code is the following
Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
If (TypeOf e.Item Is GridDataItem) Then
Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)
Dim FromDate As Date
' Dim todate As Date = dataItem("DueDate").Text
FromDate = (DateTime.ParseExact(dataItem("DueDate").Text, "dd/MM/yyyy", System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat))
Dim CellValue As DateTime = Convert.ToDateTime(FromDate)
If DateDiff(DateInterval.Day, CellValue, Today.Date) > 1 Then
dataItem.Cells(6).BackColor = System.Drawing.Color.Red
ElseIf DateDiff(DateInterval.Day, CellValue, Today.Date) > 3 Then