Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Hii,

I am creating grid view in application using dev express. I have created partial view for grid according to demo application of dev express. I have binded grid successfully but I stucked in problem. How can I pass parameter in java script function from grid view (partial view). my code is like that:
   

settings.HtmlRowPrepared = (s, e) =>
        {
            MVCxGridView g = s as MVCxGridView;

            index = g.PageIndex;

            //settings.ClientSideEvents

            pageCount = g.SettingsPager.PageSize;

            //pageCount = g.PageCount;
        };
and 
I am calling function :

[C#]
settings.ClientSideEvents.EndCallback = "Micrograph";

This function I have declared on main view.
But I am unable to access parameter "index" and "pageCount" in method of micrograph.

 function Micrograph() {
var currentIndex= index;
var totalRow= pageCount;
}

Please help me I couldn't get value of index and pageCount. 
Thanks in advance.


What I have tried:

settings.HtmlRowPrepared = (s, e) =>
{
MVCxGridView g = s as MVCxGridView;

index = g.PageIndex;

//settings.ClientSideEvents

pageCount = g.SettingsPager.PageSize;

//pageCount = g.PageCount;
}; for this I have tried custom js properties of dev express:

settings.CustomJSProperties = (sender, e) =>
{
var gridview = sender as MVCxGridView;

gridview.JSProperties["cpCurrentVal"] = index;


gridview.JSProperties["cpPageSize"] = pageCount;

};
but I didn't get value in javascript function on main view.
Posted
Updated 28-Nov-16 18:13pm

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