Subscribe in a reader
An Infragistics WTF
Nermin's .Net
My Thoughts on .Net and Software Development

An Infragistics WTF

October 2, 2007 10:48 by ndibek

For all of us who have been unlucky to work with Infragistics controls, there comes a time where we say enough is enough! Where do I start?  Their archaic object model is horrible. 

Lets say you are using Ultra(complicated)Grid, and try to set an attribute of a row, or a column, be it width, color something else?  How do you think you would go about doing that?

 

Maybe  UltraGrid has Rows and Columns collections where all the properties related to a specific one can be set?  Not likely!  More likely you will have to go into UltraGrid.DisplayLayout, or maybe UltraGrid.Override. ...  But perhaps it is UltraGrid.Bands[..]...How about all those Appearance objects crowding the designer code and being trully randomly generated? 

That is the type of code that brings Source Control merge down to its knees.  And naturaly in case that 2 developers, God forbid, worked on a same screen containing Infragistics controls - due to the Apearances merger issues, your from designer is going to crash next time you perform "Get Latest". 

 

But that is not the topic I want to discuss today.  The problem is much more simple but yet somehow more irritating.  So I have had a control that inherits from UltraCombo.  Lets call this control NerminsCombo.  I had to define a behavior that happens each time value is selected in the dropdown of Nermin's combo.  So far simple.So I find a protected RowSelected event.  Obviously I am not about to register RowSelected event handler in the control that fires the event.  As we all know all controls have protected methods that are in charge of firing the events and their signature always is On[Event Name].

  

I guess I am lucky because I find the protected OnRowSelected() method right away.  So I override it, calling the base.OnRowSelected() first and then my implementation.  Then I run a quick test, and....   nothing happens.  I put the break point and it does not get hit.  WTF! 

An hour later, and after trying several different options, googling for possible blog entries about a bug in Infragistics, I finally registered an event handler to the RowSelected in the form that was using NerminCombo.  That handler got called but at the same time the code in the OnRowSelected override was executed.So OnRowSelected was only called if there were registered event handlers to RowSelected. 

So obviously this method was not firing the RowSelected event.  Using one of my favorite tools – Reflector, I disassembled the code of the UltraCombo and took a look at it. 

Finally after all this I discovered another protected method called FireRowSelected.  Like its name stated it was the method that was in charge of invoking RowSelected event.  Overriding this method produced desired results – defining a behavior that is executed inside the NerminCombo each time a selection of the row was made.

 

Now comes the question – why would Infragistics not follow control design recommendations from Microsoft?  Does the design of this control pre-dates .Net?  If that is the case, why wouldn’t they note this discrepancy in their help documentation?  And why do I have to waste my time on things like these each time I write code that depends on Infragistics controls?

 

 


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: C#
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Related posts

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag





Live preview

August 28. 2008 10:54