Hi,
please help me with the following aspx radgrid that when I click the delete button it removes the row from the grid (visually) but not from the database. there is not postback, just client side deleteion
thank you!
please help me with the following aspx radgrid that when I click the delete button it removes the row from the grid (visually) but not from the database. there is not postback, just client side deleteion
thank you!
CodeBehind="seasonsList.aspx.cs" Inherits="RadControlsWebApp2.seasonsList" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"head"
runat
=
"server"
>
</
asp:Content
>
<
asp:Content
ID
=
"Content4"
ContentPlaceHolderID
=
"ContentPlaceHolder3"
runat
=
"server"
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
UpdateInitiatorPanelsOnly
=
"True"
>
</
telerik:RadAjaxManager
>
<
p
>
</
p
>
<
asp:Panel
ID
=
"Panel2"
runat
=
"server"
Height
=
"91px"
Style
=
"margin-right: 243px; padding-right: 100px;"
Width
=
"750px"
>
<
div
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AllowAutomaticDeletes
=
"true"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
CellSpacing
=
"0"
DataSourceID
=
"SqlDataSource1"
GridLines
=
"None"
Skin
=
"Office2007"
>
<
SortingSettings
SortToolTip
=
"לחץ כאן כדי למיין"
/>
<
ExportSettings
>
<
Pdf
PageHeight
=
"297mm"
PageWidth
=
"210mm"
PaperSize
=
"A4"
/>
</
ExportSettings
>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"True"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataKeyNames
=
"seasonID"
DataSourceID
=
"SqlDataSource1"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
CancelText
=
"ביטול"
EditText
=
"עריכה"
FilterControlAltText
=
"Filter EditCommandColumn column"
meta:resourceKey
=
"GridEditCommandColumnResource1"
UpdateText
=
"עדכון"
EditImageUrl
=
"Images/edit.png"
HeaderStyle-BorderStyle
=
None
>
</
telerik:GridEditCommandColumn
>
<
telerik:GridClientDeleteColumn
ButtonType
=
"ImageButton"
ConfirmText
=
"האם אתה בטוח שברצונך למחוק?"
Display
=
"true"
ImageUrl
=
"Images/delete.gif"
HeaderStyle-BorderStyle
=
None
ConfirmTitle
=
"מחיקה"
>
</
telerik:GridClientDeleteColumn
>
<
telerik:GridBoundColumn
DataField
=
"seasonID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter seasonID column"
HeaderText
=
"קוד עונה"
ReadOnly
=
"true"
SortExpression
=
"seasonID"
UniqueName
=
"seasonID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"seasonName"
FilterControlAltText
=
"Filter seasonName column"
HeaderText
=
"שם עונה"
SortExpression
=
"seasonName"
UniqueName
=
"seasonName"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
>
</
EditColumn
>
</
EditFormSettings
>
<
PagerStyle
PageSizeControlType
=
"RadComboBox"
></
PagerStyle
>
</
MasterTableView
>
<
PagerStyle
PageSizeControlType
=
"RadComboBox"
></
PagerStyle
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:tm2013ConnectionString %>"
DeleteCommand="DELETE FROM [tblseasons] where [seasonID]=@seasonID"
UpdateCommand="UPDATE [tblseasons] SET [seasonName]=@seasonName where [seasonID]=@seasonID"
SelectCommand="SELECT [seasonID], [seasonName] FROM [tblseasons]">
<
DeleteParameters
>
<
asp:Parameter
Name
=
"seasonID"
Type
=
"Int32"
/>
</
DeleteParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"seasonName"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"seasonID"
Type
=
"Int32"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
</
div
>
<
telerik:RadButton
ID
=
"addNewSeason_btn"
runat
=
"server"
Text
=
"הוסף עונה חדשה"
OnClick
=
"addNewSeason_Click"
>
</
telerik:RadButton
>
</
asp:Panel
>
</
asp:Panel
>
</
asp:Content
>