views:

395

answers:

1

I have this datatable which i need to bind to a gridview,this datatable conatain really long data but i cant resize the gridview columns so the display looks really big and all data wrapped up occupying entire page..is there any way i can resize columns of the gridview????

also i want to use the pagesize property of gridview but procedure of retriving datatable is really complex and big so i dont want to call it again and again on PageIndexChanging event....i hv this code to to generate datatable in a function which i m calling on button click....is there anyway around it..?

thanx..

A: 

Use the ItemStyle.Width property on the column definition in your mark up, if you aren't using autogenerated columns, to set the width of the columns you are interested in. If you are using dynamically generated columns, the you will need to set the width in your code behind. Check out this tutorial on how to set the ItemStyle.Width property dynamically.

tvanfosson