or
<
telerik:RadTreeView
runat
=
"server"
ID
=
"RadTreeView2"
Skin
=
"Metro"
DataSourceID
=
"GetNotesTicket"
datatextfield
=
"Date"
>
</
telerik:RadTreeView
>
if (e.CommandName == RadGrid.PerformInsertCommandName && e.Item.OwnerTableView.Name == "Positions")
{
GridEditableItem item = e.Item as GridEditableItem;
GridDataItem parentItem = e.Item.OwnerTableView.ParentItem;
//int sectionId = Convert.ToInt32(item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["intSectionId"]);
int secId = Convert.ToInt32(parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["intSectionId"]);
TextBox descrip = (TextBox)item.FindControl("txtdescription");
TextBox scale = (TextBox)item.FindControl("txtScale");
TextBox posType = (TextBox)item.FindControl("txtPosType");
TextBox grade = (TextBox)item.FindControl("txtGrade");
sql = "Execute usp_InsertPosition " + secId + ", '" + c.SanitizeString(descrip.Text) + "', '" + c.SanitizeString(scale.Text) + "', '" + c.SanitizeString(posType.Text) + "', '" + c.SanitizeString(grade.Text) + "'";
c.InsertUpdateDelete(sql);
myradGrid.Rebind(); """"""If I remove works fine but in sub grid gives below error.
}
intPositionId is neither a DataColumn nor a DataRelation for table .
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: intPositionId is neither a DataColumn nor a DataRelation for table .
Source Error:
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.
Stack Trace:
[ArgumentException: intPositionId is neither a DataColumn nor a DataRelation for table .]
System.Data.DataRowView.get_Item(String property) +1353926
Telerik.Web.UI.GridTableView.PopulateDataKey(Object dataItem, DataKey key, String name) +86
Telerik.Web.UI.GridTableView.PopulateDataKeys(Object dataItem) +194
[GridException: There was a problem extracting DataKeyValues from the DataSource. Please ensure that DataKeyNames are specified correctly and all fields specified exist in the DataSource.]
string
scriptstring =
"radalert('You must save Location for Employee..', 250, 80,'Information');"
;
ScriptManager.RegisterStartupScript(
this
,
this
.GetType(),
"radalert"
, scriptstring,
true
);
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Save"
CssClass
=
"btnSaveForm"
OnClick
=
"btnTotalaSave_Click"
/>
<
telerik:RadWindow
ID
=
"rwChangePassword"
runat
=
"server"
Behaviors
=
"Close,Move"
EnableShadow
=
"true"
VisibleStatusbar
=
"false"
VisibleTitlebar
=
"true"
AutoSize
=
"true"
Modal
=
"true"
>
<
ContentTemplate
>
<
div
class
=
"dialogMain smallText"
style
=
"width:330px"
>
<
asp:UpdatePanel
ID
=
"UpdatePanel2"
runat
=
"server"
>
<
ContentTemplate
>
<
div
style
=
"margin:10px 0 0 5px"
>
<
div
style
=
"width:95%"
>
Please enter the user's new password, enter it a second time to confirm, and then press OK:
</
div
>
.
.
.
public
bool
ModalDialogIsActive
{
get
{
return
Convert.ToBoolean(ViewState[
"ModalDialogIsActive"
]);
// Note: Returns 'false' if the value is 'null'
}
set
{
if
(value)
Website.Common.ShowDialog(rwChangePassword);
else
Website.Common.HideDialog(rwChangePassword);
ViewState[
"ModalDialogIsActive"
] = value;
}
}
rwChangePassword.Title =
"Changing Password for "
+ userName;
ModalDialogIsActive =
true
;