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
If you are programming in Visual Basic, then you should add some Imports statements to make things easier;
Imports InfragisticsImports Infragistics.WebUIImports Infragistics.WebUI.UltraWebGridImports Infragistics.WebUI.WebCombo
The WebCombo doesn't have an items collection like a normal asp dropdown list. The WebCombo is actually a WebGrid that drops down. It only supports flat data, however. You can't have a hierarchical WebCombo. You bind the WebCombo to a data source in the same way that you do with the grid. You can bind it to a data table or an object list and it will make columns in the same way that the grid does.
The nice thing about the WebCombo is unlike an asp dropdownliast, you're not limited to just two columns where one is the value and one is the display text. You can bind the WebCombo to a DataTable containing 10 columns if you like. It will display all 10 unless you hide any of them, and like the WebGrid you can swap the positions of the columns around. If you choose, you can also manually create the rows and columns of the WebCombo yourself, just like you can with the grid.
Let me know if you have any other questions.
Thank´s charlie:
I used the Imports statements you said in the last post, and my project now works so fine and i solve my webcombo´s trouble using a simple dropdowlist, my real problem was that i couldn´t combine a dropdown with a some infragistics controls because i´m using a warp control but now it works good.
by now i´m not having any problem, thank you so much for helpping myself. If i have some other problem i will be bothering you
Hi.
I solve my problem whint the postbaks as you said i put the entire tab control inside of the warp and there are no more postbaks, but i have another problem, i want to my application refresh the information at run time, i mean, my application reads information from a database, I want that in the moment in which a new record is inserted in the database, it appears automatic in my application.
i tied to do it using a refreshinterval property of the wrap, y put refreshinterval = 5000, but In the moment in which supposedly twrap begins to update the information the control that contains the information disappears, in this case the control that contains the information is a gridview.
Please help me, how can i do it
thanks
If the WARP is inside the tab, then only the contents of that tab will be refreshed asynchronously. The tab itself will not be inside the WARP, only the contents of one particular tab. You could wrap the WARP around the entire tab control and that way anything you do with the tab will be done asynchronously.
HI charlie:
I´m using a WARP to elminate the postbacks on my Application , and when i´m running my Application Everything works well, i have no postbacks anymore but the problem begins when i place the warp and everything that the warp contains inside the ultrawebtab, i run my project and i have the postbaks again, As if the warp does not exist. do you why it is happening?