Hello,
I have been working with the RadGrid and binding it to output I receive from PowerShell commands with no issues. However, when i want to perform operations such as filtering and sorting, I cannot seem to get this to work. Following is my HTML and my code behind where I am using the NeedDataSource event:
As a note, I have tried modifying the PoweShell command to not have a default sort order and just utilize the primary cmdlet of get-mailboxdatabasecopystatus * and still cannot get it to work. All that I get back is the same table unsorted and unfiltered every time.
Any help in understanding how I can get this to work would be greatly appreciated!
Thanks,
Ron
I have been working with the RadGrid and binding it to output I receive from PowerShell commands with no issues. However, when i want to perform operations such as filtering and sorting, I cannot seem to get this to work. Following is my HTML and my code behind where I am using the NeedDataSource event:
<telerik:RadGrid ID="HealthCheckStatus" runat="server" AllowPaging="false" AllowFilteringByColumn="true" AllowSorting="true" ViewStateMode="Enabled"> <MasterTableView CommandItemDisplay="Top"> <NoRecordsTemplate> <div class="no-records"> No records to display. </div> </NoRecordsTemplate> <Columns> <telerik:GridBoundColumn DataField="Name" HeaderText="Database Name" /> <telerik:GridBoundColumn DataField="Status" HeaderText="Status" /> <telerik:GridBoundColumn DataField="CopyQueueLength" HeaderText="Copy Queue Length" /> <telerik:GridBoundColumn DataField="ReplayQueueLength" HeaderText="Replay Queue Length" /> <telerik:GridDateTimeColumn DataField="LastInspectionLogTime" HeaderText="Last Inspection Log Time" /> <telerik:GridBoundColumn DataField="ContentIndexState" HeaderText="Content Index State" /> </Columns> <CommandItemSettings ShowAddNewRecordButton="false" ShowExportToExcelButton="true" ShowExportToCsvButton="true" ShowRefreshButton="false" /> </MasterTableView> <ExportSettings Excel-Format="ExcelML" HideStructureColumns="true" ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" /></telerik:RadGrid>Protected Sub HealthCheckStatus_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles HealthCheckStatus.NeedDataSource Dim queues As Collection(Of PSObject) = PSExchange( _ "get-mailboxdatabasecopystatus * | sort CopyQueueLength -descending | sort Name") HealthCheckStatus.DataSource = queuesEnd SubAs a note, I have tried modifying the PoweShell command to not have a default sort order and just utilize the primary cmdlet of get-mailboxdatabasecopystatus * and still cannot get it to work. All that I get back is the same table unsorted and unfiltered every time.
Any help in understanding how I can get this to work would be greatly appreciated!
Thanks,
Ron