I'm trying to make something pretty simple. I have a div tag that displays my gridview. I would like to set the div width property to the gridview width property + a few more pixels. I tried to access the GridView.Width.Value property in the DataBound and Page_Prerender events, but it always returns 0:
protected void Page_Prerender(object sender, EventArgs e) { string sWidth = gvUsers.Width.Value.ToString(); divContactForm.Attributes.Add("style", "width: " + sWidth + " ;"); }
I tried the same code in a DataBound event with no luck.
How can I get the width of the GridView after the data has been bound to it?
source share