如何将ilist传递给(Devexpress)gridview,它驻留在(DevExpress)弹出控件中而不需要回调 [英] How to pass a ilist to (Devexpress)gridview which reside in (DevExpress)popup control without callback

查看:100
本文介绍了如何将ilist传递给(Devexpress)gridview,它驻留在(DevExpress)弹出控件中而不需要回调的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用devexpress工具。我有一个网格驻留在弹出控件中。这个gridview按顺序显示项目,所以我想将项目列表传递给popup中的局部视图gridview。这是我的代码请检查并提供解决方案,谢谢。

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.

//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()

推荐答案





正如你所使用的那样



//------->settings.CallbackRouteValues = new {Controller =供应,Action =ChangeOrderPricePartial};

// ------> Html.RenderPartial(ChangeOrderPricePartial,Model.StockList);

//------>settings.LoadContentViaCallback = LoadContentViaCallback.OnPageLoad;



这将调用你的行动,这是按照devexpress按需加载内容的概念。





如果只需按照以下简单步骤即可直接呈现内容:



1>删除

settings.CallbackRouteValues = new {Controller =Supply,Action =ChangeOrderPricePartial};

2>

settings.LoadContentViaCallback = LoadContentViaCallback.OnPageLoad;

3> ;直接将Grid代码粘贴在Set内容方法中,不调用任何局部视图。



执行此操作。

settings.SetContent(( )=;

{

//删除以下行。

Html.RenderPartial(ChangeOrderPricePartial,Model.StockList) ;





粘贴devExpress网格,直接在这个局部视图中存在。



例子



Html.DevExpress()。GridView(gridview =>

{} .bind(Model).gethtml();







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



});


这篇关于如何将ilist传递给(Devexpress)gridview,它驻留在(DevExpress)弹出控件中而不需要回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆