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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:11:18+00:00 2026-06-01T02:11:18+00:00

I have a grid that is dynamically generated based on search criteria. I render

  • 0

I have a grid that is dynamically generated based on search criteria. I render the grid in a partial view using Ajax. That all works fine.

I now need to add a checkbox column as the first column.

Also, how do I get filtering, sorting paging etc. to work now since it is in a partial view.
When i click on a header to sort I get a Page not found error and the filter Icon doesnt do anything.

And one more thing. When I try to add a GridCommandColumnSettings to the grid I get the error
“Invalid initializer member declarator”

Code is below for the gridcolumnsettings

    public GridColumnSettings[] NewColumns(DataTable fullDT)
    {
        GridColumnSettings[] newColumns = new GridColumnSettings[fullDT.Columns.Count];

        for (int i = 0; i < fullDT.Columns.Count; i++)
        {
            // set the visibility property for the DeliveryID
            bool boolDeliveryID;
            if (fullDT.Columns[i].ColumnName == "DeliveryID")
                boolDeliveryID = false;
            else
                boolDeliveryID = true;

            newColumns[i] = new GridColumnSettings
            {
                new GridCommandColumnSettings
                {
                    Commands = 
                    {
                        new GridEditActionCommand(),
                        new GridDeleteActionCommand()
                    },
                    Width = "200px",
                    Title = "Commands"
                },
                Member = fullDT.Columns[i].ColumnName,
                Title = fullDT.Columns[i].ColumnName,
                Visible = boolDeliveryID,
                Filterable = true,
                Sortable = true
            };
        }
        return newColumns;
    }

Any suggestions would be appreciated.

Thanks

I edited my post to add my partial for the Grid

Here is my partial for the grid

@(Html.Telerik().Grid<System.Data.DataRow>(Model.Data.Rows.Cast<System.Data.DataRow>())
.Name("Grid")
.Columns(columns =>
{
    columns.LoadSettings(Model.Columns as IEnumerable<GridColumnSettings>);
})
.DataBinding(dataBinding =>       dataBinding.Ajax().Select("_DeliveryManagerCustomBinding", "Deliveries"))
.EnableCustomBinding(true)
 .Resizable(resize => resize.Columns(true))

)

  • 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-01T02:11:20+00:00Added an answer on June 1, 2026 at 2:11 am

    I don’t add columns this way when I use the Telerik Grid control, but looking at what you’re doing I would hazard a guess to say you will need to do something like the following:

    increase the size of the newColumns array by 1 (because we’re going to add in the checkbox column):

    GridColumnSettings[] newColumns = new GridColumnSettings[fullDT.Columns.Count + 1];
    

    if you want it at the beginning you will need to do the following before your for-loop:

    GridColumnSettings s = new GridColumnSettings() {
      ClientTemplate("<input type=\"checkbox\"  name=\"checkeditems\" value=\"some value\" />")
      Title("title goes in here")
    };
    

    Then you will add it into your array:

    newColumns[0] = s;
    

    and then increase the start index for your for-loop to 1:

    for (int i = 1; i < fullDT.Columns.Count; i++)
    

    the checkbox column will go at the beginning

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

Sidebar

Related Questions

I have a parent grid that contains multiple row definitions, all of which have
I have a grid view that has two simple columns, a report number and
I have used a list view that uses a grid view in WPF. I
I have ToggleButtons that are dynamically created based on my datasource. I would like
I have a jQuery AJAX data grid that loads a list of elements from
I have a grid view which is populated using a custom ImageAdapter class extending
I have a grid whose rows need to be resized dynamically based on the
I have a grid that I dynamically need to resize in the number of
I have a grid view in web user control and I'm dynamically adding the
I have a grid that has multiple rows. I want to hide/show one of

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.