Telerik Forums
UI for ASP.NET MVC Forum
3 answers
274 views
Hi, I looking for an example to display a list of products information in mvc grid together with the barcode. is it possible?

@(Html.Kendo().Grid<Example.Models.ProductViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.ProductName).Width(140);
columns.Bound(c => c.ProductCode).Width(190);
 <----this column should display barcode generated using Product code, ---->
@(Html.Kendo().Barcode().Name("barcode").Value(c => c.ProductCode).Encoding(BarcodeSymbology.Code39).Width(200).Height(100))
   

})
.HtmlAttributes(new { style = "height: 380px;" })
.Scrollable()
.Groupable()
.Sortable()
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Products_Read", "Grid"))
)
)


Regards
cwk
Viktor Tachev
Telerik team
 answered on 08 Aug 2017
3 answers
169 views

I have a Barcode that is within a partial view.  If I do not include a width and height at the beginning I get an error when rendering.

@Html.Kendo().Barcode().Name("barcode-" + Guid.NewGuid().ToString()).Value(@Model.WidgetTagValue).Encoding(Model.barcode_symbology).Width(150).Height(150)

I have a resize event that tries to change it to fit the size of the parent div on page init and on window resize.

function setBarcodeSize() {
        if ($('.k-barcode').length > 0) {
            $('.k-barcode').each(function () {
                var parentDivWidth = $(this).closest(".andon-widget-container").width() - 50;
                var parentDivHeight = $(this).closest(".andon-widget-container").height() - $(this).closest(".andon-widget-container").find(".andon-widget-title").height();
                $(this).css("width", $(this).width(parentDivWidth) + "px").css("height", $(this).height(parentDivHeight) + "px");
                $(this).data("kendoBarcode").redraw();
            });
        }
    }

The width and height of the k-barcode <div> are set appropriately but the size of the child <div> with the data-role="surface" remains at 150x150

 

Advice?

Stamo Gochev
Telerik team
 answered on 08 Jun 2017
1 answer
34 views

Does Telerik have the ability to generate a IMB(OneCode) bar code?

 

I ask since I saw an option for the POSTNET barcode which was retired from the USPS in 2013.

 

Please advise.

Viktor Tachev
Telerik team
 answered on 23 Jun 2016
2 answers
113 views

Hi

Please sir, i have add barcode in my view and it works as code:

 

@(Html.Kendo().Barcode()
    .Name("manchego")
    .Value("2346722")
    .Encoding(BarcodeSymbology.EAN8)
    .Width(200)
    .Height(100)
)

now i need to pass value to barcode from EmployeeViewModel for each employee to let me view them in my page as example :

   <ul id="dairy">
            <li>
@* here pass value for employee 1 *@
@(Html.Kendo().Barcode().Name("manchego").Value("2346722").Encoding(BarcodeSymbology.EAN8).Width(200).Height(100))
            </li>
            <li>
@* here pass value for employee 2 *@
@(Html.Kendo().Barcode().Name("mascarpone").Value("Mascarpone").Encoding(BarcodeSymbology.Code128).Width(200).Height(100))
            </li>
            <li>
@* here pass value for employee 3 *@
@(Html.Kendo().Barcode().Name("gudbrands").Value("CHEESE").Encoding(BarcodeSymbology.Code39).Width(200).Height(100))
            </li>
        </ul>

and ect ..... for any other employee

 so please how can i do that ?

Ahmed
Top achievements
Rank 2
 answered on 15 Apr 2015
1 answer
88 views
How would you change the barcode encoding at runtime if the barcode widget is used in a template?
To clarify, user selects barcode type from a dropdown list, according to selection the barcode changes.
The barcode widget is used in a listview as a template.
For example, in the listView -
@(Html.Kendo().ListView()
    .Name("listView')
    .ClientTemplateId("aTemplate")
    :
    :
)

<script type="text/x-kendo-tmpl" id="aTemplate">
        <div class="product">
            <h3>#:ProductTitle#</h3>           
            @(Html.Kendo().Barcode()
                .Name("Id_#=Id#")
                .Value("#=Barcode#")
                .Encoding(BarcodeSymbology.Code128)       <-- how whould you change this at runtime?
                .Height(50)
                .Width(180)               
                .ToClientTemplate()
            )       
         </div>
 </script>

Regards,
Menashay
Alexander Popov
Telerik team
 answered on 24 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?