Web gopalette

Hi, i am using web based planogram tool sample. Here i have a doubt which is in the gopalette(leftside) a user can add more than one product with different height and width. I want to set the dynamic height and which to cover all products to the gopalette. I dont prefer to set static size.

As you add or remove items from the GoPalette.Document, calculate the desired palette width and then set GoPalette.Width property.

Remember to include the scroll margin widths, if any.