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
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.
thanks charlie:
I made the same you said me, but with a gridview, the clasical grid of visual studio 2005, beacause when i tried to instantiate de ultrawebgrid i just couldn´t. I think is missing an imports directives or something like that, do you know if i need an imports directives?
mmm i just remember another thing, please help me. I´ve in my aplication a web combo and i wanna add items by code, using a normal dropdownlist ia can do it tihis way:
me.dropdownlist1.items.clear()
me.dropdownlist1.items.add(text_of_item)
But i wanted to do the same with a webcombo but i couldn´t, a message error saids that "items" is not a member of infragisitcs.WebUi.Webcombo.Webcombo do you know why it´s happening?
thanks for helpping myself