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

Listbox - Item Actionlink

It is possible to create an actionlink for an item in a databound Listbox? I use the following code:

    @{
        
        Html.MobSyncfusion().ListBox("lbDatabinding").Title("DataBinding").RequestMapper("lbdatabindingreq").ActionMode(ActionMode.Server)
        .RenderMode(RenderMode.Auto)
        .OnItemSelect("LbOnItemSelect")
         .BindDataSource(Model, map =>
         {
             map.MapTo<ILDispo2.Entities.ildispo_FahrAufträge>(binding =>
             {
                 binding.ItemDataBound((item, nd) =>
                 {
                     item.Text = nd.FahrAuftragNr;
                     item.PrimaryKeyValue = nd.FahrAuftragNr;    
                     //ActionLink ???              
                 });
                 
             });
 
         })
 
         .Render();
        
        }


2 Replies

FW Frank Wachsmuth May 13, 2013 07:05 PM UTC

i want to create a separate actionlink for each item in the listbox. Is this possible?


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

Hi Frank,

Thanks for using our Syncfusion Mobile product.

Yes, it’s possible to provide actionlink in each list items using ‘Html’ property. In which you can render the Actionlink control with client sire rendering. Please refer the below code snippets.

[View]

@Html.MobSyncfusion().ListBox("Incidents").RenderMode(RenderMode.Auto).IOS(c => c.ShowCorners(false)).BindDataSource(Model, map =>
{
    map.MapTo<MobileMVCWeb.Controllers.Products>(binding =>
    {
        binding.ItemDataBound((item, nd) =>
        {
            item.PrimaryKeyValue = nd.PrimaryKey;
            item.Html = nd.Title +
"<br/>" + "<a rel='nofollow' href='Home/Views' data-role='sf-m-actionlink' type='button'>Link</a>";
        });
    });
})

Also we have created sample for the same, you can find the sample in below attachment.

Listbox.zip

Please try this sample and let us know if it helps out.

Regards,
Thivya.


Loader.
Live Chat Icon For mobile
Up arrow icon