PRB: DataGrid Web Server Control Does Not Appear When You Put It in a MultiPage Internet Explorer Web Controls Control (815185)



The information in this article applies to:

  • Microsoft Visual Studio .NET (2003), Professional Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Academic Edition
  • Microsoft Visual Studio .NET (2002), Professional Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Academic Edition

SYMPTOMS

When you put a DataGrid Web server control in a MultiPage Microsoft Internet Explorer Web Controls control through code, the DataGrid does not appear in the Web Form in Design view. The DataGrid also does not appear when you view the Web Form in the browser.

CAUSE

This problem occurs because the DataGrid is not bound to any data.

Typically, when a DataGrid control is at the top level of the code, the Designer object instantiates. This behavior creates a dummy data source for the DataGrid, and then the DataGrid appears as expected.

However, when the DataGrid control is located in another control (the MultiPage control in this example), the DataGrid control does not go through the design-time code path that it would have gone through typically. Therefore, the DataGrid does not appear in the browser because the DataGrid has not been bound to any data. In this scenario, the DataGrid also does not appear in Design view at design time.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce the Behavior

To reproduce this problem, you must have the Microsoft Internet Explorer Web Controls installed on your computer. To obtain the Internet Explorer Web Controls, visit the following Microsoft Web site:Note Microsoft does not currently support the Internet Explorer Web Controls. For more information, see the "References" section.
  1. Start Microsoft Visual Studio .NET 2003.
  2. On the File menu, click New, and then click Project.
  3. In the New Project dialog box, click Visual Basic Projects under Project Types, and then click ASP.NET Web Application under Templates.
  4. Click OK.

    By default, WebForm1.aspx is created.
  5. Right-click the toolbox, and then click Customize Toolbox.
  6. In the Customize Toolbox dialog box, click the .NET Framework Components tab.
  7. In the list of controls, click to select the check box for Multipage Control. If the control is not available in the list, click Browse, and then locate Microsoft.Web.UI.WebControls.dll. Click OK.

    The MultiPage control is added to the toolbox.
  8. Drag the MultiPage control to WebForm1.
  9. Switch to the HTML view of WebForm1.
  10. Replace the code that is located between the <form> tag and the </form> tag with the following sample code:
    <iewc:MultiPage id="MultiPage1" style="Z-INDEX: 101; LEFT: 76px;
     POSITION: absolute; TOP: 42px" runat="server" Width="520px" Height="320px"
     BorderStyle="None"> <iewc:PageView id="FirstPage"> </iewc:PageView> 
    </iewc:MultiPage>
  11. Switch to the Design view of WebForm1.
  12. Click the MultiPage control.
  13. In the toolbox, double-click the DataGrid control.
  14. Switch to the HTML view of WebForm1
  15. In HTML view, put the existing code that creates the DataGrid between the following tags:

    <iewc:PageView>

    </iewc:PageView>

  16. Switch to the Design view of WebForm1.

REFERENCES

For more information, visit the following Microsoft Web sites: For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

328046 INFO: Microsoft Internet Explorer Web Controls Are Not Supported


Modification Type:MajorLast Reviewed:4/21/2006
Keywords:kbWebClasses kbWebBrowser kbCodeGen kbWebForms kbControl kbprb KB815185 kbAudDeveloper