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 8174419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:27:11+00:00 2026-06-06T22:27:11+00:00

my code is too long so sorry :) @model IEnumerable<Osos11.Models.Customers> @Html.DevExpress().GridView( settings => {

  • 0

my code is too long so sorry 🙂

@model IEnumerable<Osos11.Models.Customers>
@Html.DevExpress().GridView(
settings =>
{
    settings.Name = "gvEditing";
    settings.KeyFieldName = "sno";
    settings.CallbackRouteValues = new { Controller = "Customer", Action = "EditingPartial" };
    settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);

    settings.Columns.Add(column =>
    {
        column.Caption = "#";
        column.SetDataItemTemplateContent(c =>
        {
            ViewContext.Writer.Write(
                Html.ActionLink("Edit", "EditingEdit", new { sno = DataBinder.Eval(c.DataItem, "sno") }) + "&nbsp;" +
                Html.ActionLink("Delete", "EditingDelete", new { sno = DataBinder.Eval(c.DataItem, "sno") },
                    new { onclick = "return confirm('Do you really want to delete this record?')" })
            );
        });
        column.SetHeaderTemplateContent(c =>
        {
            ViewContext.Writer.Write(
                Html.ActionLink("New", "EditingEdit", new { sno = -1 }).ToHtmlString()
            );
        });
        column.Settings.AllowDragDrop = DefaultBoolean.False;
        column.Settings.AllowSort = DefaultBoolean.False;
        column.Width = 70;
    });
    settings.Columns.Add("Name");
    //settings.Columns.Add(column =>
    //{
    //    column.FieldName = "CategoryID";
    //    column.Caption = "Category";

    //    column.ColumnType = MVCxGridViewColumnType.ComboBox;
    //    var comboBoxProperties = column.PropertiesEdit as ComboBoxProperties;
    //    comboBoxProperties.DataSource = NorthwindDataProvider.GetCategories();
    //    comboBoxProperties.TextField = "CategoryName";
    //    comboBoxProperties.ValueField = "CategoryID";
    //    comboBoxProperties.ValueType = typeof(int);
    //});
    settings.Columns.Add("CustomerNumber");
    //settings.Columns.Add("UnitPrice").PropertiesEdit.DisplayFormatString = "c";
    //settings.Columns.Add("UnitsInStock");
    //settings.Columns.Add("Discontinued", MVCxGridViewColumnType.CheckBox);

    settings.ClientLayout = (s, e) =>
    {
        if (e.LayoutMode == ClientLayoutMode.Loading)
        {
            if (Session["GridState"] != null)
                e.LayoutData = (string)Session["GridState"];
        }
        else
            Session["GridState"] = e.LayoutData;
    };
    settings.PreRender = (s, e) =>
    {
        if (ViewData["VisibleID"] == null) return;

        ASPxGridView grid = (ASPxGridView)s;
        grid.MakeRowVisible(ViewData["VisibleID"]);
    };
}).Bind(Model).GetHtml()

I got this error

Compiler Error Message: CS1660: Cannot convert lambda expression to type 'DevExpress.Web.Mvc.GridViewSettings' because it is not a delegate type
  • 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-06-06T22:27:14+00:00Added an answer on June 6, 2026 at 10:27 pm

    It seems that this issue is caused by the fact that any expression in the GridView’s definition is not valid.
    As a result, the entire GridView’s definition (lambda expression) cannot be recognized by the View Engine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i've been creating functions for too long without taking my code to 'classes'. I
First of all, sorry for the too long question. I know that there are
First of all forgive me, but the code was too long and copied from
First time poster so sorry if this is too long, but I've hit a
Sorry if this is too obvious but I’ve been too long on it and
Been looking at this code for too long and I am getting gloomy any
First off - sorry for the wall of code but it's not too horrendous,
I am sorry if the post is too long, but I would be happy
Is there any replacement for z-index? My code is too long, thus I will
In Antlrworks I get this error: [18:21:03] Checking Grammar Grammar.g... [18:21:26] Grammar.java:12: code too

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.