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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:46:50+00:00 2026-05-30T01:46:50+00:00

I am using jqgrid on EF4 MVC3 (C#). I based search on this @Oleg

  • 0

I am using jqgrid on EF4 MVC3 (C#). I based search on this @Oleg ‘s solution, which works fine and fits for my needs.

I have the following columns defined in my grid:

          ...
          { name: 'Stato', index: 'StatoTicketID', width: 20, align: 'left', sorttype: 'int', searchoptions: { sopt: ['eq']} },
          { name: 'StatoTicketID', index: 'StatoTicketID', width: 20, align: 'left', sorttype: 'int', hidden: true, searchoptions: { sopt: ['eq']} },
          ...

As you can see, the column Stato is ordered by the index StatoTicketID (hidden integer field) and ordering works fine.

PROBLEM

When I try to search a value of Stato, the filter is passed on index StatoTicketID as string, while I’d like to search by Stato values. So I get an exception inside the controller which specifies that I cannot convert String type to Int32.

Does exist a way to specify on which column apply search, when index is on a different column, like in my case?

EDIT & WORKAROUND:
For now I solved my problem with the following workaround.

        (inside foreach (Rule rule in rules) of FilterObjectSet by Oleg)
         ....

         if (rule.field == "StatoTicketID")
            {
                rule.field = "StatoTicket.Stato";
                propertyInfo = typeof(T).GetProperty("stringfield"); // where stringfield is a text type column of my model
            }

I realize very well that is not an elegant solution, I expect a kind response by you, to know how to implement the required behaviour directly from jqGrid, please.

Thanks in advance

  • 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-30T01:46:50+00:00Added an answer on May 30, 2026 at 1:46 am

    It seems to me that you chosen too complex way. I would just send to the client (to the jqGrid) only the Stato and have to StatoTicketID at all. From the design point of your the StatoTicketID is the part of the server implementation and the client should not depend from this.

    If you have Unique Constrain (or unique index) on Stato column of the StatoTickets table you would very quickly find the StatoTicketID whenever you as need. So the jqGrid can contain and “know” only about Stato and have no information about the StatoTicketID as the implementation detail.

    One more way to solve the problem is the usage of formatter: 'select' in the column Stato. It’s important to understand that in the case the mapping between Stato text and the StatoTicketID should be loaded before the grid is created. In the case the Stato column should have the properties like

    formatter: 'select', edittype: 'select', editoptions: {value: '12:Stato1;24:Stato2'},
    stype: 'select', searchoptions: {value: ':All;12:Stato1;24:Stato2'}
    

    One can’t use dataUrl in the case instead of value in the editoptions.

    As the result you will be able to fill column Stato with the StatoTicketID data, but the corresponding texts will displayed by jqGrid.

    I recommend you better to implement the first way with pure Stato text. All the problems you would be able to solve only on the server part.

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

Sidebar

Related Questions

I have a asp.net webforms page in which I'm using the jqGrid component. The
I am having trouble constructing a jqGrid TreeGrid using local data. This method works
I have a project in ASP.NET MVC1 using VB.NET controlers and JqGrid. it works
I am using JQGrid in my solution in which i load tabs dynamically, but
I am using jqgrid 3.8. I have a grid which is having some editable
i am using jqgrid treeview and i am passing back json response which works
This is the first time I'm using jqgrid. I have confused in how to
Greetings, I have a problem using jqgrid and jquery tab (I am coding in
I am using jqgrid and have simple searching enabled. I am wondering if there
I am using jqGrid with ui.multiselect.js for column choosing and reordering. The dialog which

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.