Hello,
I need the data from the row which i will delete. I need this data for a log file. How can i do that?
I need the Id, ResWidth and ResHeight Data for the log file.
I need the data in the line "string logtext = string.Formate ...".
Best regards
Reiner
I need the data from the row which i will delete. I need this data for a log file. How can i do that?
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellSpacing="0" Culture="de-DE" DataSourceID="ObjectDataSource1" GridLines="None" Width="450px" AllowSorting="True" ShowFooter="True" ondeletecommand="RadGrid1_DeleteCommand" oninsertcommand="RadGrid1_InsertCommand" onitemcommand="RadGrid1_ItemCommand" onitemdatabound="RadGrid1_ItemDataBound" onupdatecommand="RadGrid1_UpdateCommand"> <ClientSettings> <Selecting CellSelectionMode="None" /> </ClientSettings> <MasterTableView AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" CommandItemDisplay="TopAndBottom" DataKeyNames="ResID" DataSourceID="ObjectDataSource1"> <CommandItemSettings ExportToPdfText="Export to PDF" /> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True"> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True"> </ExpandCollapseColumn> <Columns> <telerik:GridTemplateColumn DataField="ResWidth" DataType="System.Int32" FilterControlAltText="Filter ResWidth column" HeaderText="<%$ Resources:BasicSettings, Width %>" SortExpression="ResWidth" UniqueName="ResWidth"> <EditItemTemplate> <telerik:RadNumericTextBox ID="RadNumericTextBox1" Runat="server" Culture="de-DE" DbValue='<%# Bind("ResWidth") %>' LabelWidth="" MinValue="0" Width="125px"> <NumberFormat DecimalDigits="0" ZeroPattern="n" /> </telerik:RadNumericTextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="RadNumericTextBox1" Display="Dynamic" ErrorMessage="<%$ Resources:BasicSettings, RequiredValidation %>"></asp:RequiredFieldValidator> </EditItemTemplate> <ItemTemplate> <asp:Label ID="ResWidthLabel" runat="server" Text='<%# Eval("ResWidth") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="ResHeight" DataType="System.Int32" FilterControlAltText="Filter ResHeight column" HeaderText="<%$ Resources:BasicSettings, Height %>" SortExpression="ResHeight" UniqueName="ResHeight"> <EditItemTemplate> <telerik:RadNumericTextBox ID="RadNumericTextBox2" Runat="server" Culture="de-DE" DbValue='<%# Bind("ResHeight") %>' LabelWidth="" MinValue="0" Width="125px"> <NumberFormat DecimalDigits="0" ZeroPattern="n" /> </telerik:RadNumericTextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="RadNumericTextBox2" Display="Dynamic" ErrorMessage="<%$ Resources:BasicSettings, RequiredValidation %>"></asp:RequiredFieldValidator> </EditItemTemplate> <ItemTemplate> <asp:Label ID="ResHeightLabel" runat="server" Text='<%# Eval("ResHeight") %>'></asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridEditCommandColumn ButtonType="ImageButton" FilterControlAltText="Filter EditCommandColumn column" HeaderText="<%$ Resources:BasicSettings, Edit %>"> </telerik:GridEditCommandColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmText="<%$ Resources:BasicSettings, ConfirmDelete %>" HeaderText="<%$ Resources:BasicSettings, Delete %>" Text="Delete" UniqueName="DeleteColumn"> </telerik:GridButtonColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1"> </EditColumn> </EditFormSettings> </MasterTableView> <FilterMenu EnableImageSprites="False"> </FilterMenu></telerik:RadGrid> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="ResolutionsBLL" InsertMethod="InsertResolutions" SelectMethod="GetResolutions" DeleteMethod="DeleteResolution" UpdateMethod="UpdateResolution" > <DeleteParameters> <asp:Parameter Name="resID" Type="Int32" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="ResWidth" Type="Int32" /> <asp:Parameter Name="ResHeight" Type="Int32" /> </InsertParameters> <SelectParameters> <asp:Parameter DefaultValue="1" Name="resArt" Type="Int32" /> </SelectParameters> <UpdateParameters> <asp:Parameter Name="resArt" Type="Int32" /> <asp:Parameter Name="resWidth" Type="Int32" /> <asp:Parameter Name="resHeight" Type="Int32" /> <asp:Parameter Name="resID" Type="Int32" /> </UpdateParameters></asp:ObjectDataSource>I need the Id, ResWidth and ResHeight Data for the log file.
protected void RadGrid1_DeleteCommand(object sender, GridCommandEventArgs e){ try { int ID = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ResID"].ToString()); string logtext = string.Format("Delete {0} x {1}", oldWidth, oldHeight); // I need this here UserEventsBLL uev = new UserEventsBLL(); uev.AddUserEvent(thisUser.UserName, "deleteRes", logtext, Request.Url.AbsolutePath, null, ID, null); } catch (Exception ex) { ErrorsBLL errors = new ErrorsBLL(); errors.AddErrors(203, Request.Url.AbsolutePath, ex.Message, thisUser.UserName, ""); }}I need the data in the line "string logtext = string.Formate ...".
Best regards
Reiner