Telerik Forums
UI for WPF Forum
0 answers
89 views
Hi,

I'm not able to create an appointment with a frequency like weekly by c# Code! No error but the appointment is not shown in
the scheduleview! Why?

I'm using WPF RadControls 2012 Q1 SP1 and c# .Net 4.0

foreach (DataRow tasks_dr in passw_dt.Rows)
    {
        DateTime start = Convert.ToDateTime(tasks_dr.Field<String>("StartDatum"));
     
         switch (start.DayOfWeek)
          {
              case DayOfWeek.Saturday:
                     start = start.AddDays(2);
                     break;
               case DayOfWeek.Sunday:
                      start = start.AddDays(1);
                       break;
           }
 
           TimeSpan duration = TimeSpan.FromDays(5);
            DateTime end = Convert.ToDateTime(tasks_dr.Field<String>("Enddatum"));
            switch (end.DayOfWeek)
            {
                case DayOfWeek.Sunday:
                     end = end.AddDays(-1);
                      break;
                 case DayOfWeek.Monday:
                      end = end.AddDays(-2);
                      break;
              }
           
              Appointment appointment = new Appointment
               {
                   Start = start,
                   Url = Convert.ToString(tasks_dr.Field<Int64>("id") + "#" + tasks_dr.Field<String>("Betreuer")),
                   End = end,
                   Subject = tasks_dr.Field<String>("Subject"),
                   Body = tasks_dr.Field<String>("Body"),
                   Importance = GetImportance(tasks_dr.Field<String>("Importance"))
                };
 
                if (tasks_dr.Field<String>("Kategorie") == "Fertig")
                {
                    appointment.Category = this.Categories[0];
                }
                else if (tasks_dr.Field<String>("Kategorie") == "in Arbeit")
                {
                    appointment.Category = this.Categories[1];
                }
                else
                {
                    appointment.Category = this.Categories[2];
                }
 
                if (tasks_dr.Field<Int64>("Ganztag") == 0)
                {
                    appointment.IsAllDayEvent = false;
                }
                else
                {
                    appointment.IsAllDayEvent = true;
                }
 
                var Pattern = new RecurrencePattern();
                Pattern.Frequency = GetFreuqency(tasks_dr.Field<String>("Frequency"));
 
                if (Pattern.Frequency != RecurrenceFrequency.None)
                {
                    Pattern.DayOrdinal = Convert.ToInt32(tasks_dr.Field<Int64>("DayOridnal"));
                    Pattern.DaysOfWeekMask = GetDay(tasks_dr.Field<String>("DaysofWeekMask"));
                    Pattern.FirstDayOfWeek = GetFirstday(tasks_dr.Field<Int64>("FirstDayOfWeek"));                   
                    Pattern.Interval = Convert.ToInt32(tasks_dr.Field<Int64>("Interval"));
                    Pattern.MaxOccurrences = Convert.ToInt32(tasks_dr.Field<Int64>("MaxOccurrences"));
                    Pattern.MonthOfYear = Convert.ToInt32(tasks_dr.Field<Int64>("MonthofYear"));
                    Pattern.DayOfMonth = Convert.ToInt32(tasks_dr.Field<Int64>("DayofMonth"));
 
                    System.DateTime? RecursUntil_d;
                    if (tasks_dr.Field<String>("RecursUntil") != "")
                    {
                        RecursUntil_d = Convert.ToDateTime(tasks_dr.Field<String>("RecursUntil"));                       
                    }                   
                    Pattern.RecursUntil = RecursUntil_d;
 
                    appointment.RecurrenceRule = new RecurrenceRule(Pattern);
                }
                this.appointments.Add(appointment);

Every appointment withput a freqeuncy is shown fine. Thanks
Rgards
Rene
ITA
Top achievements
Rank 1
 asked on 24 Apr 2012
1 answer
107 views
Hi,

Is it possible to add controls like textblock, buttons, etc... under a tab item?  I have an application I'm mocking up and I'd like to show the main function of the application in the 1st tab and rich content in other tabs.

Thank you!
Teo
Top achievements
Rank 1
 answered on 24 Apr 2012
1 answer
183 views
Hi,

I have a gridview that consists of mix data bound columns and custom template column. The custom template column are basically a check box column and a calendar column. I used the techniques from this example to create those custom column (using the CreateCellElement)

http://www.telerik.com/community/forums/wpf/gridview/tab-navigation-in-a-grid-with-a-button-column.aspx

The check box column works fine with tabbing to/from the column. However the issue is with the Calendar column, as the tabbing doesn’t get the focus in the calendar control inside the column, and it doesn’t move away from it to move to the next column. Instead the focus moves to the next control beside the grid.

Any advice how to accomplish a smooth tab navigation between all column, and have the focus land in the inner controls when it is a custom column?

Regards

public override FrameworkElement CreateCellEditElement(GridViewCell cell, object dataItem)
{
    cell.GotFocus += this.cell_GotFocus;
     
    var picker = cell.Content as RmpDatePicker ?? new RmpDatePicker()
                     {
                         HorizontalAlignment = HorizontalAlignment.Stretch
                     };
    this.BindingTarget = RmpDatePicker.SelectedDateProperty;
    picker.SetBinding(this.BindingTarget, this.CreateValueBinding());
    return picker;
}
private void cell_GotFocus(object sender, RoutedEventArgs e)
{
    var picker = (sender as GridViewCell).ChildrenOfType<RmpDatePicker>().FirstOrDefault();
         
    if (picker == null) return;
          
    picker.Focus();
    picker.HorizontalAlignment = HorizontalAlignment.Stretch;
}
private Binding CreateValueBinding()
{
    var valueBinding = new Binding
                           {
                               Mode = BindingMode.TwoWay,
                               NotifyOnValidationError = true,
                               ValidatesOnExceptions = true,
                               UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged,
                               Path = new PropertyPath(this.DataMemberBinding.Path.Path)
                           };
    return valueBinding;
}


Nedyalko Nikolov
Telerik team
 answered on 24 Apr 2012
2 answers
70 views

I have a grid in which comboboxes are shown in each row to allow for selection of color for the item in that row.

Now we wish to have different lists of colors depending on the row; i.e. the itemssource for the comboboxes are no longer the same.

Before I had a single color-list on the viewmodel for the grid and xaml-databound-bound the comboboxes to that.

How do I get different itemssources for the comboboxes?

Thanks for any input,

Anders, Denmark

Anders
Top achievements
Rank 1
 answered on 24 Apr 2012
1 answer
87 views
I am setting te BrowsableAttribute = false  on a base class's Identifier's property .  In my example.. I have a nested property 2 levels deep that I want to show in the PropertyGrid (see attached image).   Here is some psudocode that describes the makeup of my class structutre that is bound to the PropertyGrid

BaseItem 
{
    [Browsable(False)]
    Guid ID;
    String Name;
}

ClassA: BaseItem
{
    NestedPropertyTypeA NestedProperty;
}

NestedPropertyType: BaseItem
{
    NestedSubPropertyTypeA SubPropertyA;
    NestedSubPropertyTypeB SubPropertyB;
}

NestedSubPropertyTypeA: BaseItem
{
   // Browsable ingored here for BaseItem.ID's property
}

NestedSubPropertyTypeB: BaseItem
{
   // Browsable ingored here too
}

We are using Q1 2012 release, build 326
Maya
Telerik team
 answered on 24 Apr 2012
0 answers
52 views

This is how my header looks like

                     Header 1                                                Header 2                             Header 3             
Header 1.1      Header 1.2    Header 1.3              Header 2.1 Header 2.2               Header 3               

Now how could i freeze the First two Header1 and Header2.
<ClientSettings>
 <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="2">
 </Scrolling>
 </ClientSettings>

this does not work.
Any help will be appreciated.
Thanks,
Praveen
Praveen
Top achievements
Rank 1
 asked on 23 Apr 2012
1 answer
114 views
I have a grid that is populated  with a List<DataRow>
The issue I am having is on Selection Changed even how do I return the value in the first column, HolderID' of the selected row?
Eric Klein
Top achievements
Rank 1
 answered on 23 Apr 2012
2 answers
120 views
HI,

I am using Telerik grid and i have a requirement that i can change the order of the columns by drag and drop. I want to save and restore the order of the Column Headers at Runtime. Does Telerik Grid provide any facility to save and restore the Column Headers?Any help would be appriciated.

Thanks,
Priyesh Dubey 
Mehmet
Top achievements
Rank 1
 answered on 23 Apr 2012
2 answers
117 views
Hi
In order to add some hidden "meta data" to our RadDocuments
we decided to derive the Section class and add

public class EditorSection : Section
    {
        private ObservableCollection<Metadata> _metadata = new ObservableCollection<Metadata>();
        //[XamlSerializable]
        public ObservableCollection<Metadata> Metadata
        {
            get { return _metadata; }
            set { _metadata = value; }
        }
    }


Now we can create documents in XAML such as:
<c:EditorSection>
<c:EditorSection.Metadata>
 <c:Metadata Name="DocumentId" Value="{00000-..-..-..}" />
 <c:Metadata Name="Owner" Value="JohnWSmith" />
</c:EditorSection.Metadata>
<t:Paragraph>
<t:Span Text="Hi">
</t:Span>
</t:Paragraph>
</c:EditorSection>

However when saving the Document with XamlFormatProvider
the Metadata stuff is removed.

When Debugging my metadata class I can see a two instances
are created and the two props are assigned on load.

When I try an add the [XamlSerializable] attribute to my property
and also to the properties of the MetaData class
I get an runtime XamlParseException on loading the document:
Can't convert object of type "System.String" to "ObservableCollection<MyNameSapce.MetaData>"
The line in question is:

Telerik.Windows.Documents.FormatProviders.Xaml.XamlFormatProvider.Import(String input) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Documents\FormatProviders\Xaml\XamlFormatProvider.cs:Line 126.

So it seems the XamlFormatProvider can't deal with the markup properly.
Is there a way to "tell" the XamlFormatprovider how (de)serialize my meta data collection
Do I need to specify a typeconverter or value converter also?

Thanks
Christoph
Top achievements
Rank 1
 answered on 23 Apr 2012
3 answers
145 views
Hi,
In my application, i am trying to view the contents in the gridview in the form of print preview dialog. 
I downloaded code from  http://www.telerik.com/community/code-library/wpf/gridview/radgridview-print-and-print-preview.aspx 
The print preview window showing the grid values.  But at the end of each page, bottom of the line, the last row data was partially cut in one page and remaining in next page. Please find the attached image. 

 Am i missing any settings?

Thanks,
Vinodh
Dimitrina
Telerik team
 answered on 23 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?