Telerik Forums
UI for WPF Forum
1 answer
120 views
I am trying to make the background color of the first row in my grid blue. here is what I am trying in c#.

 for (int i = 0; i < rgvAlarmLog.ColumnCount; i++)
                            {
                                rgvAlarmLog.Rows[rowCount].Cells[i].Value = HeaderRowSplit[i];
                                rgvAlarmLog.Rows[rowCount].Cells[i].Style.BackColor = System.Drawing.Color.Black;
                            }

I have another loop that goes through the rows and that is the rowcount variable. There is no visible color change when I do this. What am I doing wrong? It is a radgridview object. I have looked at similar post and tried their code to no avail. Any advice? Thanks
Vlad
Telerik team
 answered on 20 Apr 2012
2 answers
204 views
Hi,

I'm trying to implement a copy function.

In XAML I did the following:
<telerik:RadButton Command="telerik:RadDataFormCommands.AddNew" CommandTarget="{Binding ElementName=df}"
        ToolTip="Copy" CommandParameter="copy">
<telerik:RadButton.Content>
   <Image Source="Images/Copy.png"/>
</telerik:RadButton.Content>
</telerik:RadButton>


How can I get access to the CommandParameter "copy" in the code-behind so that I can determine that a copy is needed instead of a regular AddNew?

Thanks in advance
Bernard Grosperrin
Top achievements
Rank 1
 answered on 19 Apr 2012
2 answers
203 views
I can't seem to get the DataForm to sync with the GridView.

I've got both controls bound via ItemsSource to the same collection in my viewmodel. But when the form loads in debug, there doesn't appear to be any records. If I create a header for the DataForm that displays Items.Count, it correctly shows the number of Items in the collection. But the current item isn't working. When I click on a Navigation button or the new button, I get the following error:

System.Reflection.TargetParameterCountException occurred
  Message=Parameter count mismatch.
  Source=mscorlib
  StackTrace:
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
       at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
       at Telerik.Windows.Data.ItemPropertyInfoExtensions.GetValue(ItemPropertyInfo itemProperty, Object item) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\ItemProperties\ItemPropertyInfoExtensions.cs:line 101

Call Stack:
 > Telerik.Windows.Data.dll!Telerik.Windows.Data.ItemPropertyInfoExtensions.GetValue(System.ComponentModel.ItemPropertyInfo itemProperty, object item) Line 101 C#
  Telerik.Windows.Controls.Data.dll!Telerik.Windows.Controls.RadDataForm.PopulatePropertiesInitialValues(object currentItem) Line 886 C#
  Telerik.Windows.Controls.Data.dll!Telerik.Windows.Controls.RadDataForm.OnCurrentItemChanged(System.Windows.DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs args) Line 854 C#
  [External Code]
  Telerik.Windows.Controls.Data.dll!Telerik.Windows.Controls.RadDataForm.CurrentItem.set(object value) Line 829 C#
  Telerik.Windows.Controls.Data.dll!Telerik.Windows.Controls.RadDataForm.OnItemsCurrentChanged(object sender, System.EventArgs e) Line 791 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.DataItemCollection.OnCurrentChanged(System.EventArgs e) Line 489 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.DataItemCollection.OnCollectionViewCurrentChanged(object sender, System.EventArgs args) Line 557 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.Listener<System.ComponentModel.ICollectionView,System.EventArgs>.ReceiveWeakEvent(object sender, System.EventArgs args) Line 43 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.WeakEvent.WeakListener<System.EventArgs>.Handler(object sender, System.EventArgs args) Line 33 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.OnCurrentChanged(System.EventArgs args) Line 141 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.MoveCurrentToPositionCore(int position) Line 110 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.MoveCurrentToPosition(int position) Line 97 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.MoveCurrentTo(object item) Line 46 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.AddNewInternal(object newItem) Line 462 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.AddNew(object newItem) Line 281 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.AddNew() Line 248 C#
  Telerik.Windows.Data.dll!Telerik.Windows.Data.DataItemCollection.AddNew() Line 82 C#
  Telerik.Windows.Controls.Data.dll!Telerik.Windows.Controls.RadDataForm.AddNewItem() Line 1715 C#
  Telerik.Windows.Controls.Data.dll!Telerik.Windows.Controls.RadDataForm.OnAddNew(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) Line 108 C#
  [External Code]
  Telerik.Windows.Controls.dll!Telerik.Windows.Controls.RadButton.OnClick() Line 388 C#
  [External Code]


Please help. I get the same error when I set the DataForm in the RowDetailsTemplate for the grid. in this situation it is triggered when I click on an item in the grid to select it and it tries to show the row details.
Jeff
Top achievements
Rank 1
 answered on 19 Apr 2012
2 answers
115 views
What are the possible Command Parameters for the the Align Command?

So far I have found the following:
  • Left
  • Right
  • Top
  • Bottom
  • Center
  • Middle

Are there any others?

P.S. Is there a date for when the Diagram control will be out of Beta?
Eric
Top achievements
Rank 1
 answered on 19 Apr 2012
0 answers
63 views
Hi,

still the same Problem. i get all my Appointments from a sqlite DB. To Create a simple Appointment is no Problem,, but how do i add a
RecurrenceRule to an Appointment?

I create a var called Pattern:
var Pattern = new RecurrencePattern()
    {
           DayOrdinal = DayOrdinal_i,
           DaysOfWeekMask =DaysofWeekMask_v,
           FirstDayOfWeek = FirstDayofWeek_d,
           Frequency= Frequency_v,
            Interval = Convert.ToInt32(tasks_dr.Field<Int64>("Interval")),
            MaxOccurrences = Convert.ToInt32(tasks_dr.Field<Int64>("MaxOccurrences")),
            MonthOfYear = Convert.ToInt32(tasks_dr.Field<Int64>("MonthofYear")),
            DayOfMonth = Convert.ToInt32(tasks_dr.Field<Int64>("DayofMonth"))
      };

Then i start to create the Appointment:
Appointment appointment = new Appointment
      {
            Start = start,
            Url = "text",
            End = end,                                                     
            Subject = tasks_dr.Field<String>("Subject"),
            Body = tasks_dr.Field<String>("Body"),                           
             Importance = Importance_v
             //RecurrenceRule = rrr
       };

But how will the Appointment now about the var Pattern?

I can't find any example or something on the help Page :-(((

Thanks
Rene
ITA
Top achievements
Rank 1
 asked on 19 Apr 2012
1 answer
81 views
The provided code to serialize a RadGridView with the PF will fail if the column header is not specified. I normally don't specify a column for the row details toggle columns.
Alex Fidanov
Telerik team
 answered on 19 Apr 2012
1 answer
119 views
I need to some help regarding the chart. I need to show clustered bar chart and have to add series dynamically. Below is my code that builds the chart..
=======================================================================================================
                    List<ChartDispayView> lineResultsList = new List<ChartDispayView>();
                    locChart.SeriesMappings.Clear();
                    
                    foreach (var line in vmRef.ChartLineMasterCollection)
                    {
                        if (line.IsChecked)
                        {
                            lineResultsList.AddRange(this.BuildLineViewChartData(line.LineName, vmRef.ChartResultsCollection.ToList()));

                            SeriesMapping sm = new SeriesMapping() { LegendLabel = line.LineName };
                            sm.ItemMappings.Add(new ItemMapping("PercentageLineOccupation", DataPointMember.YValue));
                            sm.ItemMappings.Add(new ItemMapping("Years", DataPointMember.XCategory));
                            sm.SeriesDefinition = new BarSeriesDefinition() { ShowItemLabels = true, ShowItemToolTips = true };
                            locChart.SeriesMappings.Add(sm);
                        }
                    }

                    locChart.ItemsSource = lineResultsList;
=======================================================================================================



It shouldn't create overwrite existing series.

Please guide me what i am doing wrong in the code and how to fix this issue.

Thanks
Ves
Telerik team
 answered on 19 Apr 2012
4 answers
597 views

Using namespace:  xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

The InvertedCooleanConverter has the following error:

Error 710 Ambiguous type reference. A type named 'InvertedBooleanConverter' occurs in at least two namespaces, 'Telerik.Windows.Controls' and 'Telerik.Windows.Controls.Docking'. Consider adjusting the assembly XmlnsDefinition attributes.

<telerik:RadMenuItem.IsChecked>
    <Binding Path="IsPinned">
        <Binding.Converter> 
            <telerik:InvertedBooleanConverter/>
        </Binding.Converter>
    </Binding>
</telerik:RadMenuItem.IsChecked>

How to fix?

Thanks,
Kellie

Rich Reuter
Top achievements
Rank 1
 answered on 19 Apr 2012
3 answers
467 views
Hi,

How do I determine the current docked position of a RadSplitContainer?

I have content in a RadPane that I want to format depending on the current docked position of the pane in the RadSplitContainer (for example, a horizontal format when docked to the top or bottom and a vertical format when docked to the left or right and changing the ExpandDirection of expanders to match the current docked position). I've noticed there is a Friend property "State" that seems to contain the current docked position, however this property is not accessible publicly. What is the best way to obtain this information? (A dirty way would be to subclass RadSplitContainer and expose the State property publicly, but it feels like a particularly dirty way to get to this information).

Kind regards,
Dave.
Konstantina
Telerik team
 answered on 19 Apr 2012
1 answer
345 views
Hello,

I am trying to do what I thought would be a simple implementation of the RadTransition and running into technical difficulties. I am building a kiosk app for us to use for a week. I load the main window with a grid and a frame in the grid. The frame source gets set to my *Start PAGE* which has 4 buttons on it. When I start the app the window loads (although you don't see it) and then the frame loads the start page. When a button is clicked on the start page in the event handler I want to get back to the main window frame where my RadTransition is and change the source to the page that corresponds to button clicked.As per your demo I use the SiteMap and SitePage models.

Now I would gladly add the new page to the SitePage and then Call SiteMap.SelectNextPage but I can't get a handle to it. I would update the source of the frame in the parent window but I can't get a handle to it either. So how do I go about getting the RadTransition to switch pages in WPF app?

Also I am not asking you to do my homework I just need to be pointed in the right direction.

TIA
JB

Tried uploading but the project too large so making a mock up for you to see. OK attached mock example....guess not. Can't upload zip to the forum. I put it here: http://www.gpgvm.org/wpfapplication1.zip
Ivo
Telerik team
 answered on 19 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?