Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6229781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:37:57+00:00 2026-05-24T09:37:57+00:00

I’m having a problem with my RadGrid…Can you show me how can i on

  • 0

I’m having a problem with my RadGrid…Can you show me how can i on my aspx file 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 its value at null…

<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>
                    <telerik:GridBoundColumn DataField="SupplierCode" HeaderText="SupplierCode" UniqueName="SupplierCode"
                        SortExpression="SupplierCode" FilterControlAltText="Filter SupplierCode column">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="MessageStatus" HeaderText="MessageStatus" UniqueName="MessageStatus"
                        SortExpression="MessageStatus" FilterControlAltText="Filter MessageStatus column">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DocumentType" HeaderText="DocumentType" UniqueName="DocumentType"
                        FilterControlAltText="Filter DocumentType column" SortExpression="DocumentType">
                    </telerik:GridBoundColumn>
                    <telerik:GridDateTimeColumn UniqueName="InvoiceCreationDate" DataField="InvoiceCreationDate"
                        HeaderText="InvoiceCreationDate" FilterControlAltText="Filter InvoiceCreationDate column"
                        SortExpression="InvoiceCreationDate">
                        <FilterTemplate>
                            <telerik:RadDatePicker ID="RadDatePicker1" runat="server">
                            </telerik:RadDatePicker>
                        </FilterTemplate>
                    </telerik:GridDateTimeColumn>
                    <telerik:GridBoundColumn DataField="SupplierVatNumber" FilterControlAltText="Filter SupplierVatNumber column"
                        HeaderText="SupplierVatNumber" SortExpression="SupplierVatNumber" UniqueName="SupplierVatNumber">
                    </telerik:GridBoundColumn>
                </Columns>
                <ExpandCollapseColumn Visible="False">
                    <HeaderStyle Width="19px"></HeaderStyle>
                </ExpandCollapseColumn>
                <RowIndicatorColumn Visible="False">
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
        </telerik:RadGrid

>

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;

    public List<SapDocuments> GetSapDocumentsByUser(string userName)
    {
        using (EscalonamentoFacturasEntities spDocs = new EscalonamentoFacturasEntities())
        {
    
            //Não é permitido projecções select new...
            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();
    

My code behind is this:

 private void LoadData()
    {
        //Popular dados na Radlist

        SapDocumentsBO sapDocs = new SapDocumentsBO();
        this.SapDocuments = sapDocs.GetSapDocumentsByUser(Page.User.Identity.Name.Substring(Page.User.Identity.Name.IndexOf("\\")+1));

        RadGrid1.DataSource = this.SapDocuments;


    }

    protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        LoadData();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:37:57+00:00Added an answer on May 24, 2026 at 9:37 am

    Did you enable lazy loading on the object context? If not, relationships will always be null, and you would have to manually instantiate them using the Load() method on the associated reference. More on that here: http://msdn.microsoft.com/en-us/library/dd456846.aspx

    EDIT: Also, you could consider

    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
                                 select new
                                 {
                                     spDocs.SequentialNumber,
                                     Process = (spDocs.Staging != null) ? spDocs.Staging.Process : "",
                                     Priority = (spDocs.Priorities != null) ? spDocs.Priorites.Priority : ""
                                 };
    

    And return the result as IQueryable or IList. That would make it really easy to bind.

    Also, the RadGrid does support dot notation i believe like the following:

    <telerik:GridBoundColumn DataField="Priorities.Priority" HeaderText="Priority" ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.