Hello:
We have a RadGrid which is populated dynamically, it has 9 columns. The grid is grouped on 1 column using GroupByExpressions/GridGroupByField.
The header of the grid is actually supposed to display that grouped column, plus sum of 2 other columns with that group. Here is the relevant portion of the code:
<GroupByExpressions>
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldName="GBF" />
<telerik:GridGroupByField FieldName="S1" Aggregate="Sum" HeaderText=".."/>
<telerik:GridGroupByField FieldName="S2" Aggregate="Sum" HeaderText=".." />
</SelectFields>
<GroupByFields>
<telerik:GridGroupByField FieldName="GBF" />
</GroupByFields>
</telerik:GridGroupByExpression>
</GroupByExpressions>
Now the problem is, these grouped columns are not aligned to their respective top-level headers. Everything appears in a single line (in html output, I see colspan=9).
Is there a way to align GroupBy headers to top-level headers and display blanks in other places.
Thanks in advance .. Rohit Dehar
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 |