or
protected void RadGridPrzedmiotyWydzialu_DeleteCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e){ if (e.Item.Cells.Count > 0) { var db = DatabaseFactory.CreateDatabase(); var cmd = db.GetStoredProcCommand("katw_Przedmioty_Katedr_upd"); db.AddInParameter(cmd, "@idOsobaDziekan", DbType.Int32, MySession.IdOsoba); db.AddInParameter(cmd, "@idWydzial", DbType.Int32, MySession.IdWydzial); db.AddInParameter(cmd, "@idPrzedmiot", DbType.Int32, e.Item.Cells[2].Text); db.ExecuteNonQuery(cmd); }
//refresh my grid after delete item from first radgrid RadGridPrzedmiotyWydzialuBrakKatedry.Rebind(); }<asp:SqlDataSource ID="SqlDataSourcePrzedmiotyWydzialu" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultDatabaseConnection %>" SelectCommand="katw_Przedmioty_Wydzialu_sel" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:ControlParameter ControlID="WydzialRadComboBox" Name="IdWydzial" PropertyName="SelectedValue" Type="Int32" /> </SelectParameters></asp:SqlDataSource><telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadGridPrzedmiotyWydzialu"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGridPrzedmiotyWydzialu" LoadingPanelID="RadAjaxLoadingPanel" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadGridPrzedmiotyWydzialuBrakKatedry"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGridPrzedmiotyWydzialuBrakKatedry" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings></telerik:RadAjaxManager><telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel><telerik:RadGrid ID="RadGridPrzedmiotyWydzialu" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellSpacing="0" Culture="pl-PL" GridLines="None" HorizontalAlign="Justify" Skin="Simple" OnDeleteCommand="RadGridPrzedmiotyWydzialu_DeleteCommand" DataSourceID="SqlDataSourcePrzedmiotyWydzialu"> <ClientSettings> <Selecting CellSelectionMode="None" AllowRowSelect="true" /> </ClientSettings> <MasterTableView NoMasterRecordsText="Brak rekordów do wyświetlenia." DataKeyNames="IdPrzedmiot" CommandItemDisplay="Top" DataSourceID="SqlDataSourcePrzedmiotyWydzialu"> <CommandItemSettings ExportToPdfText="Export to PDF" RefreshText="Odśwież" ShowAddNewRecordButton="False" /> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True"> <HeaderStyle Width="20px" /> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True"> <HeaderStyle Width="20px" /> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="IdPrzedmiot" HeaderText="IdPrzedmiot" UniqueName="IdPrzedmiot" FilterControlAltText="Filter IdPrzedmiot column" DataType="System.Int32" SortExpression="IdPrzedmiot" ReadOnly="true" Visible="false"> </telerik:GridBoundColumn> <telerik:GridButtonColumn CommandName="Edit" UniqueName="EditColumn" ButtonType="ImageButton" Text="Edytuj"> <HeaderStyle Width="3%" /> </telerik:GridButtonColumn> <telerik:GridButtonColumn CommandName="Delete" UniqueName="DeleteColumn" ButtonType="ImageButton" Text="Usuń"> <HeaderStyle Width="3%" /> </telerik:GridButtonColumn> <telerik:GridBoundColumn DataField="Nazwa" HeaderText="Nazwa przedmiotu" UniqueName="Nazwa" FilterControlAltText="Filter Nazwa column" DataType="System.String" SortExpression="Nazwa" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Kod" HeaderText="Kod" UniqueName="Kod" FilterControlAltText="Filter Kod column" DataType="System.String" SortExpression="Kod" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="IdKatedra" HeaderText="IdKatedra" UniqueName="IdKatedra" FilterControlAltText="Filter IdKatedra column" DataType="System.Int32" ReadOnly="true" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="KatedraNazwa" HeaderText="Katedra" UniqueName="Katedra" FilterControlAltText="Filter Katedra column" DataType="System.String" SortExpression="Katedra" ReadOnly="true"> </telerik:GridBoundColumn> </Columns> <EditFormSettings EditFormType="WebUserControl" UserControlName="PrzedmiotyKatedre.ascx"> <EditColumn FilterControlAltText="Filter EditCommandColumn column" ButtonType="ImageButton"> </EditColumn> </EditFormSettings> </MasterTableView></telerik:RadGrid><asp:SqlDataSource ID="SqlDataSourcePrzedmiotyWydzialuBrakKatedry" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultDatabaseConnection %>" SelectCommand="katw_Przedmioty_Wydzialu_BrakKatedry_sel" SelectCommandType="StoredProcedure"> <SelectParameters> <asp:ControlParameter ControlID="WydzialRadComboBox" Name="IdWydzial" PropertyName="SelectedValue" Type="Int32" /> </SelectParameters> </asp:SqlDataSource> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"> </telerik:RadAjaxLoadingPanel> <telerik:RadGrid ID="RadGridPrzedmiotyWydzialuBrakKatedry" runat="server" AllowPaging="true" AutoGenerateColumns="false" CellSpacing="0" Culture="pl-PL" DataSourceID="SqlDataSourcePrzedmiotyWydzialuBrakKatedry" GridLines="None" HorizontalAlign="Justify" Skin="Simple"> <ClientSettings> <Selecting CellSelectionMode="None" /> </ClientSettings> <MasterTableView DataSourceID="SqlDataSourcePrzedmiotyWydzialuBrakKatedry" NoMasterRecordsText="Brak rekordów do wyświetlenia." DataKeyNames="IdPrzedmiot" CommandItemDisplay="Top"> <CommandItemSettings ExportToPdfText="Export to PDF" RefreshText="Odśwież" ShowAddNewRecordButton="False" /> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True"> <HeaderStyle Width="20px" /> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True"> <HeaderStyle Width="20px" /> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="IdPrzedmiot" HeaderText="IdPrzedmiot" UniqueName="IdPrzedmiot" FilterControlAltText="Filter IdPrzedmiot column" DataType="System.Int32" SortExpression="IdPrzedmiot" ReadOnly="true" Visible="false"> </telerik:GridBoundColumn> <telerik:GridButtonColumn CommandName="Edit" Text="Edytuj" UniqueName="EditColumn" ButtonType="ImageButton"> <HeaderStyle Width="3%" /> </telerik:GridButtonColumn> <telerik:GridBoundColumn DataField="Nazwa" HeaderText="Nazwa przedmiotu" UniqueName="Nazwa" FilterControlAltText="Filter Nazwa column" DataType="System.String" SortExpression="Nazwa" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Kod" HeaderText="Kod" UniqueName="Kod" FilterControlAltText="Filter Kod column" DataType="System.String" SortExpression="Kod" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="IdKatedra" HeaderText="IdKatedra" UniqueName="IdKatedra" FilterControlAltText="Filter IdKatedra column" DataType="System.Int32" ReadOnly="true" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="KatedraNazwa" HeaderText="Katedra" UniqueName="Katedra" FilterControlAltText="Filter Katedra column" DataType="System.String" SortExpression="Katedra" ReadOnly="true"> </telerik:GridBoundColumn> </Columns> <EditFormSettings EditFormType="WebUserControl" UserControlName="PrzedmiotyKatedre.ascx"> <EditColumn FilterControlAltText="Filter EditCommandColumn column" ButtonType="ImageButton"> </EditColumn> </EditFormSettings> </MasterTableView> </telerik:RadGrid>

protected
void RadGridComparableAnalysis_ItemDataBound(object sender, GridItemEventArgs e) {
if (e.Item is GridDataItem) {
e.Item.Cells[0].Font.Bold =
true;
}
}

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
<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>