using regular mvc Component in the panel

  1. #1

    using regular mvc Component in the panel

    Hello
    i know a panel accept only Ext.net.AbstractComponent as Item but is there a way to using Regular mvc Component like Html.EditorFor or telerik component as Item in ItemsPanel?
  2. #2
    Hello @orpheus!

    Use .Content() instead of .Items() and watch out for layout issues -- the components' layout may be compromised once you use arbitrary HTML within a component/container, just because it does not know what to expect, nor knows how to communicate with whatever is within.

    One possible way to avoid layout issues is to give the container a fixed width/height, but it should be handled case by case, you should try it and then fix as issues arise, it will greatly depend on what you're using inside.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello @fabricio.murta
    thanks for replay but when i used this Way(using .Content() instead of .Items() ) with this code
     X.FormPanel()
          .ID("FormPanel1")
          .RTL(true)
          .Title("Update ")
          .Frame(true)
          .RTL(true)
          .Cls("panelTitle winTitle")
          .BodyPadding(10)
         .Content(Html.EditorFor(x=>x.Title))
    the following exception was thrown
    cannot convert from 'System.Web.Mvc.MvcHtmlString' to 'System.Func<object, object>'
    also i tried
    
      .Content(@<text>
                      @(Html.EditorFor(x => x.Title))
                </text>)
    but modelBinding did not work properly and title (x => x.Title) Could not add to Model
    Last edited by orpheus; Feb 12, 2019 at 2:02 PM.

Similar Threads

  1. [CLOSED] Component Column Renderer from CodeBehind In mvc
    By matrixwebtech in forum 2.x Premium Help
    Replies: 7
    Last Post: Nov 27, 2014, 5:47 AM
  2. Component Loader using MVC [Razor] error
    By dangerlinto in forum 2.x Help
    Replies: 2
    Last Post: Jan 21, 2014, 2:48 PM
  3. Replies: 2
    Last Post: Nov 20, 2013, 6:49 PM
  4. [CLOSED] [MVC] Use Devexpress component inside Ext.Net
    By Tactem in forum 2.x Premium Help
    Replies: 3
    Last Post: Aug 21, 2013, 1:09 PM
  5. [CLOSED] MVC Grid Component Column
    By adelaney in forum 2.x Premium Help
    Replies: 4
    Last Post: May 11, 2012, 9:00 PM

Posting Permissions