GridViewDesigner.GetDesignTimeHtml Method ()
Assembly: System.Design (in system.design.dll)
The GetDesignTimeHtml method does the following:
-
Sets the AutoGenerateColumns property of the control to true, if the Columns property is empty.
-
Sets the DataKeyNames property of the control to a null reference (Nothing in Visual Basic), if the schema of the data source cannot be obtained.
-
Refreshes the TypeDescriptor object to force the PreFilterProperties method to be called.
-
Calls the base method to generate the markup.
The following code example shows how to override the GetDesignTimeHtml method in a class that is inherited from the GridViewDesigner class to change the appearance of the GridView control at design time. The example adds a new first row to the grid to contain the Caption property, if the Caption is defined. If the BorderStyle property of the control that is derived from the GridView class has the NotSet or None value, the GetDesignTimeHtml draws a blue dashed border around the control to make its extent more visible. It does not change the run-time appearance of the control.