Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
COMMAND_NAME = e.CommandName
Select Case COMMAND_NAME
Case "RemoveFilters"
bResetSelections = True
Case RadGrid.ExportToExcelCommandName
Dim t As DateTime = Now()
bExport = True
Dim sHTML As String = ""
sHTML += "<div align='left' style='font-weight:bold;color:Blue;font-size:large'>Regulation Tracking System</div>"
sHTML += "<div align='left' style='font-weight:bold;color:Blue'>Regulation Records Data Dump</div>"
sHTML += "<div align='left' style='font-weight:bold;color:Blue'>" + t.ToLongDateString() + "</div>"
sHTML += "<div> </div>"
RadGrid1.MasterTableView.Caption = sHTML
RadGrid1.ExportSettings.FileName = RTS.GetFileName("RegulationRecords")
RadGrid1.ExportSettings.IgnorePaging = True
RadGrid1.ExportSettings.ExportOnlyData = True
RadGrid1.ExportSettings.OpenInNewWindow = True
RadGrid1.MasterTableView.ExportToExcel()
End Select
End Sub
''' <summary>
''' Loads a root directory with given path, where all subdirectories
''' contained in the SelectedUrl property are loaded
''' </summary>
''' <remarks>
''' The ImagesPaths, DocumentsPaths, etc properties of RadEditor
''' allow multiple root items to be specified, separated by comma, e.g.
''' Photos,Paintings,Diagrams. The FileBrowser class calls the
''' ResolveRootDirectoryAsTree method for each of them.
''' </remarks>
''' <param name="path">the root directory path, passed by the FileBrowser</param>
''' <returns>The root DirectoryItem or null if such does not exist</returns>
Public Overloads Overrides Function ResolveRootDirectoryAsTree(ByVal path As String) As DirectoryItem
' The files are added in ResolveDirectory()
Dim returnValue As New DirectoryItem(GetName(path), GetDirectoryPath(path), path, String.Empty, GetPermissions(path), Nothing, _
GetChildDirectories(path))
Return returnValue
End Function

| <telerik:RadComboBox ID="Combo1" Runat="server" Height="22px" |
| Width="340px" MaxHeight="150px" |
| Filter="Contains" |
| ExpandDelay="50" HighlightTemplatedItems="True" |
| OnClientSelectedIndexChanging="LoadCombo2" |
| OnItemsRequested="Combo1_ItemsRequested" |
| </telerik:RadComboBox> |
| <telerik:RadComboBox ID="Combo2" Runat="server" |
| MaxHeight="150px" |
| OnClientItemsRequested="ItemsLoaded" |
| OnItemsRequested="Combo2_ItemsRequested" |
| style="z-index: 1; position: relative; width: 340px; display:table-cell; top: 0px; height: 21px; left: 0px;" |
| ShowWhileLoading="False"> |
| </telerik:RadComboBox> |
| <script type="text/javascript"> |
| var cboSecond; |
| function pageLoad() { |
| cboSecond = $find("Combo2"); |
| } |
| function LoadCombo2(combo, eventArqs) { |
| var item = eventArqs.get_item(); |
| Combo2.requestItems(item.get_value(), false); |
| } |
| function ItemsLoaded(combo, eventArqs) { |
| if (combo.get_items().get_count() > 0) { |
| combo.set_text(combo.get_items().getItem(0).get_text()); |
| combo.get_items().getItem(0).highlight(); |
| } |
| } |
| </script> |
| Protected Sub Combo2_ItemsRequested(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs) Handles Combo2.ItemsRequested |
| If IsNumeric(e.Text) Then |
| Dim id As Long = System.Convert.ToInt32(e.Text) |
| LoadCombo2(id) |
| End If |
| End Sub |
| Private Sub LoadCombo2(ByVal id As Long) |
| Dim sqlda As SqlDataAdapter |
| Dim sqltbl As New DataTable |
| Dim sSQLAffiliates As String |
| sSQLAffiliates = GetAffiliateSQL(id) |
| sqlda = New SqlDataAdapter(sSQLAffiliates, sqlconn) |
| sqlda.Fill(sqltbl) |
| With Me.Combo2 |
| .DataTextField = "Affiliate" |
| .DataValueField = "Affiliate_ID" |
| .DataSource = sqltbl |
| .DataBind() |
| End With |
| End Sub |