Generate the grid name

2 posts, 0 answers
  1. Farid
    Farid avatar
    3 posts
    Member since:
    May 2013

    Posted 18 Jun 2013 Link to this post

    Hello,

    I have a grid detail , i want to generate the name of the grid with a date .  How can i generate the name of the grid like this : 
    "#= kendo.toString(Timestamp,  'dd_MM_yyyy_hh_mm_ss') #"

    Thanks
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2194 posts

    Posted 20 Jun 2013 Link to this post

    Hi Farid,

     
    Basically using function to generate the Grid name is not supported out-of-the-box and you should implement this functionality using custom code. For example you can generate the Grid name using global variable which to contain the already formatted date:

    <script type="text/javascript">
        var date = new Date();
        var format = 'dd_mm_yyyy';
        date = kendo.toString(date, format);
    </script>
    <script type="text/kendo" id="OrderDetailsTemplate">
      @(Html.Kendo().Grid<OrderDetailViewModel>()
            .Name("OrderDetails_#=date#")
    Kind Regards,
    Vladimir Iliev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top