2011-09-08 115 views
0

我想在每個組中有2個組和gridview的導航欄。 我的GridView的是局部視圖在NavBar Devexpress mvc gridview

我使用它們像這樣:

Html.RenderPartial("ManagersGridPartial", Model) 

的問題,我不能在group.Items添加局部視圖

@Html.DevExpress().NavBar(settings => 
    { 
     settings.Name = "managersNavBar"; 
     settings.AutoCollapse = false; 
     settings.ExpandButtonPosition = ExpandButtonPosition.Right; 
     settings.SkinID = "None"; 
     settings.Width = Unit.Percentage(98); 
     settings.Styles.Item.Paddings.Padding = 0; 


     settings.Groups.Add(group => 
     { 
      group.Text = "First group"; 
      group.Items.Add("aaaaaaaasssssdddddd"); 
     }); 
     settings.Groups.Add(group => 
     { 
      group.Text = "Second group"; 

      group.Items.Add("asdasdasd"); 
     }); 


    }).GetHtml() 

回答

2

,可以指定特定項目的通過以下方式通過MVCxNavBarItem.SetTemplateContent方法:

settings.Groups.Add(group => { 
    group.Text = "First Group"; 

    group.Items.Add(item => { 
     item.SetTemplateContent(c => { 
      Html.Partial("ManagersGridPartial", Model); 
     }); 
    }); 
});