Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic using Mindfusion calendar- bind the date using descriptiontext (Read 8999 times)
daniel_Daniel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Apr 9th, 2014
using Mindfusion calendar- bind the date using descriptiontext
Apr 9th, 2014 at 1:13pm
Print Post  
Hi all,
i am using mindfusion calendar. i have bind some sample text using "descriptiontext". herewith i have attached the sample image.

XAML:
<planner:Calendar Grid.Column="1" Name="Calendar" Margin="10,10,0,-58" CurrentView="Timetable" EndDate="2014-03-18" Date="2014-03-18" FontWeight="Normal" IsHitTestVisible="True" Background="#FF378D0F" FontSize="8" FontFamily="Times New Roman" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible" ShowSelectionToolTips="True" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" HScrollPos="100" Width="Auto">
<planner:Calendar.WeekRangeSettings>
<planner:WeekRangeSettings>
<planner:WeekRangeSettings.HeaderStyle>
<planner:CalendarStyle FontStretch="Normal" />
</planner:WeekRangeSettings.HeaderStyle>
</planner:WeekRangeSettings>
</planner:Calendar.WeekRangeSettings>
<planner:Calendar.ItemSettings>
<planner:ItemSettings HeaderSize="0" ForceCursor="False" IsManipulationEnabled="True" AllowDrop="False" Margin="0" >
<planner:ItemSettings.PointedItemStyle>
<planner:CalendarStyle FillBrush="#FFD82929" IsManipulationEnabled="True" />
</planner:ItemSettings.PointedItemStyle>
<planner:ItemSettings.CalendarStyle>
<planner:CalendarStyle FillBrush="#FFD82929" FontStretch="UltraExpanded" Margin="1" />
</planner:ItemSettings.CalendarStyle>
<planner:ItemSettings.PointedSelectedItemStyle>
<planner:CalendarStyle FillBrush="#FFD82929" />
</planner:ItemSettings.PointedSelectedItemStyle>
<planner:ItemSettings.SelectedItemStyle>
<planner:CalendarStyle Background="#FFD82929" FillBrush="#FFD82929" BorderBrush="Red" BorderThickness="1" />
</planner:ItemSettings.SelectedItemStyle>
</planner:ItemSettings>
</planner:Calendar.ItemSettings>
<planner:Calendar.TimetableSettings>
<planner:TimetableSettings ColumnBandSize="0" TimelineSize="0" WorkTimeEndHour="12" WorkTimeStartHour="12" HeaderDateFormat="dd dddd" CellSize="25" HorizontalAlignment="Left" ShowPadding="False" ExpandActiveItemOn="None" ShowItemSpans="False" Width="Auto" NowBrush="Black" NowFillBrush="Black" ShowAM="False" ShowDayHeader="False">
<planner:TimetableSettings.SelectedElementsStyle>
<planner:CalendarStyle Background="White" FillBrush="White" LineBrush="White" />
</planner:TimetableSettings.SelectedElementsStyle>
<planner:TimetableSettings.WorkTimeCellStyle>
<planner:CalendarStyle RightBorderBrush="Black" Visibility="Visible" TopBorderBrush="#FFE4FE8D" MaxWidth="Infinity" FontStretch="UltraExpanded" Width="Auto" MinWidth="0"></planner:CalendarStyle>
</planner:TimetableSettings.WorkTimeCellStyle>
<planner:TimetableSettings.CellStyle >

<planner:CalendarStyle Background="#FFE9F1E6" BorderBrush="#FF78A860" FillBrush="#FF190000" />

</planner:TimetableSettings.CellStyle>
<planner:TimetableSettings.HeaderStyle>
<planner:CalendarStyle Background="#FFB1CDA4" Foreground="black"/>
</planner:TimetableSettings.HeaderStyle>
<planner:TimetableSettings.SubHeaderStyle>
<planner:CalendarStyle BorderBrush="Red" BorderThickness="1" />
</planner:TimetableSettings.SubHeaderStyle>

</planner:TimetableSettings>
</planner:Calendar.TimetableSettings>
</planner:Calendar>


CS:

for (int i = 0; i < 10; i++)
{
if (starttime == starttime1)
{
starttime = starttime.AddHours(0);
}
else
{
starttime = starttime.AddHours(0.5);

}

starttime1 = starttime.AddHours(0.5);
app = new Appointment();
app.StartTime = starttime;
app.EndTime = starttime.AddHours(0.5);
//app.HeaderText = i.ToString();
app.DescriptionText = "FIRST VALUE " + " " + i.ToString() + " ";
app.Locked = true;
Calendar.Schedule.Items.Add(app);

}



Please help me out. thanks in advance.



Thanks and Regards

Daniel
  

Mindfusion_weekview.png (Attachment deleted)
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: using Mindfusion calendar- bind the date using descriptiontext
Reply #1 - Apr 9th, 2014 at 3:18pm
Print Post  
Hi,

Do you need the number to be displayed in red? Or do you need it to update dynamically in response to something?

Regards,
Meppy
  
Back to top
 
IP Logged
 
daniel_Daniel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Apr 9th, 2014
Re: using Mindfusion calendar- bind the date using descriptiontext
Reply #2 - Apr 9th, 2014 at 3:32pm
Print Post  
Hi Meppy,

             yes i  would like to change to any color for that number. actually am using "DescriptionText" to bind the data in this calendar cell . i need to bind two different data in a single calendar cell. is there any solution for this ?

In this thread i have attached the XAML code and CS Code  .

help me out thanks in advance



Thanks and Regards
Daniel
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: using Mindfusion calendar- bind the date using descriptiontext
Reply #3 - Apr 10th, 2014 at 7:07am
Print Post  
Hi,

The following sample illustrates the most flexible way to accomplish this:

https://mindfusion.eu/_samples/_sample_CustomItemPresenter.zip

The sample implements a new class derived from Appointment. The new class exposes an Index property, which represents the numerical value associated with your items. The new class is associated with a custom item presenter, which uses a template similar to the default item template. The only difference is that the custom template has an additional TextBlock for the new Index property. The sample also demonstrates how to dynamically update the index by clicking on the items.

Using this approach you have a greater control over the appearance of your items and you may extend the item class with additional properties.

Regards,
Meppy
  
Back to top
 
IP Logged
 
daniel_Daniel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Apr 9th, 2014
Re: using Mindfusion calendar- bind the date using descriptiontext
Reply #4 - Apr 10th, 2014 at 9:54am
Print Post  
Hi Meppy,

              Thanks you . its very helpful

    

Thanks and Regards

Daniel
  
Back to top
 
IP Logged
 
daniel_Daniel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Apr 9th, 2014
Re: using Mindfusion calendar- bind the date using descriptiontext
Reply #5 - Apr 10th, 2014 at 12:36pm
Print Post  
HI Meppy ,

              i have to set Sunday as starting date in week view using mind-fusion calendar. i want to fill some color in current  day's date . below i have given the code .

DateTime Sunday = DateTime.Today;
                while (Sunday.DayOfWeek != DayOfWeek.Sunday)
                    Sunday = Sunday.AddDays(-1);
                Calendar.TimetableSettings.Dates.Clear();
                for (int i = 0; i < 7; i++)
                    Calendar.TimetableSettings.Dates.Add(Sunday.AddDays(i));
                Calendar.CurrentView = CalendarView.Timetable;

Help me out. thanks in advance


Thanks and Regards

Daniel
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: using Mindfusion calendar- bind the date using descriptiontext
Reply #6 - Apr 10th, 2014 at 1:07pm
Print Post  
Hi,

We have added the ability to customize timetable column headers just recently. You won't find this feature in the current official release, but it is available in the assemblies contained in the samples provided in my replies.

You need to define a DataTemplate for the appearance of the column headers and then assign this template to the ColumnHeaderTemplate property of the TimetableSettings class. Optionally, you can set TimetableSettings.HeaderStyle.HorizontalAlignment and TimetableSettings.HeaderStyle.VerticalAlignment to Stretch to make the presenter fill the entire header. I've updated the sample to illustrate how to do this:

https://mindfusion.eu/_samples/_sample_CustomColumnHeaders.zip

Regards,
Meppy
  
Back to top
 
IP Logged
 
daniel_Daniel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Apr 9th, 2014
Re: using Mindfusion calendar- bind the date using descriptiontext
Reply #7 - Apr 10th, 2014 at 2:12pm
Print Post  
Hi Meppy,

              Thanks a lot . one more doubt, it only highlights the header style in week view.i want to highlight full row using some color in current  day's date . herewith i have attached sample image. thanks in advance


Thanks and Regards

Daniel
  

Week_HeaderStyle.png (Attachment deleted)
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: using Mindfusion calendar- bind the date using descriptiontext
Reply #8 - Apr 11th, 2014 at 9:03am
Print Post  
Hi,

You can define a custom template for the ScheduleColumnPresenter class. We've modified the sample to illustrate how to do this. There is a new property added to the ScheduleColumnPresenter class as well, so make sure you use the assembly included in this sample.

https://mindfusion.eu/_samples/_sample_CustomTimetableColumn.zip

Here is a preview of the customized timetable view:



Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint