Attaching custom event to DataBound Library Event

2 posts, 0 answers
  1. Dan
    Dan avatar
    12 posts
    Member since:
    Feb 2016

    Posted 31 Aug 2016 Link to this post


    I want to implement some custom functionality for the grid: adding column sort orders to the column header and aligning them (along with the sort arrow) to the left.


    From the code you can see that I'm doing this one the dataBound event. I don't want to have to put this code into every single grid I have.

    Is there anyway to easily add this code to the kendo library so that it is called before the grid's individual dataBound function is called?

    Thank you,

  2. Stephen
    Stephen avatar
    90 posts
    Member since:
    Jan 2011

    Posted 01 Sep 2016 in reply to Dan Link to this post

    Maybe create a custom Grid that derives from the Kendo Grid?


    Check out the "MyGrid" implementation here: for an rough implementation.

    Note how I had to make the jquery selectors more specific using .find()(to just find elements within the "current" grid) so that you can have more than 1 grid on the page without clicking 1 header affecting all the other grids as well.

    Then you get use $("#grid").kendoMyGrid() instead of $("#grid").kendoGrid() when you init your grids.





Back to Top