or
Hi,
I would like to make a grid where both columns and rows are data from my database and where the cells are values, sums, based on the grouping from the row and the column. That is, if I had different products as columns, and salespersons as rows I would like the cells to enter the sum of the sales for the corresponding salesperson and product.
Is this possible using RadGrid control?
Thanks,
Alex
| <%@ Control Language="VB" AutoEventWireup="false" CodeFile="Admin_BizForSale_ValueProUploader.ascx.vb" Inherits="App_Controls_Admin_BizForSale_ValueProUploader" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <script language="javascript" type="text/javascript"> |
| function checkJavaScriptValidity() { |
| document.getElementById("jsEnabled").style.visibility = 'visible'; |
| document.getElementById("jsDisabled").style.visibility = 'hidden'; |
| document.getElementById("jsDisabled").style.display = 'none'; |
| } |
| </script> |
| <div class="customheader">Upload ValuePro</div> |
| <div class="panelbody_bottom"> |
| <table> |
| <tr> |
| <td> |
| <div id="jsEnabled" style="visibility: hidden"> |
| <telerik:RadProgressManager ID="RadProgressManager1" runat="server" /> |
| <telerik:RadUpload ID="RadUpload1" |
| runat="server" |
| Skin="Default2006" |
| TargetFolder="~/App_Data/ValuePro" |
| AllowedFileExtensions=".xml" |
| Width="370px" |
| ControlObjectsVisibility="None" |
| InputSize="33" |
| MaxFileInputsCount="1" |
| Localization-Select="Browse..." /> |
| <asp:Label ID="Label2" runat="server" Visible="false" /> |
| </div> |
| <div id="jsDisabled" style="color:Red;"> |
| Uploading ValuePro requires a <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank" style="color:Red;">JavaScript Enabled Browser</a>.<br /> |
| Click <a href="http://www.google.com/support/bin/answer.py?hl=en&answer=23852" target="_blank" style="color:Red;">Here</a> to see how you can enable JavaScript.<br /><br /> |
| We are sorry for the inconvenience. |
| </div> |
| </td> |
| <td style="padding-left:10px;"> |
| Business-Trader.com is set up to allow you to upload your ValuePro1 and your ValuePro10 information via XML to your Businesses For Sale Profile. Once your Ad is uploaded and paid for, it will be available in the |
| <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Search.aspx">Search</asp:HyperLink> area of Business-Trader.com.<br /> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="2"> |
| <telerik:RadProgressArea ID="RadProgressArea1" ProgressIndicators="TotalProgressBar, TotalProgress, TotalProgressPercent, RequestSize, TimeElapsed, TimeEstimated, TransferSpeed" runat="server" |
| Skin="Default2006" /> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <script type="text/javascript"> |
| function pageLoad() { |
| var upload = $find("<%= RadUpload1.ClientID %>"); |
| var uploaduploadDiv = upload.get_element(); |
| var input = document.createElement("input"); |
| input.type = "submit"; |
| input.className = "ruButton"; |
| input.value = "Upload"; |
| inputinput.id = input.name = upload.getID("submitButton"); |
| input.onclick = onClickHandler; |
| //the UL element of the upload |
| var ul = uploadDiv.getElementsByTagName("UL"); |
| //the array of all LI elements of the UL element |
| var LIs = ul[0].getElementsByTagName("LI"); |
| //Last LI item - the button area |
| var lastLi = LIs[LIs.length - 1]; |
| lastLi.appendChild(input); |
| } |
| function onClickHandler() { |
| __doPostBack("submitButton", ""); |
| } |
| </script> |
| <asp:Label ID="Label1" runat="server" /> |
Skin
="DWDS" EnableEmbeddedSkins="false"
<
link href="/Skins/DWDS/Grid.DWDS.css" rel="stylesheet" type="text/css" />
<
link href="/Skins/DWDS/Calendar.DWDS.css" rel="stylesheet" type="text/css" />
<
link href="/Skins/DWDS/Editor.DWDS.css" rel="stylesheet" type="text/css" />
GridHTMLEditorColumn
send null (on Firefox but on IE 7 they send the value). Part of this problem stems from the Editor picking up some of the styles from my sites stylesheet. I will post that in the Editor section.| <asp:Content ID="myBody" runat="server" ContentPlaceHolderID="cphBody"> |
| <link href="/Skins/DWDS/Grid.DWDS.css" rel="stylesheet" type="text/css" /> |
| <link href="/Skins/DWDS/Calendar.DWDS.css" rel="stylesheet" type="text/css" /> |
| <link href="/Skins/DWDS/Editor.DWDS.css" rel="stylesheet" type="text/css" /> |
| <h2>Calendar Management</h2> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadGrid2"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid2" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px" Transparency="25"> |
| <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" /> |
| </telerik:RadAjaxLoadingPanel> |
| <telerik:RadGrid ID="RadGrid2" runat="server" AllowAutomaticInserts="True" AllowAutomaticDeletes="True" AllowAutomaticUpdates="True" Width="100%" AutoGenerateColumns="false" |
| AllowPaging="true" PageSize="15" DataSourceID="SqlDataSource1" AllowSorting="true" Skin="DWDS" EnableEmbeddedSkins="false" ImagesPath="/Skins/DWDS/Grid/"> |
| <MasterTableView CommandItemDisplay="Top" DataKeyNames="ID" Width="100%" EditMode="EditForms"> |
| <CommandItemTemplate> |
| <asp:LinkButton Style="vertical-align: bottom" ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# RadGrid2.EditIndexes.Count == 0 %>'> |
| <img style="border:0px" alt="" src="/Skins/DWDS/Grid/Edit.gif" /> Edit Calendar Entry |
| </asp:LinkButton> |
| <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# RadGrid2.EditIndexes.Count > 0 %>'> |
| <img style="border:0px" alt="" src="/Skins/DWDS/Grid/Update.gif" /> Update Calendar |
| </asp:LinkButton> |
| |
| <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# RadGrid2.EditIndexes.Count > 0 || RadGrid2.MasterTableView.IsItemInserted %>'> |
| <img style="border:0px" alt="" src="/Skins/DWDS/Grid/Cancel.gif" /> Cancel editing |
| </asp:LinkButton> |
| |
| <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !RadGrid2.MasterTableView.IsItemInserted %>'> |
| <img style="border:0px" alt="" src="/Skins/DWDS/Grid/AddRecord.gif" /> Add new Calendar Entry</asp:LinkButton> |
| <asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# RadGrid2.MasterTableView.IsItemInserted %>'> |
| <img style="border:0px" alt="" src="/Skins/DWDS/Grid/Insert.gif" /> Add this Entry</asp:LinkButton> |
| |
| <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected calendar entries?')" runat="server" CommandName="DeleteSelected" > |
| <img style="border:0px" alt="" src="/Skins/DWDS/Grid/Delete.gif" /> Delete Selected Entries |
| </asp:LinkButton> |
| |
| <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"> |
| <img style="border:0px" alt="" src="/Skins/DWDS/Grid/Refresh.gif" /> Refresh Calendar list |
| </asp:LinkButton> |
| <br /> |
| |
| </CommandItemTemplate> |
| <Columns> |
| <telerik:GridEditCommandColumn ButtonType="ImageButton" UpdateImageUrl="/Skins/DWDS/Grid/Update.gif" |
| EditImageUrl="/Skins/DWDS/Grid/Edit.gif" InsertImageUrl="/Skins/DWDS/Grid/Insert.gif" |
| CancelImageUrl="/Skins/DWDS/Grid/Cancel.gif" UniqueName="EditCommandColumn"> |
| <HeaderStyle Width="25px" /> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridButtonColumn ConfirmText="Delete this entry?" ButtonType="ImageButton" ImageUrl="/Skins/DWDS/Grid/Delete.gif" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"> |
| <HeaderStyle Width="25px" /> |
| <ItemStyle Width="25px" /> |
| </telerik:GridButtonColumn> |
| <telerik:GridBoundColumn DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" UniqueName="ID" Visible="False" /> |
| <telerik:GridDateTimeColumn HeaderText="Start Time/Date" UniqueName="st" DataField="EventDateBeg" PickerType="DateTimePicker" /> |
| <telerik:GridDateTimeColumn HeaderText="End Time/Date" UniqueName="et" DataField="EventDateEnd" PickerType="DateTimePicker" /> |
| <telerik:GridHTMLEditorColumn HeaderText="Entry Name" UniqueName="EventName" DataField="EventName" /> |
| <telerik:GridHTMLEditorColumn HeaderText="Entry Description" UniqueName="EventDescription" DataField="EventDescription" /> |
| </Columns> |
| <EditFormSettings CaptionDataField="EventDateBeg" CaptionFormatString="Edit properties of Calendar Entry: {0}" > |
| <FormTableItemStyle Wrap="False" Width="300px"></FormTableItemStyle> |
| <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> |
| <FormMainTableStyle GridLines="Horizontal" CellSpacing="10" CellPadding="10" BackColor="White" /> |
| <FormTableStyle CellSpacing="5" CellPadding="5" CssClass="module" Height="110px" BackColor="White" /> |
| <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> |
| <EditColumn ButtonType="ImageButton" UpdateImageUrl="/Skins/DWDS/Grid/Update.gif" |
| EditImageUrl="/Skins/DWDS/Grid/Edit.gif" InsertImageUrl="/Skins/DWDS/Grid/Insert.gif" |
| CancelImageUrl="/Skins/DWDS/Grid/Cancel.gif" InsertText="Insert Order" UpdateText="Update record" |
| UniqueName="EditCommandColumn1" CancelText="Cancel edit"> |
| </EditColumn> |
| <FormTableButtonRowStyle HorizontalAlign="Left" CssClass="EditFormButtonRow"></FormTableButtonRowStyle> |
| </EditFormSettings> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:oConnDW %>" SelectCommand="Calendar_List" SelectCommandType="StoredProcedure" |
| UpdateCommand="Calendar_Update_B" UpdateCommandType="StoredProcedure" DeleteCommand="Calendar_Delete_By_ID" DeleteCommandType="storedprocedure" InsertCommand="Calendar_Insert_B" |
| InsertCommandType="storedprocedure"> |
| <UpdateParameters> |
| <asp:Parameter Name="EventDateBeg" Type="datetime" /> |
| <asp:Parameter Name="EventDateEnd" Type="datetime" /> |
| <asp:Parameter Name="EventName" Type="string" /> |
| <asp:Parameter Name="EventDescription" Type="string" /> |
| </UpdateParameters> |
| <InsertParameters> |
| <asp:Parameter Name="EventDateBeg" Type="datetime" /> |
| <asp:Parameter Name="EventDateEnd" Type="datetime" /> |
| <asp:Parameter Name="EventName" Type="string" /> |
| <asp:Parameter Name="EventDescription" Type="string" /> |
| </InsertParameters> |
| <DeleteParameters> |
| <asp:Parameter Name="ID" Type="int16" /> |
| </DeleteParameters> |
| </asp:SqlDataSource> |
| </asp:Content> |