Hello people...
I'm having a problem with my RadGrid...Can you show me how can i on my asp.cs file(code behind) set the column value of my grid with a navigation property field?
I'm using Entity, and I have the a table SapDocuments with a foreign Key of the field Process to another Table "Staging",
At this moment my grid comes with Priority and Stagin values at null and the others are fine...
I need to set those two column values with the value of my navigation property....I can access to it like that:
I'm having a problem with my RadGrid...Can you show me how can i on my asp.cs file(code behind) set the column value of my grid with a navigation property field?
RadGrid1.DataSource = this.SapDocuments;
RadGrid1.
RadGrid1.UniqueID.Equals("Process") =
public List<
SapDocuments
> GetSapDocumentsByUser(string userName)
{
var documentsQuery = from sd in spDocs.SapDocuments
join ua in spDocs.UsersAssign
on new { sd.Staging.Process, sd.Priorities.Priority }
equals
new { ua.Process, ua.Priority }
where ua.UserName == userName
//ALterar User
select sd;
return documentsQuery.ToList();
}
}
}
I'm using Entity, and I have the a table SapDocuments with a foreign Key of the field Process to another Table "Staging",
At this moment my grid comes with Priority and Stagin values at null and the others are fine...
<
MasterTableView
GridLines
=
"None"
Width
=
"100%"
ViewStateMode
=
"Disabled"
CommandItemSettings-ShowExportToCsvButton
=
"True"
CommandItemSettings-ShowAddNewRecordButton
=
"false"
CommandItemDisplay
=
"Top"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"SequencialNumber"
HeaderText
=
"SequencialNumber"
UniqueName
=
"SequencialNumber"
SortExpression
=
"SequencialNumber"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Priority"
HeaderText
=
"Priority"
UniqueName
=
"Priority"
FilterControlAltText
=
"Filter Priority column"
SortExpression
=
"Priority"
DataType
=
"System.Int32"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Process"
HeaderText
=
"Staging"
UniqueName
=
"Process"
SortExpression
=
"Process"
FilterControlAltText
=
"Filter Process column"
>
</
telerik:GridBoundColumn
>
I need to set those two column values with the value of my navigation property....I can access to it like that:
SapDocuments.Staging.Process;
SapDocuments.Priorities.Priority;
I needed to change my datamodel and know i have the exception for Priority and Process :
{"The ObjectContext instance has been disposed and can no longer be used for operations that require a connection."}
I have already set LazyLoad enabled...