Overriding ItemDataBound behavior on Grid Export

2 posts, 0 answers
  1. Rodney
    Rodney avatar
    54 posts
    Member since:
    Mar 2015

    Posted 25 Oct 2016 Link to this post

    I have a situation where I have some very long columns. In ItemDataBound I just substring the first 80 characters and put it in the item.text, and the full struing in the ToolTip. The problem is when I export to Excel I want to get the entire contents of the data item, not the truncated version that's in the cell. How can I avoid this It seems that in ItemDataBound I can't test on Exporting.

    The other option I've thought of is to somehow put the entire contents of the data item in the cell and maybe not have it wrap.

    What would be the recommended solution?



  2. Viktor Tachev
    Viktor Tachev avatar
    2469 posts

    Posted 28 Oct 2016 Link to this post

    Hello Rodney,

    In order to implement the behavior you can try the following approach. Keep the whole text in the cell in the Grid. Then add a custom CSS rule that would hide the unnecessary text. For that you can use the text-overflow property.

    Give the approach a try and let me know how it works for you.

    Viktor Tachev
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Back to Top