Last summer I started using Infragistics controls to help me build cooler sites. One thing I did not count on was the severe lack of useful documentation and tutorials provided by Infragisitcs on using their tools. For example I have not even begun to play with the DataGrid and Chart included with the control suite.
I have used almost all the rest of the controls in many sites over the past 7 months. One control I really like is the Tab Control, UltraWebTab. This is one of those controls that allows you to have a cool looking design, similar to what you can get in a Smart Client application and a Tabbed Dialog Box, etc. You get the idea.
My first application of this control was to break up a really long form, one to enter the attributes of a product. If you have every done a real E-Commerce solution you no doubt understand defining a product with 40 plus data fields. Of course you will have fields of all types, numbers, dollars, short text, long text, related setting like categories and related products. The extent can be quite detailed, thus creating a need for a clean layout for the data entry person to actually understand what they are entering. Enter the Tab Control and breaking things into managable chunks.
At first this was great, which a few quircks to working with the UltraWebTab. As I port my E-Commerce framework to ASP.NET 2.0 I was quickly reminded of these quirks and how I had to overcome them. So pay attention, I never found these answers in the messageboards and certainly not Infragistics rather useless documentation and even their paid support (what a rip off, so don't bother).
First, you can not access the controls in the UltraWebTab like you normally would. In fact in ASP.NET 2.0 you even have to declare the controls because the IDE will not see them. So you will need to add a section at the top of your class like this:Protected WithEvents txtMaterials As TextBoxProtected WithEvents txtKeyWords As TextBoxProtected WithEvents txtAvailableDate As TextBoxProtected WithEvents txtSKU As TextBoxProtected WithEvents txtNote As TextBox
OK, no biggie, but a huge inconvience when you are trying to expidite development by using pre-built controls. Now since the controls can not be seen by the IDE, and thus the compiler you will need to instantiate the conotrols mannualy at run-time as well. I defined a method called InitializeControls. In this method I grabbed a reference to the control from the UltraWebTab. It looks like this:
Public Sub InitializeControls()
tvCategories =CType(UltraWebTab1.FindControl('tvCategories'), TreeView)
rblShowOnCategory =CType(UltraWebTab1.FindControl('rblShowOnCategory'), RadioButtonList)
rblQuickShip =CType(UltraWebTab1.FindControl('rblQuickShip'), RadioButtonList)
rblShipUPS =CType(UltraWebTab1.FindControl('rblShipUPS'), RadioButtonList)
rblFreeShipping =CType(UltraWebTab1.FindControl('rblFreeShipping'), RadioButtonList)
rblIsRound =CType(UltraWebTab1.FindControl('rblIsRound'), RadioButtonList)
rblIsGroup =CType(UltraWebTab1.FindControl('rblIsGroup'), RadioButtonList)
rblApprove =CType(UltraWebTab1.FindControl('rblApprove'), RadioButtonList)
rblTaxable =CType(UltraWebTab1.FindControl('rblTaxable'), RadioButtonList)
Again a mega inconvience, but both are easily over come if you create a good template for CodeSmith, which I have not done as of yet. =>
Now the quirks do not end there. The next big item I found was the use of FreeTextBox. Now when I first found the control did not maintain the content I entered in it upon postback I was totally lost. The regular textboxes retained their content. I also noticed that DataGrids, and now GridViews also did not retain their control values, I was using check boxes on each line to indicate inclusion.
So after a couple of days of doing some maddening research on the messageboards and Infragistics useless knowledgebase, I was at the end of my rope. That is when I had my worthless expereince with Infragistics $99 support call. The young, probably intern, at their support center had no clue what I was askign about at first. So I sent him the code. He was wondering what FreeTextBox was, to my surprise I do not think he or anyone there knew what it was despite its widespread use on ASP.NET sites everywhere.
Well he said he would get back to me. I kept up my efforts too. I don't recall the exact way I decided to try the actual solution, but it came from a totaly unrelated topic where someone solved their UltraWebTab problem by creating a separate User Control and loaded it into the Tab. I said, OK, and that is what I did.
I created 3 ascx User Controls, one with my FreeTextBox controls and 2 more with my datagrids. Loaded those onto the related tabs at runtime. I added some public properties to the User Controls to access the controls and voila it worked. So I sent my solution back to the nice support guy at Infragistics, and I am not sure if he actually read it or not, but a day later he gave me the suggestion to do what I actually did. BTW, I did not get my $99 back.
Anyway, this is how you load a control at Run-Time:
This is how you access a control at Run-Time to get and set your values from your main page, this is the control with the FreeTextBoxes on it:Dim pd As Admin_producteditdescriptions = _CType(UltraWebTab1.Tabs.GetTab(1).ContentPane.UserControl, Admin_producteditdescriptions)
pd.Description = Server.HtmlDecode(CType(ii.Description, String))
pd.Materials = ii.Materials
pd.Includes = ii.Includes
pd.KeyWords = ii.KeyWords
This is how I defined the Properties in the UserControl:Public Property Description() As String Get Return txtDescription.Text End Get Set(ByVal Value As String)
txtDescription.Text = ValueEnd SetEnd Property
Well I hope this long entry helps someone out there not have to waste about 12 hours of their time and a worthless $99 support call to Infragistics. Maybe if all goes well, Infragistics will improve their controls to actually offer direct access to the controls on the UltraWebTab to reduce the need for all this manual/run-time coding to make everyone's life easier. At least maybe they can improve their documentation. I have heard this from everyone who uses their controls. Don't get me wrong, I think the controls are great, they are just not documented, well at all. Pretty lazy IMHO for a product with the level of sales they enjoy.