We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

item.Html and item.ImageUrl in Orubase list Box didn't worked together

I'm working on Orubase Syncfusion , and I used list box tool 
I want to add in the list item: multiple line text and image and align content to the right , when I use 
item.text , I cant assign to it a style and cant display multiple line but image in ImageUrl  shown 
and when I use item.html I can do what I need but the image in ImageUrl  not displayed 
so, where is the problem please 
thanks again and again 

Yara


7 Replies

TH Thivya Syncfusion Team June 14, 2013 06:54 AM UTC

Hi Yara,

Thanks for your interest in Orubase product.

If you want to make the content to appear in multiline then you should use ItemTemplate property, but while using this feature you should define all other things like text, image along with this. You cannot make text, image to appear by means of Text and Image property. Please refer the below sample code snippet.

@Html.Orubase().ListBox("lbCore").IOS(ios => ios.ShowCorners(true)).Items(items =>
{
    items.Add().ItemTemplate(@<a><h3>
         
Airplane</h3>
         
The content for Airplane feature.<img src="../../images/airplane.png" class="sf-image"/></a>);   
    […]
})

We have also created sample for your reference. You can find it in the below attachment.

ListboxDemo

Please try this and let us know if you have any queries.

Regards,
Thivya.



YA Yara June 14, 2013 11:20 PM UTC

Thank you very much for your response

I apply item template in my project  it gave me the errors in loading

I pass model object from controller to view and write the following

 

@Html.Orubase().ListBox("list").OnItemSelect("OnSelect").RenderMode(RenderMode.Auto).IOS(c => c.ShowCorners(false)).BindDataSource(Model, map =>

{

    map.MapTo<Class1>(binding =>

    {

        binding.ItemDataBound((item, nd) =>

        {

items.Add().ItemTemplate(@<a><h3>

            nd.data</h3>

            nd.Detail<img src=nd.ImUrl/></a>);

 

         

      

        });

    });

})

Can you help me please

Thanks again

 

Yara



TH Thivya Syncfusion Team June 17, 2013 04:14 AM UTC

Hi Yara,

Could you please let us know what error you are facing so that we could find out the cause of the issue. The information you provide will be great helpful for us to assist you further.

Regards,
Thivya.


YA Yara June 17, 2013 11:49 AM UTC

Thank you very much for your response
ok, I pass model object from controller to view in asp.net mvc , this object include many data and image url to be displayed in list box, data will be displayed in multiple line,
as I told you I tried item.Html and item.ImageUrl  it didn't worked together
your previous reply to use item.ItemTemplate it did't gave me any compiler error but when run the application it gave me loadinig page error
now , 
how I can display my data and image on list item please
thanks again
Yara


TH Thivya Syncfusion Team June 18, 2013 05:59 AM UTC

Hi Yara,

While using Databinding, you cannot use ItemTemplate property to show the content with multiple line. Instead of that you can use Html property. Please refer the below code snippets.

//View Page
@{

    Html.Orubase().ListBox("list").IOS(c => c.ShowCorners(false))
        .BindDataSource(Model, map =>
         {
             map.MapTo<Products>(binding =>
             {
                 binding.ItemDataBound((item, nd) =>
                 {
                     item.Html = "<div class='first'>" + nd.Text + "<div class='second'>" + nd.Content + "<img class='sf-image' src =" + nd.ImageUrl + "></img";  
                 });
             });
         }).Render();

}

We have also created sample for your reference. Please refer the sample in the below attachment.

ListboxDataBinding

You can try this sample and please let us know if you need any further assistance.

Regards,
Thivya.



YA Yara June 24, 2013 01:34 PM UTC

thank you very much for your response

Rana


TH Thivya Syncfusion Team June 25, 2013 04:21 AM UTC

Hi Rana,

We are glad to help you out. Please feel free to get in touch with us if you require any further clarifications.

Regards,
Thivya.



Loader.
Live Chat Icon For mobile
Up arrow icon