Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using devexpress tools in my application. I have grid reside in pop up control. this gridview display items in order , so i want to pass list of items to partial view gridview inside popup. here is my code please check and provide solution , thank you.
C#
//this is popuo control
@Html.DevExpress().PopupControl(settings => {
    settings.Name = "popupControlChangePrice";
    //settings.CloseAction = CloseAction.OuterMouseClick;
    settings.CallbackRouteValues = new { Controller = "Supply", Action = "ChangeOrderPricePartial"  };
    
    //settings.PopupVerticalAlign = PopupVerticalAlign.Middle ;
    //settings.PopupHorizontalAlign = PopupHorizontalAlign.Center;
    settings.ShowFooter = true;
    settings.AllowDragging = true;
    settings.EnableHotTrack = true;
    settings.Height = Unit.Pixel(400);
    settings.Width = Unit.Pixel(800);
    settings.LoadContentViaCallback = LoadContentViaCallback.OnPageLoad;
    settings.PopupElementID = "btnPriceEdit";
    settings.HeaderText = "Updatable content";
    settings.Modal = true;

    settings.SetContent(() =>
    {
//passing list to partial view of grid 
        Html.RenderPartial("ChangeOrderPricePartial", Model.StockList );
    });

    
}).GetHtml()
Posted

1 solution

Hi,

As u have used

//------->settings.CallbackRouteValues = new { Controller = "Supply", Action = "ChangeOrderPricePartial" };
//------> "Html.RenderPartial("ChangeOrderPricePartial", Model.StockList );"
//------>settings.LoadContentViaCallback = LoadContentViaCallback.OnPageLoad;

This will call ur action which is concept of loading the content on demand as per devexpress.


If u need the content directtly be rendered with out any call back then just follow this simple steps:

1>Remove
settings.CallbackRouteValues = new { Controller = "Supply", Action = "ChangeOrderPricePartial" };
2>
settings.LoadContentViaCallback = LoadContentViaCallback.OnPageLoad;
3>Directlly paste the Grid code with in Set content method with out calling any partial view.

Do this.
settings.SetContent(() =;
{
//Remove this below line.
Html.RenderPartial("ChangeOrderPricePartial", Model.StockList );


paste the devExpress grid which wass present in that partial view directlly here.

example

Html.DevExpress().GridView(gridview =>
{}.bind(Model).gethtml();



});
 
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