Hi,
I'm having trouble with my RadGrid - whenever I try editing an item the row isn't put into edit mode and instead all the data is lost from the Grid. I have AllowAutomaticUpdates set to true, and am using the NeedDataSource method.
My aspx code:
And my C# code:
Any help you could provide would be much appreciated.
Thanks!
I'm having trouble with my RadGrid - whenever I try editing an item the row isn't put into edit mode and instead all the data is lost from the Grid. I have AllowAutomaticUpdates set to true, and am using the NeedDataSource method.
My aspx code:
<
telerik:RadGrid
ID
=
"SubmittedApplicantsRadGrid"
runat
=
"server"
GridLines
=
"Both"
AutoGenerateColumns
=
"False"
OnNeedDataSource
=
"SubmittedApplicantsRadGrid_NeedDataSource"
AllowAutomaticDeletes
=
"true"
AllowAutomaticInserts
=
"true"
AllowAutomaticUpdates
=
"true"
>
<
ValidationSettings
ValidationGroup
=
"SubmittedApplicants"
></
ValidationSettings
>
<
MasterTableView
DataKeyNames
=
"Id"
EditMode
=
"InPlace"
CommandItemDisplay
=
"None"
NoMasterRecordsText
=
"No applicants submitted to this job"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ApplicantName.Title"
DataType
=
"System.String"
ReadOnly
=
"true"
HeaderText
=
"Name"
UniqueName
=
"Name"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"PayRate"
DataType
=
"System.Double"
DataFormatString
=
"{0:C}"
ReadOnly
=
"true"
HeaderText
=
"Pay Rate"
UniqueName
=
"PayRate"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"BillRate"
DataType
=
"System.Double"
DataFormatString
=
"{0:C}"
ReadOnly
=
"true"
HeaderText
=
"Bill Rate"
UniqueName
=
"BillRate"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ApplicantName.Class"
DataType
=
"System.String"
ReadOnly
=
"true"
HeaderText
=
"Employee Class"
UniqueName
=
"Class"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SubmittedBy.Title"
DataType
=
"System.String"
ReadOnly
=
"true"
HeaderText
=
"Submitted By"
UniqueName
=
"SubmittedBy"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SubmittedDate"
DataType
=
"System.DateTime"
ReadOnly
=
"true"
HeaderText
=
"Submitted On"
UniqueName
=
"SubmittedDate"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ForwardedBy.Title"
DataType
=
"System.String"
ReadOnly
=
"true"
HeaderText
=
"Forwarded By"
UniqueName
=
"ForwardedBy"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ForwardedDate"
DataType
=
"System.DateTime"
ReadOnly
=
"false"
HeaderText
=
"Forwarded On"
UniqueName
=
"ForwardedDate"
></
telerik:GridBoundColumn
>
<
telerik:GridCheckBoxColumn
DataField
=
"Interviewed"
DataType
=
"System.Boolean"
ReadOnly
=
"false"
HeaderText
=
"Interviewed?"
UniqueName
=
"Interviewed"
></
telerik:GridCheckBoxColumn
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
>
<
ItemStyle
Wrap
=
"False"
Width
=
"28px"
/>
</
telerik:GridEditCommandColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
UniqueName
=
"EditCommandColumn1"
></
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
And my C# code:
protected
void
SubmittedApplicantsRadGrid_NeedDataSource(
object
source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
EntityList<ApplicantsSubmittedJobsItem> ApplicantsSubmittedJobs = data.GetList<ApplicantsSubmittedJobsItem>(
"ApplicantsSubmittedJobs"
);
var applicantSubmittedJobs = from applicantSubmittedJob
in
ApplicantsSubmittedJobs
select applicantSubmittedJob;
SubmittedApplicantsRadGrid.DataSource = applicantSubmittedJobs;
}
Any help you could provide would be much appreciated.
Thanks!