Eric
Eric

Reputation: 8088

adjust Gridview Width

I have a Gridview that uses a collapsible panel to show a large amount of text. When the button is clicked to display the text my edit and delete button align on top of eachother as opposed to being side to side so I need to adjust the width of the Gridview in javascript. I already have the label calling a javascript function onclick but how can I adjust the width?

Upvotes: 0

Views: 3065

Answers (1)

Dan Diplo
Dan Diplo

Reputation: 25359

You can use this in JavaScript:

document.getElementById('GridViewClientID').style.width = "500px";

Or, you can do it server-side by changing the GridView Width property:

GridView1.Width = 500;

Upvotes: 2

Related Questions