Hi,
I have gone through so many threads of the same issue but didn't get any solution. I am facing the mentioned issue. Refer to below sample code, when i hit on insert button in popup form, the form does not closes and the insert button's text changes to "update". Why form is not closing??
And here is my aspx code..
I have gone through so many threads of the same issue but didn't get any solution. I am facing the mentioned issue. Refer to below sample code, when i hit on insert button in popup form, the form does not closes and the insert button's text changes to "update". Why form is not closing??
Protected
Sub
RadGrid2_NeedDataSource(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridNeedDataSourceEventArgs)
Dim
GridExperience
As
RadGrid = RadPanelBar1.FindItemByValue(
"Step1"
).FindControl(
"RadGrid2"
)
Dim
dSet
As
Global.PICT.Web.CVDataSet = Session(
"CV"
)
GridExperience.DataSource = dSet.Jobs
End
Sub
Protected
Sub
RadGrid2_PreRender(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
If
Not
IsPostBack
Then
Dim
GridExperience
As
RadGrid = RadPanelBar1.FindItemByValue(
"Step1"
).FindControl(
"RadGrid2"
)
GridExperience.EditIndexes.Add(0)
GridExperience.MasterTableView.Rebind()
End
If
End
Sub
Protected
Sub
RadGrid2_InsertCommand(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridCommandEventArgs)
Dim
editedItem
As
GridEditableItem =
CType
(e.Item, GridEditableItem)
Dim
dSet
As
Global.PICT.Web.CVDataSet = Session(
"CV"
)
Dim
newRow
As
DataRow = dSet.Jobs.NewRow
Dim
ExpKey
As
Long
= 0
If
dSet.Jobs.Compute(
"MAX(PKEY)"
,
String
.Empty)
Is
DBNull.Value
Then
ExpKey = 1
Else
ExpKey = dSet.Jobs.Compute(
"MAX(PKEY)"
,
String
.Empty) + 1
End
If
newRow(
"PKEY"
) = ExpKey
newRow(
"JOB_CODE"
) = 1
newRow(
"IS_ACTIVE"
) = 1
Dim
newValues
As
Hashtable =
New
Hashtable
e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)
Try
For
Each
entry
As
DictionaryEntry
In
newValues
newRow(
CType
(entry.Key,
String
)) = entry.Value
Next
dSet.Jobs.Rows.Add(newRow)
Catch
ex
As
Exception
e.Canceled =
True
End
Try
e.Item.OwnerTableView.IsItemInserted =
False
Session(
"CV"
) = dSet
End
Sub
And here is my aspx code..
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
Runat
=
"server"
>
</
telerik:RadScriptManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
Runat
=
"server"
Skin
=
"Default"
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadPanelBar1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadPanelBar1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
</
telerik:RadAjaxLoadingPanel
>
<
telerik:RadPanelBar
ID
=
"RadPanelBar1"
runat
=
"server"
Skin
=
"Web20"
Width
=
"720px"
ExpandMode
=
"SingleExpandedItem"
>
<
Items
>
<
telerik:RadPanelItem
runat
=
"server"
Expanded
=
"True"
Selected
=
"True"
Text="Step 1: Personal Information >>>" >
<
Items
>
<
telerik:RadPanelItem
Value
=
"Step1"
>
<
ItemTemplate
>
<
telerik:RadGrid
ID
=
"RadGrid2"
runat
=
"server"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
GridLines
=
"None"
oninsertcommand
=
"RadGrid2_InsertCommand"
onitemcommand
=
"RadGrid2_ItemCommand"
onitemdatabound
=
"RadGrid2_ItemDataBound"
onneeddatasource
=
"RadGrid2_NeedDataSource"
onprerender
=
"RadGrid2_PreRender"
onupdatecommand
=
"RadGrid2_UpdateCommand"
Skin
=
"Web20"
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Default"
>
</
HeaderContextMenu
>
<
MasterTableView
EditMode
=
"PopUp"
CommandItemDisplay
=
"Top"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
/>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
>
<
HeaderStyle
Width
=
"20px"
/>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
/>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter Skill column"
UniqueName
=
"PKey"
DataField
=
"POSITION"
HeaderText
=
"Position"
HeaderStyle-Width
=
"250"
Visible
=
"false"
>
<
HeaderStyle
HorizontalAlign
=
"Center"
/>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormTemplate
>
<
asp:TextBox
ID
=
"TextBox1"
runat
=
"server"
Text='<%# Bind("POSITION") %>' ></
asp:TextBox
>
<
telerik:RadButton
ID
=
"BtnAddExperience"
runat
=
"server"
Text='<%# IIf (TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>'
Skin="Web20" Width="50px" CssClass="btnInsertItem"
CommandName='<%# IIf (TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>'>
</
telerik:RadButton
>
</
FormTemplate
>
<
PopUpSettings
Modal
=
"True"
Width
=
"480px"
/>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
</
telerik:RadGrid
>
</
ItemTemplate
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelItem
>
</
Items
>
</
telerik:RadPanelBar
>
</
asp:Content
>