Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: TIPS! How to dynamically create a datagrid..


Message #1 by "Fredrik Normen" <fredrik.normen@e...> on Fri, 29 Sep 2000 08:26:05 +0100
This example will demonstrates how to dynamicly create a datagrid at

runtime.



<html>

    <script language="VB" runat=server>

 

        Sub Page_Load(Sender as Object, E as EventArgs)

 

		dim myArray as ArrayList = new ArrayList()

		myArray.Add ("hej")

		myArray.Add ("hej2")



             ' Create a new datagrid

             Dim MyDataGrid as New DataGrid

 

             MyDataGrid.DataSource = myArray

             

             ' Add DataGrid into the Page

             PlaceHolder.Controls.Add(MyDataGrid)

 

             MyDataGrid.DataBind()

 

        End Sub

 

    </script>

 

    <body>

        <asp:label id="PlaceHolder" runat=server/>

    </body>

 

</html>



/Fredrik Normen


  Return to Index