Data grid inside a Tab control RRS feed

  • Question

  • hi,

    i have a form allowing user to search details of employees.

    the form allows users to key in 7 search criteria.

    the results of this search open in a new window.

    employee details (data) are of following 3 types:

    • personal details
    • contact details
    • additional details

    i want to achieve the following with the results window

    the new window that opens to show the search results has a tab control with 3 tabs for displaying the results for each of the above categories. hence the three tabs would be


  • personal details
  • contact details
  • additional details

    each tab would display the required data in a datagridview control.

    on adding the datagridview directly to the tabpages of the tabcontrol the window does not resize to the size of the datagridview that is displayed.

    i understand that the property AutoResize is not applicable to a tabcontrol or a tabpage, hence 1 added a panel to each of the tabpages and then added the datagridview to it.

    however, even this does not help and the results window is still does not resize to the size of the datagrdiview.

    i have set the AutoScroll property of all the tabpages to, AutoResize of the datagridview and results window all to True.

    please help me with this as the results widow does not rezise even to the size of the tabcontrol that i have added and the tabcontrol ends up with scroll bttons in the widow.



Sunday, April 25, 2010 6:07 AM


  • You can use the dock property (fill) of the DataGridViews for that
    Sunday, April 25, 2010 8:51 AM