This is technically possible, but it's not really very much fun to do. You wouldn't have access to the window size until after the page loads. Then you would be able to extract the window width using JavaScript and post it back to the server. You can update the control width to be the same as the window width, and render the control to fit. That means you'll have to force the whole page to reload a second time each time the window size changes.
I personally think it's a lot better to just determine how many elements you want on display at once, the width of each element, the width of any buttons, and just set the total control width accordingly.