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..
Sourcecode to modify Kit formating?
Re: Sourcecode to modify Kit formating?
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.
-
- Lieutenant Commander (LCDR)
- Posts: 102
- Joined: Wed Apr 02, 2008 11:00 am
- Location: Stockholm, Sweden
- Contact:
Re: Sourcecode to modify Kit formating?
Great, thanks!
-
- Lieutenant Commander (LCDR)
- Posts: 102
- Joined: Wed Apr 02, 2008 11:00 am
- Location: Stockholm, Sweden
- Contact:
Re: Sourcecode to modify Kit formating?
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!
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?
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;
-
- Lieutenant Commander (LCDR)
- Posts: 102
- Joined: Wed Apr 02, 2008 11:00 am
- Location: Stockholm, Sweden
- Contact:
Re: Sourcecode to modify Kit formating?
Thanks!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;