Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
Create controls by code
posted

Hi everybody:

I´m a new infragistics tools user, and im developing a website where  i need to  to create controls by code (any control), but especially a UltraWebGrib, because i have to read a  table from a databes,   and in base of the records number i have to create the same numbers of ultrawebgrids. so can anybaody tell me how can i do this, im using visual studio 2005 with visual basic language.....  Thanks

Parents
No Data
Reply
  • 2197
    posted

     Hello.

    To create an instance of an UltraWebGrid in code, you simply instantiate the object and pass in an ID in the pages OnInit event and then add it to the page controls collection, like this:

    Protected Sub Page_Init(ByVal sender As object, ByVal e As System.EventArgs) Handles Me.Init

        Dim Grid as UltraGrid = new UltraWebGrid("UltraGrid1")

        Me.Form1.Controls.Add(Grid)

    End Sub

    Once you add the grid to the pagesControls collection, you can set all of its properties and also handles its events. Handle the events in the Page_Init event, and if you Databind, then handle the grids InitializeLayout event and set all of the properties there. Let me know if you have any other questions.

Children