Page 1 of 1
Sourcecode to modify Kit formating?
Posted: Wed Nov 04, 2015 3:27 am
by Odettes
Hello!
I need to change the output of different Kit-components, for example i need to add some css classes.
Can I do that without source-code? I can change the container around the Kit but not the item separately.
I can use jquery to modify it after page load but I want to avoid that if possible..
Re: Sourcecode to modify Kit formating?
Posted: Wed Nov 04, 2015 4:14 am
by mazhar
In Website/ConLib/BuyProductDialog.ascx.cs file locate the KitsList_ItemDataBound method which adds kit controls to UI. You should be able to wrap these control into custom wrappers or set classes in this method without needing back end code.
Re: Sourcecode to modify Kit formating?
Posted: Wed Nov 04, 2015 4:20 am
by Odettes
Great, thanks!
Re: Sourcecode to modify Kit formating?
Posted: Wed Nov 04, 2015 4:45 am
by Odettes
It works fine to set custom CssClass for Kit component that use dropdown (which render clean without any table).
But for Radio and Checkbox components I just manage to set the CssClass for the surrounding Table, not the item itself.
If I want to remove the table structure on Radio and Checkbox and replace it with custom DIV tags instead do I need source for that or can that be done within the KitsList ItemDataBound?
Some example code would be appreciated or the source-part where the rendering takes place, thanks!
Re: Sourcecode to modify Kit formating?
Posted: Thu Nov 05, 2015 4:49 am
by mazhar
Radio and Checkbox lists are standard .NET controls. They already support RepeatLayout property. Just change the layout to lists etc and it won't emit table.
Code: Select all
((CheckBoxList)o).RepeatLayout = RepeatLayout.UnorderedList;
((CheckBoxList)o).RepeatDirection = RepeatDirection.Horizontal;
Re: Sourcecode to modify Kit formating?
Posted: Thu Nov 05, 2015 7:25 am
by Odettes
mazhar wrote:Radio and Checkbox lists are standard .NET controls. They already support RepeatLayout property. Just change the layout to lists etc and it won't emit table.
Code: Select all
((CheckBoxList)o).RepeatLayout = RepeatLayout.UnorderedList;
((CheckBoxList)o).RepeatDirection = RepeatDirection.Horizontal;
Thanks!