How to adjust Devexpress grid width dynamically?

Deepan Babu picture Deepan Babu · Dec 29, 2011 · Viewed 8.1k times · Source
  1. I have a table with 3 tds, 1st td with 1% width and a image button control(Pin image) in it. 2nd with 98% and DevExpress GridView in it and the 3rd is also 1% width and a image button control.

  2. When the user clicks on the Pin image, I do change Grid's Td width to 79% but the Grid's width do not resize accordingly until I re-size any column in the grid.

  3. After manually resizing a column the grid is adjusted to the TD's width.

  4. I do not want to manually do that action instead it should be done programmatically while I click image button control which is in other TD.

Answer

Filip picture Filip · Dec 29, 2011

Try calling ASPxClientGridView.AdjustControls after changing Td width.