.HtmlAttributes is available to columns, but not to elements such as commands.
columns.Add().Command(command => {
command.CreateChild();
command.Edit();
command.Destroy();
command.Custom().Name("custom").Text("Details").Click("cmdDetails");
command.Custom().Name("change").Text("Change Control").Click("cmdChangeControl");
});
Should work the same as other elements/components and allow:
command.Edit().HtmlAttributes(new { type = "button", @class = "btn btn-primary" }); <- from grid.
Hi, Eric,
I agree with you that it would have been better to have the column definitions be identical, however I believe it will not be fulfilled to avoid breaking changes.
On the other hand, the HtmlAttributes are definitely a cool addition that we should have so thank you for suggesting it.
Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Thank you Alex. That's a lot of overhead and there are probably other better ways but I can see that working out as well.
.Template("#=isitcompleted(data)#") is functional and less compute for style, or override it is either the databound or document ready phases.
I really like the treelist component but it seems like it doesn't have the alignment of the other products. Since it generates a grid, aligning more to the grid for all elements would make it much more friendly.
.Bound instead of .Add for columns, .HtmlAttributes for easy style adjustments, etc.
Hello, Eric,
Thank you very much for the suggestion, I believe it would be beneficial indeed.
Meanwhile you could add a class by using the ClassName() method:
columns.Add().Width(300).Command(c =>
{
c.Edit().ClassName("my-class");
})
Then, if you would like to add other attributes, you could loop the rows on the DataBound event and target the ones with the custom class. You may also need to perform the same operation on the Cancel() event with a timeout. Let me know in case you need an example how to do that.
Kind Regards,
Alex Hajigeorgieva
Progress Telerik