I might be doing something wrong with Calendar.. but I really do not know waht.
I want to show some elements (dates) highlighted: All are introduced in array. And I copy/paste& modify the demo of "Element Render" to do it.
But the problem is that after that, the calendar is like Not Enabled, but when I minimize the application and click to maximize again, it renders and is enabled, or ready to click. Is like there is a final "refresh" or "invalidate". to make a final redraw...
(BTW I suppose that this can be done with Specialdays... but I get problems on how to create the template... I havent found a proper example about how to inicialzate the new RadHostItem (control)... What control...is not the calendar itself.
Thanks. And bare with me... its my first day with the controls....
--------------------
Private Sub RadCalendar2_ElementRender(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.RenderElementEventArgs) Handles RadCalendar2.ElementRender
'If Me.DatesList.SelectedItem Is Nothing Then
' Return
'End If
'Comprobar que e.Day.Date esta en la luista
'Try/Catch
Dim ProcessOK As Boolean
Dim idx As Integer
Try
ProcessOK = False
If Me._CALEN_DatesSet IsNot Nothing Then
For idx = 0 To Me._CALEN_DatesSet.Length - 1
If Me._CALEN_DatesSet(idx).Equals(e.Day.Date) Then
ProcessOK = True
Exit For
End If
Next
End If
If ProcessOK Then
' e.Element.Text = e.Day.Date.Day.ToString ''Me.radTextBox1.Text
e.Element.DrawFill = True
If Me._CALEN_cellBackColor = Color.Empty Then
_CALEN_cellBackColor = e.Element.BackColor
End If
e.Element.ForeColor = Color.Black
e.Element.BackColor = Color.Orange
e.Element.BackColor2 = Color.Yellow
' e.Element.BackColor = _CALEN_cellBackColorSEL 'CType((CType(Me.ColorList.SelectedItem, RadComboBoxItem)).Value, Color)
e.Element.Invalidate()
Else
If _CALEN_cellBackColor <> Color.Empty Then
e.Element.BackColor = _CALEN_cellBackColor
End If
If Not (TryCast(e.Element, Telerik.WinControls.UI.CalendarCellElement)).Selected Then
e.Element.DrawFill = False
Else
TryCast(e.Element, Telerik.WinControls.UI.CalendarCellElement).Selected = True
e.Element.DrawFill = True
End If
End If
Catch ex As Exception
My.Application.SendError(ex, "Error", ErrorReport.MessageImage.Denied, " ")
ProcessOK = False
Finally
End Try
End Sub