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

  • SEARCH
  • Home
  • 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 7661539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:36:42+00:00 2026-05-31T13:36:42+00:00

I use the following LINQ to create grid model: … var query = from

  • 0

I use the following LINQ to create grid model:

...
            var query = from a in GetUser()
                        select new UserModel
                        {
                            ID = a.ID,                            
                            StartDate = a.StartDate,
                            EndDate = a.EndDate,
                            StateName = a.State.StateName,
                            StateID = a.StateID,
                            City = a.City,
                        };
            return query;
  ....

and the HTML is

 @Html.Grid(Model.PagedList).Columns(
                        col =>
                        {
                            col.For(c => c.StateName).Named("State").Attributes(@class => "row").HeaderAttributes(@class => "head");
                            col.For(c => c.City).Named("City").Attributes(@class => "row").HeaderAttributes(@class => "head");
                            col.For(c => c.StartDate).Named("Start Date").Attributes(@class => "row").HeaderAttributes(@class => "head");
                            col.For(c => c.EndDate).Named("End Date").Attributes(@class => "row").HeaderAttributes(@class => "head");
                            col.For(c => Html.ActionLink("Details", "Details", new { id = c.ID })).Named("View Details").HeaderAttributes(@class => "head").DoNotEncode();
                        }).Sort(Model.GridSortOptions).Attributes(@class => "grid") 

The main problem is how to show only DATE without TIME part?

I tried some options but in some cases I got the errors and in other cases sorting AZ doesn’t work at all.

Any clue?
Thank you!!!

  • 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-31T13:36:43+00:00Added an answer on May 31, 2026 at 1:36 pm

    Try using

    col
    .For(c => c.EndDate.ToLongDateString())
    .Named("End Date")
    .Attributes(@class => "row")
    .HeaderAttributes(@class => "head");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using LINQ-to-Entities. Using the following query: var x = from u in context.Users
for example i use following command to find a record SELECT `users`.`mail` FROM `users`
I have the following LINQ query that returns two objects from my database. These
I am a LINQ newbie trying to use it to acheive the following: I
I would like to use following sql to avoid constructing sql dynamically: SELECT CommentID,
I use the following statement prepared and bound in ODBC: SELECT (CASE profile WHEN
I use the following code to create countdowns in Javascript. n is the number
I have the below LINQ method that I use to create the empty EmploymentPLan
I'm using Linq to XML to create a new XML file. Some part of
I use following code: Create a retry policy, when error, retry after 1 second,

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.