Hi,
I'm new to the NetAdvantage controls. I'm using UltraDayView control to show appointments with the Office2007 view style (UltraCalendarLook control used by UltraDayView has property ViewStyle set to Office2007). My problem is that with this style only Subject and Location are shown in appointments, but i can't find setting to show also Description (and Time) as are in default view style. Can somebody tell me if this is possible and how. Thanks.
There is no way to make the Description appear using the public object model.
One way to solve the problem is to use the IUIElementCreationFilter interface. There is a Knowledge base article which demonstrates how:http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7316
Since the article was written before the Office2007 ViewStyle was introduced, the AfterCreateChildElements method must be modified in the following manner:public void AfterCreateChildElements(Infragistics.Win.UIElement parent){ // If the parent is an EmbeddableUIElementBase, get the associated AppointmentUIElement // and remove all elements except for the EmbeddableUIElementBase, and change the bounds // of the EmbeddableUIElementBase to occupy the entire bounds of the AppointmentUIElement. EmbeddableUIElementBase embeddableElement = parent as EmbeddableUIElementBase; AppointmentUIElement appointmentElement = embeddableElement != null ? embeddableElement.GetAncestor( typeof(AppointmentUIElement) ) as AppointmentUIElement : null;if ( appointmentElement != null ) { // Get the associated appointment, and the text that should be displayed for it. Appointment appointment = appointmentElement.GetContext( typeof(Appointment) ) as Appointment; string text = this.GetAppointmentText( appointment );
// Set the bounds of the embeddable element embeddableElement.Rect = appointmentElement.RectInsideBorders;
// Get the embeddable element's TextUIElement TextUIElement textElement = embeddableElement.GetDescendant( typeof(TextUIElement) ) as TextUIElement; if ( textElement != null ) { // Change the text displayed by the embeddable element based on // the DisplayStyle. textElement.Text = text;
// Reverse iterate the AppointmentUIElement's ChildElements collection // and remove all elements except for the EmbeddableUIElementBase UIElementsCollection childElements = appointmentElement.ChildElements; int childElementCount = childElements.Count;
for ( int i = childElementCount - 1; i >= 0; i -- ) { UIElement element = childElements[i]; if ( element == embeddableElement ) continue;
childElements.Remove( element ); } } }}
We recently changed our software to allow the Office2007 ViewStyle and thus just found this issue where the Description will not appear for the Appointment on the UltraDayView. While I can appreciate the workaround(s) published with this post, I'm wondering if anything more straightforward has been implemented in the software in the last 4 years. We recently upgraded all our Infragistics controls to the latest 12.1 version.
Thanks
We are using Visual Basic 2008 .Net and the command " this.GetAppointmentText( appointment )" seems not avalible for us. So please Can you show the same example in Visual Basic 2008 .Net?
Thanks and regards
Hi.I managed to show the subject and description of an appoinment with the code posted. My problem is that when i do this with appoinments with images (appoinment.Appearance.Image) the imageis not shown. How could i modify the code in order to show subject, description and Image?Many thanks