show icon in grid cell while editing record

1 Answer 395 Views
Grid
sandy
Top achievements
Rank 1
Iron
Veteran
sandy asked on 14 Sep 2021, 12:07 PM

Hi,

i have kendo grid with records with in cell edit mode ( few columns as integer values).

so when i am editing records and when i clicked on particular cell ( integer value ), based on that cell value i want to display a history icon in that cell.

so by using that history icon i want to display that record history in modal popup.

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 17 Sep 2021, 07:56 AM

Hi S,

 

Thank you for writing to us.

This requirement is possible to achieve by using a custom command button for each row as demonstrated in this live sample:
https://demos.telerik.com/aspnet-mvc/grid/custom-command

If you want to show it inside the numerictextbox, however, it will require more complex CSS implementation.

Let me know what your thoughts are and which direction you want to continue to.

 

Regards,
Eyup
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

sandy
Top achievements
Rank 1
Iron
Veteran
commented on 23 Sep 2021, 02:49 PM

Hi ,

The solution is not suitable for me.

please find above image. in above image for first record there is a history image is there.  for second row there is no history image.

so here is my requirement.

when i click that history icon i want to  pass resource name, dept, project, charge description to action and get history values for that  record. and i want to display those history values in grid in model pop up.

 

below is my code.

                                                   

 columns.Bound(p => p.HoursYTD).Width(70).Filterable(false).Editable("function() {return false;}").ClientFooterTemplate("#=kendo.toString(sum, '0,0')#").HtmlAttributes(new { style = "font-weight: bold; text-align: center;" })
                                                    .HeaderHtmlAttributes(new { style = "white-space: normal; text-align: center;font-weight: bold;" }).

                                                    ClientTemplate("#= DisplayImage(data) #");

 

<script>
    function DisplayImage(product) {
        //alert(product.IsHistory);
        //alert(product.HoursYTD);
    //var action = '@Url.Action("ProductDetails", "Product")';
        if (product.IsHistory=="Yes")
            var html = kendo.format(product.HoursYTD +"<img src='/Images/" + product.IsHistory + ".png' height='22' width='22'  onclick='myHandler(event)'");
        else
            var html = kendo.format("<div>"+product.HoursYTD+"</div>");

    return html;
}
</script>

 

Eyup
Telerik team
commented on 28 Sep 2021, 08:51 AM


Tags
Grid
Asked by
sandy
Top achievements
Rank 1
Iron
Veteran
Answers by
Eyup
Telerik team
Share this question
or