or


<telerik:RadGrid ID="RadGrid_1" runat="server" DataSourceID="EntityDataSource_1" CellSpacing="0" GridLines="None"
AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" Width="970px"><telerik:RadDateInput ID="RadDateInput44" runat="server" SelectedDate='<%# Bind("effectivedate")%>' />radGrid.AllowSorting = true;radGrid.MasterTableView.AllowMultiColumnSorting = true;radGrid.MasterTableView.AllowNaturalSort = true;<ad:adGrid ID="grdAttachments" runat="server" Width="100%" AllowPaging="false" GroupingEnabled="true" ShowGroupPanel="false" MasterTableView-GroupsDefaultExpanded="true" > <MasterTableView HierarchyLoadMode ="Client" > <Columns> <tel:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Category" /> <tel:GridHyperLinkColumn UniqueName="Subject" DataTextField="Subject" HeaderText="Subject" DataNavigateUrlFormatString="ts/disp.aspx?id={0}" DataNavigateUrlFields="ID" SortExpression="Subject"> <ItemStyle CssClass="gridhyperlink" /> </tel:GridHyperLinkColumn><tel:GridHyperLinkColumn UniqueName="FileName" DataTextField="FileName" HeaderText="Attachment"DataNavigateUrlFormatString="{0}" DataNavigateUrlFields="AttachmentUrl" SortExpression="FileName" Target="_blank"><ItemStyle CssClass="gridhyperlink" /></tel:GridHyperLinkColumn><tel:GridDateTimeColumn UniqueName="CreatedDate" DataField="CreatedDate" HeaderText="Date" /><tel:GridBoundColumn UniqueName="CreatedBy" DataField="CreatedBy" HeaderText="Author" /> </Columns><GroupByExpressions><tel:GridGroupByExpression> <SelectFields><tel:GridGroupByField FieldName="Name" FieldAlias="Category" /></SelectFields><GroupByFields><tel:GridGroupByField FieldName="Name" /></GroupByFields></tel:GridGroupByExpression> </GroupByExpressions></MasterTableView> <ClientSettings AllowExpandCollapse="true"> </ClientSettings></ad:adGrid>----------------------------------------------------------------Private Sub grdAttachments_NeedsDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs) Handles grdAttachments.NeedDataSource Dim types As ADAttachmentTypeList = CMClient.GetAttacntTyps() Dim attachments = types.Aggregate( New List(Of Object)(), Function(acc As List(Of Object), type As ADAttachmentType) Dim typeAttachments As ADAttachmentList = Document.GetAttachments(type.ID) typeAttachments.Aggregate( acc, Function(acc2 As List(Of Object), attachment As ADAttachment) Dim extension = attachment.Extension.ToLower() Dim navigationUrl As String = String.Empty If CurrentTADClient.CCV Then navigationUrl = String.Format("ts/view.aspx?id={0}&path={1}&aid={2}", attachment.Document.ID, attachment.FileName, attachment.ID) ElseIf EnableCommentsWithAttachments Then navigationUrl = String.Format("reviews/dispyReadOnlyOpt.aspx?id={0}&type=ATTACHMENT&path={1}&aid={2}", attachment.Document.ID, attachment.FileName, attachment.ID) Else If (extension = "docx" _ OrElse extension = "doc" _ OrElse extension = "dotx" _ OrElse extension = "dot" _ OrElse extension = "rtf" _ ) Then navigationUrl = String.Format( "rev/dispyreadonly.aspx?id={0}&type=ATTACHMENT&path={1}", attachment.Document.ID, attachment.FileName ) Else navigationUrl = attachment.VirtualPath End If End If acc2.Add(New With { Key .Name = type.Name, .ID = attachment.ID, .Subject = attachment.Subject, .FileName = attachment.FileName, .CreatedDate = String.Format("{0} {1}", attachment.CreatedDate.ToString(CurrentCulture.DateTimeFormat.ShortDatePattern, CurrentCulture), attachment.CreatedDate.ToString(CurrentCulture.DateTimeFormat.ShortTimePattern, CurrentCulture)), .CreatedBy = attachment.CreatedBy, .AttachmentUrl = navigationUrl }) Return acc2 End Function ) Return acc End Function ) DirectCast(grdAttachments.Columns(1), GridHyperLinkColumn).DataNavigateUrlFormatString = String.Format("{0}hj/ts/displ.aspx?id={1}0{2}", Captions.VirtualRoot, Chr(123), Chr(125)) grdAttachments.DataSource = attachments.ToArray() End Sub<asp:Panel ID="pnlSelectAllItemsClearAllItems" Visible="true" runat="server" ScrollBars="None"> <table border="0"> <tr> <td width="50%" style="height:2%;"> <asp:RadioButtonList ID="rbSelectAllItemsClearAllItems" runat="server" AutoPostBack="true" RepeatDirection="Horizontal" Enabled="true" OnSelectedIndexChanged="rbSelectClearAllItems_OnSelectedIndexChanged" > <asp:ListItem Value="SelectAllItems">Select All Items</asp:ListItem> <asp:ListItem Value="ClearAll">Clear All</asp:ListItem> </asp:RadioButtonList> </td> <td style="text-align: center; height:2%;" width="50%"> <asp:Button runat="server" Text="Archive Selected Items" ID="btnArchiveSelected" onclick="btnArchiveSelected_Click" /> </td> </tr> </table></asp:Panel>