Hi,
i had tried lots of time but i am unable to add Header Text in XamdayView.
also there is no help on internet at all.
Please help.
Previously i had posted a question but it seems infragistics guys are very busy, and unable to sort out problems of there customers.
nandlaldotsquares said:i am unable to add Header Text in XamdayView
Thanks a lot, you replied.
Here is my code used to show calendar
XamDayView optiomDayView = new XamDayView(); optiomDayView.FontSize = (double)10; optiomDayView.CalendarDisplayMode = CalendarDisplayMode.Overlay; optiomDayView.ShowCalendarCloseButton = true; optiomDayView.ShowCalendarOverlayButton = true; DataSet myDataSet = new DataSet(); myDataSet = loadDayPage(item.Id.ToString()); ListScheduleDataConnector mydataConnector = new ListScheduleDataConnector(); mydataConnector.ResourceItemsSource = CreateResources(item, i); mydataConnector.ResourceCalendarItemsSource = GetCurrentCalendar(item, i); mydataConnector.AppointmentItemsSource = CreateAppointments(myDataSet); // Create a XamScheduleDataManager object and set its DataConnector property. XamScheduleDataManager mydataManager = new XamScheduleDataManager(); mydataManager.ActivityDialogDisplaying += new EventHandler<ActivityDialogDisplayingEventArgs>(mydataManager_ActivityDialogDisplaying); mydataManager.DataConnector = mydataConnector; // Create a CalendarGroupCollection object to add CalendarGroup objects. CalendarGroupCollection mycalendarGroupCollection = mydataManager.CalendarGroups; CalendarGroup mycalendarGroup = new CalendarGroup(); mycalendarGroup.InitialCalendarIds = "[res" + i.ToString() + "[cal" + i.ToString() + "]]"; //mycalendarGroup.InitialCalendarIds = "[res" + i.ToString() + "[cal1][cal2][cal3][cal4]]"; mycalendarGroupCollection.Add(mycalendarGroup); optiomDayView.DataManager = mydataManager; optiomDayView.VisibleDates.Clear(); optiomDayView.VisibleDates.Add(Convert.ToDateTime(dtdate.SelectedDate));
and This is code for resource
private ObservableCollection<Resource> CreateResources(customCB item, int Number) { ObservableCollection<Resource> _rcCollection = new ObservableCollection<Resource>(); Resource rc = new Resource(); rc.Id = "res" + Number.ToString(); rc.Name = item.fullName; rc.IsLocked = false; rc.IsVisible = true; rc.Description = item.fullName; _rcCollection.Add(rc); return _rcCollection; }
and this is for Calendar
private ObservableCollection<ResourceCalendar> GetCurrentCalendar(customCB item, int Number) { ObservableCollection<ResourceCalendar> _rcCollection = new ObservableCollection<ResourceCalendar>(); ResourceCalendar rc = new ResourceCalendar(); rc.Id = "cal" + Number.ToString(); rc.OwningResourceId = "res" + Number.ToString(); rc.BaseColor = GetCalendarColor(Number); rc.Name = item.fullName; rc.Description = item.fullName; rc.IsVisible = true; _rcCollection.Add(rc); return _rcCollection; }
But i did not found any option to Show/Side Calander CaptionHeaderText and to set text, as we have myDayView.CaptionHeaderText = "Heading"; in our web control.
Thanks Andrew,
above information is very helpful for me.
Please help me! Is there any way to not display the day in viewday as picture below:
This isn't really related to the original question posed in this forum thread so it would be best to start a different one next time.
The easiest way to help find an answer to questions such as this is to get Snoop and look at the element tree to see where those elements are. In this case there are several ScheduleDateTimePresenter instances that are providing those visuals. These exist within the DayViewDayHeader element so if you do not want those in there then you would retemplate the DayViewDayHeader and remove or collapse those elements.
The best place to start with creating custom templates is to take a copy of the existing one from the DefaultStyles directory (e.g. C:\Program Files\Infragistics\NetAdvantage 2011.1\WPF\DefaultStyles). In this case that template looks like the following:
<Style TargetType="igSchedulePrim:DayViewDayHeader"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="igSchedulePrim:DayViewDayHeader"> <Border BorderBrush="{TemplateBinding ComputedBorderBrush}" BorderThickness="{TemplateBinding ComputedBorderThickness}" Background="{TemplateBinding ComputedBackground}" Padding="{TemplateBinding Padding}" igPrim:XamlHelper.SnapsToDevicePixels="True"> <Grid igPrim:XamlHelper.SnapsToDevicePixels="{TemplateBinding igPrim:XamlHelper.SnapsToDevicePixels}" > <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <igSchedulePrim:ScheduleDateTimePresenter HorizontalAlignment="Left" FormatType="DayOfMonthNumber" DateTime="{Binding DateTime, RelativeSource={RelativeSource TemplatedParent}}" FontWeight="Bold" Foreground="{TemplateBinding ComputedForeground}"/> <igPrim:BestFitPanel x:Name="FullDayName" Grid.Column="1" HorizontalAlignment="Center" Margin="0,0,7,0"> <igSchedulePrim:ScheduleDateTimePresenter FormatType="DayOfWeek" DateTime="{Binding DateTime, RelativeSource={RelativeSource TemplatedParent}}" Foreground="{TemplateBinding ComputedForeground}"/> <igSchedulePrim:ScheduleDateTimePresenter FormatType="ShortDayOfWeek" DateTime="{Binding DateTime, RelativeSource={RelativeSource TemplatedParent}}" Foreground="{TemplateBinding ComputedForeground}"/> <igSchedulePrim:ScheduleDateTimePresenter FormatType="ShortestDayOfWeek" DateTime="{Binding DateTime, RelativeSource={RelativeSource TemplatedParent}}" Foreground="{TemplateBinding ComputedForeground}"/> </igPrim:BestFitPanel> </Grid> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style>
And that requires some namespace mappings (also taken from the same xaml file where the template was taken):
xmlns:ig="http://schemas.infragistics.com/xaml" xmlns:igPrim="http://schemas.infragistics.com/xaml/primitives" xmlns:igSchedulePrim="http://schemas.infragistics.com/xaml/primitives"
So you could remove the Grid within the Border. Note since there would be no content to provide any height you may want to add a setter for the MinHeight or put something (like a textblock) within the template in place of the grid.
Im sorry for inconvenience. Thanks for the support.
Is there a setting to just show the calendar name and not the full resource name-calendar name concatenation?
Thanks,
David
There isn't a property since that is something that might be different per locale and instead is something that is defined by resource strings. You can see a list of the schedule related resource strings here. This other help topic discusses how one overrides/defines custom resource strings. In the case of xamSchedule the RegisterResources method is defined on the ScheduleControlBase class.