Imports Telerik.Web.UI
Partial Class Invoice_Custom_test
Inherits System.Web.UI.Page
Protected Sub Invoice_Custom_test_Load(sender As Object, e As System.EventArgs) Handles Me.Load
BindGrid()
End Sub
Private Sub fillSigns(ByRef dropdown As RadComboBox, Optional ByVal withEmptyFirst As Boolean = False, Optional ByVal value As String = "", Optional ByVal text As String = "")
If dropdown.Items.Count = 0 Then
'' Dim compList As InvoiceCompanyList = Nothing
If withEmptyFirst Then dropdown.Items.Add(New RadComboBoxItem("", ""))
dropdown.Items.Add(New RadComboBoxItem("=", "="))
dropdown.Items.Add(New RadComboBoxItem("<", "<"))
dropdown.Items.Add(New RadComboBoxItem("<=", "<="))
dropdown.Items.Add(New RadComboBoxItem(">", ">"))
dropdown.Items.Add(New RadComboBoxItem(">=", ">="))
Try
If text <> "" Then dropdown.FindItemByText(text).Selected = True
If value <> "" Then dropdown.FindItemByValue(value).Selected = True
Catch ex As Exception
End Try
End If
End Sub
Public Sub BindGrid()
Dim tr As New TableRow
Dim tc As New TableCell
Dim l As New Label
l.Text = "TEST 3 from code with autopostback"
tc.Controls.Add(l)
Dim radComboRadDueDate As RadComboBox = New RadComboBox
radComboRadDueDate.ID = "RadDueDate"
radComboRadDueDate.ShowToggleImage = False
radComboRadDueDate.EnableViewState = False
radComboRadDueDate.Width = Unit.Pixel(22)
radComboRadDueDate.DropDownWidth = Unit.Pixel(40)
radComboRadDueDate.AllowCustomText = False
radComboRadDueDate.MarkFirstMatch = True
radComboRadDueDate.OnClientSelectedIndexChanged = "checkDateToSubmit"
fillSigns(radComboRadDueDate, , )
tc.Controls.Add(radComboRadDueDate)
Dim nbsp As New Literal()
nbsp.Text = " "
tc.Controls.Add(nbsp)
Dim RadDatePicker1 As New RadDatePicker()
RadDatePicker1.DatePopupButton.ToolTip = "test"
Dim tod As New RadCalendarDay
tod.Repeatable = Telerik.Web.UI.Calendar.RecurringEvents.Today
tod.ItemStyle.CssClass = "rcToday"
RadDatePicker1.Calendar.SpecialDays.Add(tod)
RadDatePicker1.DateInput.DateFormat = "dd-MM-yyyy"
RadDatePicker1.AutoPostBack = True
RadDatePicker1.ID = "txttest"
RadDatePicker1.Width = Unit.Pixel(90)
tc.Controls.Add(RadDatePicker1)
tr.Cells.Add(tc)
tblHeader.Rows.Add(tr)
End Sub
End Class