Click here to Skip to main content
15,905,867 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a GridMvc.Html in my web app.

My Requirement On Click of the Paging\Sorting functionality I want it to hit HTTPPOST Action Method.

Currently it hits only HTTPGET.

I have tried using jQuery, it doesn't work and I am not sure on it too.

This is my Grid in the View
@Html.Grid(Model.SignalDataList).Columns(columns =>
{
    columns.Add(s => s.SignalName).Titled("Name");
    columns.Add(s => s.TimeReceived).Titled("Time Received").Filterable(true);
    columns.Add(s => s.Value).Titled("Value").Filterable(true);

}).WithPaging(10).Sortable(true)


Each click on page goes to HTTPGet. SO the data I have selected\filtered via DropDown cannot be handled

public ActionResult AlarmSignalData()
    {
        SignalDataRepository signalDb = new SignalDataRepository();
        ...
        try
        {
           GetData();
        }
        catch(Exception ex) { return View("Error", new HandleErrorInfo(ex, "SignalData", "AlarmSignalData")); }
        return View(signalDataView);
    }


But I want it to hit HttpPost , coz I want to process selected data in trextbox\DropDownlist in my View So in HttpPost I pass my model, from Where I can take the TextBox\DropdownList values to fetch filtered data

[HttpPost]
public ActionResult AlarmSignalData(Model model)
    {
        SignalDataRepository signalDb = new SignalDataRepository();
        ...
        try
        {
           GetData(model.SelectSignal,model.FromDate,model,ToData);
        }
        catch(Exception ex) { return View("Error", new HandleErrorInfo(ex, "SignalData", "AlarmSignalData")); }
        return View(signalDataView);
    }


What I have tried:

I have tried using jQuery, to handle via on click of the div which contains the Grid MVC it doesn't work and I am not sure on it too.
Posted
Updated 3-Sep-17 2:23am
Comments
Graeme_Grant 29-Aug-17 20:59pm    
This is a 3rd-party control [Grid.Mvc][^]. Have you contacted the author?
jeAntoni 30-Aug-17 19:57pm    
Thanks. I just did it - created the discussion
Graeme_Grant 30-Aug-17 20:03pm    
The control was last updated 4 years ago - so I don't know if you will have much luck. If he does not reply, you are left with two choices:
1. Download the source code and maintain the library yourself;
2. Abandon ASAP an already abandoned project and find another that is well maintained and supported.

Also, as a side-note, CodePlex is closing: "In October, we’ll set CodePlex to read-only, before shutting it down completely on December 15th, 2017". So if you want to continue using this library, it is highly advisable to download the source code BEFORE it disappears for good!
jeAntoni 3-Sep-17 2:57am    
Thanks lot for the alert - very helpful.
As you said I see no replies on my Question.

And if possible can you please suggest me a best grid to use in my MVC app (free downloadable).

1 solution

Quote:
if possible can you please suggest me a best grid to use in my MVC app (free downloadable).


Sure... If you can qualify for the Syncfusion Community License[^], then you can get a free commercial-grade Grid[^] plus so much more! ;)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900