Kendo grid custom command
Sign in Email. Forgot your password? Ask a Question. Custom command in kendo UI grid.
While working with Kendo Grid in MVC, many times we come across a requirement when we want to have some images instead of default buttons of the grid. I had a similar kind of requirement and as I was new to Kendo, it took me a lot of time to implement the same. After doing a lot of search and trying various methods for achieving the same, finally I got a perfect way to achieve this. I decided to write a post for this so that it can save time for others working with Kendo. Below, I am going to explain how to add a delete image in my grid which will act as delete button of the grid. So we can see in the above example MyData is the class my grid is based on.
Kendo grid custom command
While trying to display a list of data in a Kendo UI grid for which the data was loaded via Ajax, I wanted to have a custom command that loaded a new page to edit a row. The project I was working on used ASP. The key to loading a new page was inserting a clickable link that could call a controller action and pass in the ID of the row to edit. To keep things consistent, I also wanted my link to look like a normal Kendo UI grid edit button. While I could find examples of how to include custom links when a Kendo Grid was server bound, finding out how to do the same things for an Ajax bound grid was more difficult. In the end I found that specifying a column template like this worked:. Note that the first argument to the Html. ActionLink call is usually used to give the text of the link but I also included a span in order to add the correct Kendo CSS classes to make the link look like a button with an edit icon. The result of the above client template for a column in a Kendo grid is that an edit button like the following is displayed:. Hey man! That was great!
Hey man!
.
All Telerik. Now enhanced with:. Represents the command columns of the Grid. For more information and examples, refer to the Command Column Directives article. Indicates whether the column will be resized during initialization so that it fits its header and row content. Sets the custom CSS classes to the column cells. Under the hood, to apply the property, the class option uses the NgClass directive. See example.
Kendo grid custom command
All Telerik. Now enhanced with:. The configuration of the column command s. If set the column would display a button for every command.
Husky work lights
Delete column which will be showing an image, will be a column of Kendo grid which will act like a command button which performs delete action. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Width ;. Submit your solution. ClientTemplate Html. Your email address will not be published. Layout: fixed fluid. While I could find examples of how to include custom links when a Kendo Grid was server bound, finding out how to do the same things for an Ajax bound grid was more difficult. So we can see in the above example MyData is the class my grid is based on. After some trial and error I got a bootstrap dropdown menu working in a Kendo grid using code.
All Telerik. Now enhanced with:. You can add new records or edit row data by using an external modal dialog or another container specifically designed for this purpose.
Shivani Jha Rate me:. That was great! We can have an onclick event for this image where we can implement the functionality we want for our custom button. Custom paging in Kendo grid in MVC. Orientation MenuOrientation. Please Sign up or sign in to vote. While I could find examples of how to include custom links when a Kendo Grid was server bound, finding out how to do the same things for an Ajax bound grid was more difficult. Web01 2. Layout: fixed fluid. For example: HTML. To keep things consistent, I also wanted my link to look like a normal Kendo UI grid edit button. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
Your phrase is brilliant
Rather, rather
Thanks for the help in this question. All ingenious is simple.