Telerik Forums
UI for WPF Forum
2 answers
164 views
Hi,

As i was trying to create user control(Filtering) and want to attache with RAD GRID. Perhaps it's done but my events for Filtering is not getting fired. Can any one provide a small example for this with source code.
Krishna
Top achievements
Rank 1
 answered on 08 Dec 2011
1 answer
80 views
Hi,

I was asked to implement feature to find values in grid (user wants to see all rows so i cant use filters)
user wants (picture)
(1) field to input search text
(2) button to find all rows (kind of bookmark)
(3) button to iterate in find items (find next)

is there built in Search in grid (without filters) ?
I made this feature with this code:
private void btnFind_Click(object sender, RoutedEventArgs e)         {             btnFind.IsEnabled = false;             scrollIntoFindIndex = 0;             string searchText = txtFind.Text;             dgDynGrid.SelectedItems.Clear();             foreach (object o in dgDynGrid.Items)             {                 if (o is DataRowView)                 {                     for (int z = 0; z < (o as DataRowView).Row.ItemArray.Count(); z++)                     {                         try                         {                             string t = (o as DataRowView).Row.ItemArray[z].ToString();                             if (t.IndexOf(searchText, StringComparison.InvariantCultureIgnoreCase) >= 0)                             {                                 dgDynGrid.SelectedItems.Add(o);                                 break;                             }                         }                         catch                         {                             //if it cant be converted to string, i will not find in this field                         }                     }                 }             }             btnFind.IsEnabled = true;             ScrollIntoFind(0);         }         int scrollIntoFindIndex = 0;         private void ScrollIntoFind(int i)         {             if (dgDynGrid.SelectedItems.Count > i)             {                 dgDynGrid.ScrollIntoView(dgDynGrid.SelectedItems[i]);             }             else             {                 scrollIntoFindIndex = 0;                 MessageBox.Show("Završila je pretraga, idučim klikom se pretražuje od početka""Kraj pretrage"MessageBoxButton.OK, MessageBoxImage.Information);             }         }         private void btnFindNext_Click(object sender, RoutedEventArgs e)         {             scrollIntoFindIndex++;             ScrollIntoFind(scrollIntoFindIndex);         }

but I am sure there must be better way to do this.
I would appreciate any hint

Thank you

Nedyalko Nikolov
Telerik team
 answered on 08 Dec 2011
1 answer
150 views
I would like to disable editing action (editing appointment via double click). How to acomplish that?

I tried with:       
private void RadScheduler_AppointmentEditing(object sender, AppointmentEditingEventArgs e)
        {
            e.Cancel = true;
        }

but it doesnt work.
Boyan
Telerik team
 answered on 08 Dec 2011
1 answer
148 views
  Hi,

I need to maintain scroll position (both horizontal and vertical) when moving across pages.
I tried the following code , but was unable to achieve the desired functionality.
Even after calling RestoreScrollPosition() the scrollviewer didn't change its position.




private void btnNext_Click(object sender, RoutedEventArgs e)



{

SetScrollPosition();
BindData();

RestoreScrollPosition();







}







private void SetScrollPosition()



{



GridViewScrollViewer svSummaryInfo = (GridViewScrollViewer)rtSummaryInfo.FindChildByType<GridViewScrollViewer>();








_dbVerticalOffset = svSummaryInfo.VerticalOffset;
_dbHorizontalOffset = svSummaryInfo.HorizontalOffset;
}




private



void RestoreScrollPosition()



{


GridViewScrollViewer



svSummaryInfo = (GridViewScrollViewer)rtSummaryInfo.FindChildByType<GridViewScrollViewer>();





if (svSummaryInfo != null)



{



svSummaryInfo.ScrollToHorizontalOffset(_dbHorizontalOffset);

svSummaryInfo.ScrollToVerticalOffset(_dbVerticalOffset);

}
}

Please provide a code snippet for the same.
Nedyalko Nikolov
Telerik team
 answered on 08 Dec 2011
0 answers
109 views
Hi Team,
I am using radDatafilter with custom inputs (date picker, combobox, checkbox), but i am unable to fire events when Input data changes. For example if user input is check box, then no event fire, similarly no event for  combobox selection change, i cant catch any event. kindly guide me raddatafilter event.
I posted some threads earlier, kindly consider that. Urgent response is highly appreciated.
Kamran
Top achievements
Rank 3
Iron
Iron
Veteran
 asked on 08 Dec 2011
5 answers
471 views
I'm trying to figure out a good way to get a theme applied at design time. I followed someones suggestion to create a class like this and added it to the resources in my App.xaml.
public class TelerikThemeManager : DependencyObject
{
    public TelerikThemeManager()
    {
        StyleManager.ApplicationTheme = new MetroTheme();
    }
}

I'm getting this error with RadExpander when i have that in place. The (few) other controls seem to be fine. Is there a good way of getting design time theme support application wide?

Cannot freeze this Storyboard timeline tree for use across threads.
   at System.Windows.Media.Animation.BeginStoryboard.Seal()
   at System.Windows.TriggerAction.Seal(TriggerBase containingTrigger)
   at System.Windows.TriggerActionCollection.Seal(TriggerBase containingTrigger)
   at System.Windows.TriggerBase.Seal()
   at System.Windows.Trigger.Seal()
   at System.Windows.TriggerCollection.Seal()
   at System.Windows.StyleHelper.SealTemplate(FrameworkTemplate frameworkTemplate, Boolean& isSealed, FrameworkElementFactory templateRoot, TriggerCollection triggers, ResourceDictionary resources, HybridDictionary childIndexFromChildID, FrugalStructList`1& childRecordFromChildIndex, FrugalStructList`1& triggerSourceRecordFromChildIndex, FrugalStructList`1& containerDependents, FrugalStructList`1& resourceDependents, ItemStructList`1& eventDependents, HybridDictionary& triggerActions, HybridDictionary& dataTriggerRecordFromBinding, Boolean& hasInstanceValues, EventHandlersStore& eventHandlersStore)
   at System.Windows.FrameworkTemplate.Seal()
   at System.Windows.FrameworkTemplate.System.Windows.ISealable.Seal()
   at System.Windows.StyleHelper.SealIfSealable(Object value)
   at System.Windows.ResourceDictionary.SealValue(Object value)
   at System.Windows.ResourceDictionary.RealizeDeferContent(Object key, Object& value, Boolean& canCache)
   at System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
   at System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
   at System.Windows.DeferredThemeResourceReference.GetValue(BaseValueSourceInternal valueSource)
   at System.Windows.DependencyPropertyChangedEventArgs.get_NewValue()
   at System.Windows.Controls.Control.OnTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
   at System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject container, FrugalStructList`1& exclusionContainerDependents, FrugalStructList`1& oldContainerDependents, FrugalStructList`1& newContainerDependents)
   at System.Windows.StyleHelper.DoThemeStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldThemeStyle, Style newThemeStyle, Style style)
   at System.Windows.StyleHelper.UpdateThemeStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldThemeStyle, Style newThemeStyle, Style& themeStyleCache)
   at System.Windows.FrameworkElement.OnThemeStyleChanged(DependencyObject d, Object oldValue, Object newValue)
   at System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce)
   at System.Windows.FrameworkElement.UpdateThemeStyleProperty()
   at System.Windows.FrameworkElement.OnThemeStyleKeyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.RadExpander.SetDefaultStyleKey() in c:\TB\102\WPF_Scrum\Current_HotFix\Sources\Development\Core\Controls\Expander\RadExpander.cs:line 577
   at Telerik.Windows.Controls.RadExpander.OnInitialized(EventArgs e) in c:\TB\102\WPF_Scrum\Current_HotFix\Sources\Development\Core\Controls\Expander\RadExpander.cs:line 571
   at System.Windows.FrameworkElement.TryFireInitialized()
   at System.Windows.FrameworkElement.EndInit()
   at Microsoft.Expression.DesignModel.InstanceBuilders.ClrObjectInstanceBuilder.EndInit(IInstanceBuilderContext context, ViewNode viewNode, DocumentCompositeNode compositeNode, ISupportInitialize supportInitialize)
   at Microsoft.Expression.DesignModel.InstanceBuilders.ClrObjectInstanceBuilder.InstantiateProperties(IInstanceBuilderContext context, ViewNode viewNode, DocumentCompositeNode compositeNode)
   at Microsoft.Expression.DesignModel.InstanceBuilders.ClrObjectInstanceBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
   at Microsoft.Expression.Platform.WPF.InstanceBuilders.FrameworkElementInstanceBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
   at MS.Internal.Services.DesignModeValueProviderService.DesignModeValueProviderBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
   at Microsoft.Expression.DesignModel.Core.ViewNodeManager.Instantiate(ViewNode viewNode)

Rayne
Top achievements
Rank 1
 answered on 07 Dec 2011
8 answers
198 views
HI there,
I have a WPF application with MVVM. My main view has a RadDocking with multiple documents (MDI). The RadPanes are implicitly created through a coupling of the ViewModel with the RadDocking (I use the RadPaneGroupExtension from another forum post).
My RadDocking looks like this:

<Controls:RadDocking.DocumentHost>
    <Controls:RadSplitContainer>
        <Controls:RadPaneGroup Name="OpenEntities" local:PaneGroupExtensions.ItemsSource="{Binding OpenDocs}">
            <local:PaneGroupExtensions.ItemContentTemplate>
                <DataTemplate DataType="{x:Type ReferenceViewModels:DepartmentViewModel}">
                    <views:DepartmentView />
                </DataTemplate>
            </local:PaneGroupExtensions.ItemContentTemplate>
DepartmentView contains some Textboxes.
Unfortunately, the TextBoxes are readonly if instantiated this way. If I place the DepartmentView at another place (e.g. in a hardcoded RadPane in the above code), it works.

Since I have no clue where to search is any hint appreciated.

Regards

Mat
Ivo
Telerik team
 answered on 07 Dec 2011
1 answer
80 views
I Have an asset with with a name, that contains  a value for each day (in  7 days)
List <ChartData>list = xData.GetData(DateTime.FromOADate(40839), DateTime.FromOADate(40846),  assetName);
so here i am saving for each asset the day, the name and the value it has on that day

no i want to make a stackedbar, where the value for each asset is given on day 12/1/2011, so i want all assets like
xbox, telephone, tv, .. give a value in a stackedbar for 12/1/2011 in the stackedbar chart.

How can i do this, 

this is what i tried

List<ChartTot> data = new List<ChartTot>();
 
XMLData xData = new XMLData();
XMLData xData2 = new XMLData();
 
data.Add(new ChartTot(xData.GetData(DateTime.FromOADate(40839), DateTime.FromOADate(40846), "Stereo")));
data.Add(new ChartTot(xData2.GetData(DateTime.FromOADate(40839), DateTime.FromOADate(40846), "Gas")));
 
radChart1.ItemsSource = data;
public class ChartTot
   {
       private List<ChartData> cd = new List<ChartData>();
 
       public ChartTot(List<ChartData> list)
       {
           this.cd = list;
       }
   }
public class ChartData
  {
      public String Naam { get; set; }
      public double Waarde { get; set; }
      public DateTime DezeW { get; set; }
 
 
 
      public ChartData()
      {
      }
}
 

(xData.GetData(DateTime.FromOADate(40839), DateTime.FromOADate(40846), "Stereo")
this gives me a list from ChartData class, and i put it in a List of ChartTot.

the itemsSource contains a list (ChartTot) that contains a list of ChartData

But i get no chart ???
Petar Marchev
Telerik team
 answered on 07 Dec 2011
4 answers
147 views
Hi Team,

I was going through your documnet described in this blog post here. (Export to PDF in Help for Rad Chart)

Here when a chart we need to export is not in visual tree, we create a new RadChart and add the series mapping to it and export it.
But in my case I'm not using the DefaultView of RadChart, because I need to have a grid inside my chart area. So the modified RadChart I created in Xaml and using the same.
Now what I'm trying to do is I'm assigning the DataSeries to the chart I have in xaml (not creating a new one as in your example), and creating my chart. Now when I try to export it using ExportToImage, it throws an exception of null reference.

Is it not possible to export the chart which I have an updated view in xaml, when its not visible in the UI, by assigning the DataSeries as explained in your example (ex: not visible in visual tree)?

Please reply soon.

Thanks.

Manishkumar
Top achievements
Rank 1
 answered on 07 Dec 2011
1 answer
66 views
I've been struggling to create a stacked bar chart with that will display the following data:



I realize that since the columns (years) are dynamic that i must create the chart in codebehind. However, I've been lost with trying to figure out how to loop through the data (in the form of a datatable, that looks exactly like the grid in the screenshot above) and what item mappings and/or groupsettings to specifiy.  Any help with figuring this out would be most appreciated! Thanks

Tsvetie
Telerik team
 answered on 07 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?