or
<telerik:RadGrid ID="radGridReportData" runat="server" BorderStyle="None" GridLines="None" AutoGenerateColumns="false" ShowFooter="true" Width="1000px" AllowPaging="false" AllowSorting="true" AllowFilteringByColumn="true" AllowAutomaticUpdates="false" ShowGroupPanel="false" OnNeedDataSource="radGridReportData_NeedDataSource" OnItemCommand="radGridReportData_ItemCommand" OnItemCreated="radGridReportData_ItemCreated" OnItemDataBound="radGridReportData_ItemDataBound"> <ExportSettings IgnorePaging="true" OpenInNewWindow="true"> <Pdf PageHeight="210mm" PageWidth="297mm" PageBottomMargin="20mm" PageTopMargin="20mm" PageLeftMargin="20mm" PageRightMargin="20mm" /> </ExportSettings> <ClientSettings AllowGroupExpandCollapse="True" ReorderColumnsOnClient="False" AllowDragToGroup="false" AllowColumnsReorder="False" EnableRowHoverStyle="True"> <Selecting AllowRowSelect="false" /> <ClientEvents OnGridCreated="OnGridCreated" /> </ClientSettings> <GroupingSettings ShowUnGroupButton="true" CaseSensitive="false" /> <MasterTableView Width="100%" CommandItemDisplay="Top" GroupLoadMode="Client" ShowGroupFooter="true"> <CommandItemTemplate> <div> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td colspan="2" valign="top" align="center" style="color: White; font-weight: bold; font-size: 16px;"> <%# radComboReport.Text %> </td> </tr> <tr> <td colspan="2" valign="top" style="color: White;"> <table border="0" cellpadding="0" cellspacing="0" width="1000px"> <tr> <td valign="top" style="color: White; width: 800px;"> <b>Source: </b> <%# radComboSource.Text %> </td> <td valign="top" style="color: White;"> <b>Run By:</b> <%# GetUserName() %> </td> </tr> <tr> <td valign="top" style="color: White; width: 800px;"> <b>Recon: </b> <%# radRecons.Text %> </td> <td valign="top" style="color: White;"> <b>Run Date:</b> <%# System.DateTime.Now.ToShortDateString() %> </td> </tr> </table> </td> </tr> <tr> <td valign="top" style="color: White;"> <asp:CheckBox ID="chkShowHideFilters" runat="server" CssClass="tdText" Checked="false" onclick="showHideFilterItem(this.checked);" /> <b>Show Filter</b> </td> <td align="right" valign="top" style="color: White;"> <b>Export</b> <asp:LinkButton ID="btnExportToExcel" runat="server" CommandName="ExportToExcel"> <img src="Images/Icons/excel.png" alt="Export to Excel" style="border: 0px; vertical-align: middle;" /> </asp:LinkButton> <asp:LinkButton ID="btnExportToWord" runat="server" CommandName="ExportToWord"> <img src="Images/Icons/word.png" alt="Export to Word" style="border: 0px; vertical-align: middle;" /> </asp:LinkButton> <asp:LinkButton ID="btnExportToPDF" runat="server" CommandName="ExportToPdf"> <img src="Images/Icons/pdf.png" alt="Export to PDF" style="border: 0px; vertical-align: middle;" /> </asp:LinkButton> </td> </tr> </table> </div> </CommandItemTemplate> <HeaderStyle Font-Bold="true" /> <Columns /> </MasterTableView> </telerik:RadGrid>| <telerik:RadGrid |
| ID="RegGrid" |
| runat="server" |
| Skin="Windows7" |
| BorderStyle="None" |
| GridLines="None" |
| Width="650px" |
| PageSize="20" |
| AllowFilteringByColumn="true" |
| AllowSorting="True" |
| ShowFooter="True" |
| AllowPaging="True" |
| AutoGenerateColumns="False" |
| EnableLinqExpressions="false" |
| AllowAutomaticInserts="false" |
| AllowAutomaticUpdates="false" |
| AllowAutomaticDeletes="false" |
| OnItemCreated="RegGrid_ItemCreated" |
| OnItemCommand="RegGrid_ItemCommand" |
| OnItemDataBound="RegGrid_ItemDataBound" |
| OnDeleteCommand="RegGrid_DeleteCommand" |
| OnInsertCommand="RegGrid_InsertCommand" |
| OnUpdateCommand="RegGrid_UpdateCommand" |
| OnNeedDataSource="RegGrid_NeedDataSource"> |
| <ClientSettings> |
| <Selecting AllowRowSelect="false" /> |
| </ClientSettings> |
| <MasterTableView |
| DataKeyNames="regRequest,item" |
| EditMode="InPlace" |
| AllowFilteringByColumn="True" |
| ShowFooter="True" |
| CommandItemDisplay="Top" |
| InsertItemPageIndexAction="ShowItemOnCurrentPage" |
| CommandItemSettings-AddNewRecordText="Add Package" |
| ItemStyle-VerticalAlign="top" |
| AlternatingItemStyle-VerticalAlign="top" |
| HeaderStyle-HorizontalAlign="Center"> |
| <Columns> |
| <telerik:GridTemplateColumn AllowFiltering="false"> |
| <ItemTemplate> |
| <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Edit">Edit</asp:LinkButton> |
| <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Delete" OnClientClick="javascript:return confirm('Delete this Reg Item?')">Delete</asp:LinkButton> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:LinkButton ID="LinkButton3" runat="server" Text='<%# ((GridItem)Container).OwnerTableView.IsItemInserted? "Insert" : "Update" %>' |
| CommandName='<%# ((GridItem)Container).OwnerTableView.IsItemInserted? "PerformInsert" : "Update" %>'></asp:LinkButton> |
| <asp:LinkButton ID="LinkButton4" runat="server" CommandName="Cancel">Cancel</asp:LinkButton> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn DataField="regRequest" Visible="false" /> |
| <telerik:GridDropDownColumn UniqueName="ddcRegItems" DataField="item" ListTextField="name" ListValueField="item" |
| DataSourceID="sqlRegRequestItem" HeaderText="Reg Item" DropDownControlType="DropDownList" EmptyListItemText="- Select A Package -" EmptyListItemValue="0" /> |
| <telerik:GridBoundColumn DataField="quantity" HeaderText="Qty" DataFormatString="{0:n}" /> |
| <telerik:GridBoundColumn DataField="price" HeaderText="Price" DataFormatString="{0:C}" ReadOnly="true" /> |
| <telerik:GridCalculatedColumn HeaderText="Total (USD)" UniqueName="ExtendedPrice" |
| DataType="System.Double" DataFields="quantity, price" Expression="{0}*{1}" FooterText="Total : " |
| Aggregate="Sum" DataFormatString="{0:C}" /> |
| </Columns> |
| </MasterTableView> |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| </telerik:RadGrid> |
| protected void RegGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
| { |
| RIM.Event.Resources.Regcode.Request _request = (RIM.Event.Resources.Regcode.Request)(Session["Request"]); |
| if (_request != null) |
| { |
| // SELECT NON-DELETED ITEMS |
| List<RegItem> _regitems = _request.regItems.FindAll(p => p.deleted != true); |
| ((RadGrid)source).DataSource = _regitems; |
| } |
| } |
