Telerik Forums
UI for WPF Forum
1 answer
69 views
Sorry guys, as it turns out someone had forgotten to put Mode=TwoWay in our control wrapper's consumer code.
Maya
Telerik team
 answered on 05 May 2011
1 answer
183 views
Hi!
We're testing telerik maps trying to know if we can develop our requirements with them. We have found an error / incompatibility that we can not understand. We installed Dbf Viewer 2000 (trial) because we need to modify DBF files.
Dbf Viewer 2000 creates an association to Dbf Files that causes telerik maps (the ones that use data source files) to crash. The exception is this:

No se controló System.ArgumentException
  Message=Un símbolo (token) no es válido. Consulte RFC 2616 para corregir el tipo de gramática o contenido.
  Source=WindowsBase
  StackTrace:
StackTrace:
       en MS.Internal.ContentType.ValidateToken(String token)
       en MS.Internal.ContentType.ParseTypeAndSubType(String typeAndSubType)
       en MS.Internal.ContentType..ctor(String contentType)
       en MS.Internal.MimeTypeMapper.GetMimeTypeFromUrlMon(Uri uriSource)
       en MS.Internal.MimeTypeMapper.GetMimeTypeFromUri(Uri uriSource)
       en MS.Internal.AppModel.ResourcePart.GetContentTypeCore()
       en System.IO.Packaging.PackagePart.get_ContentType()
       en MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
       en System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
       en System.IO.Packaging.PackagePart.GetStream()
       en System.Windows.Application.GetResourceStream(Uri uriResource)
       en Telerik.Windows.Controls.Map.MapShapeReader.ReadData(Uri dataUri, ShapeReaderStatus userState)
       en Telerik.Windows.Controls.Map.MapShapeReader.Read(Uri uri, Uri dataUri)
       en Telerik.Windows.Controls.Map.MapShapeReader.Read()
       en Telerik.Windows.Controls.Map.MapShapeReader.StartRead()
       en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       en MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       en System.Windows.Threading.DispatcherOperation.InvokeImpl()
       en System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       en System.Threading.ExecutionContext.runTryCode(Object userData)
       en System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       en System.Windows.Threading.DispatcherOperation.Invoke()
       en System.Windows.Threading.Dispatcher.ProcessQueue()
       en System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       en MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       en MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       en MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       en System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       en MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       en MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       en System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       en System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       en System.Windows.Threading.Dispatcher.Run()
       en System.Windows.Application.RunDispatcher(Object ignore)
       en System.Windows.Application.RunInternal(Window window)
       en System.Windows.Application.Run(Window window)
       en System.Windows.Application.Run()
       en XXXXXXXXXXXXXXXXXXXXXX.App.Main() en XXXXXXXXXXXXXXXXXXXXXX\obj\x86\Debug\App.g.cs:línea 0
       en System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       en System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       en Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       en System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       en System.Threading.ThreadHelper.ThreadStart()

We have found that this is happening only when relative uri to resource is used. If we remove folder .dbf in HKEY_CLASSES_ROOT of registry maps don't crash.

We can not use absolute paths and we can not control the software installed on client's computers so there is a risk that maps crashes with any software doing the same with data source files.

You can try this with telerik demos.
Andrey
Telerik team
 answered on 05 May 2011
1 answer
195 views
Hi,

I have a grid like:

<telerik:RadGridView Name="patientsGridView" SelectionMode="Extended" ItemsSource="{Binding Patients}" SelectedItem="{Binding SelectedPatient}" AutoGenerateColumns="False" IsReadOnly="True" MouseDoubleClick="patientsGridView_MouseDoubleClick" RowIndicatorVisibility="Collapsed" SelectionChanged="patientsGridView_SelectionChanged" GroupPanelStyle="{DynamicResource GridViewGroupPanelStyle1}" >                      
    <telerik:RadGridView.Columns>

<!-- IsActiveGroup -->
<telerik:GridViewDataColumn DataMemberBinding="{Binding IsActiveGroup}" >
<telerik:GridViewDataColumn.FilteringControl>
<GridView:FilteringControl Style="{DynamicResource FilteringControlStyle}"/>
</telerik:GridViewDataColumn.FilteringControl>
<telerik:GridViewDataColumn.Header>
<TextBlock Text=" " ToolTip="{lex:LocText S3.ParametersUE.PatientManagement:UIStrings:PatientListView_PatientGridColumnIsActiveToolTip}"/>
</telerik:GridViewDataColumn.Header>
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding Path=IsActiveImageSource, Converter={StaticResource imgConverter}}" Stretch="UniformToFill" RenderOptions.BitmapScalingMode="HighQuality" Width="20" Height="20" ToolTip="{Binding IsActiveGroup}" />
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
 <!-- HasWarningGroup -->
<telerik:GridViewDataColumn DataMemberBinding="{Binding HasWarningGroup}" >
<telerik:GridViewDataColumn.FilteringControl>
<GridView:FilteringControl Style="{DynamicResource FilteringControlStyle}"/>
</telerik:GridViewDataColumn.FilteringControl>
<telerik:GridViewDataColumn.Header>
<TextBlock Text=" " ToolTip="{lex:LocText S3.ParametersUE.PatientManagement:UIStrings:PatientListView_PatientGridColumnHasWarningToolTip}"/>
</telerik:GridViewDataColumn.Header>
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding Path=HasWarningImageSource, Converter={StaticResource imgConverter}}" Stretch="UniformToFill" RenderOptions.BitmapScalingMode="HighQuality" Width="20" Height="20" ToolTip="{Binding HasWarningGroup}" />
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>

etc...

I need the width of the grid - but ActualWidth is always 0. How can I get the width of the grid?





Ivan Ivanov
Telerik team
 answered on 05 May 2011
1 answer
60 views
Hello everybody,

is there a way to identify the RadPaneGroup which is positioned in the lower left corner of the docking area? In my application this is the place where dynamically added pane should be shown.

I already read in another thread that the method RadDocking.GetDockState does not work properly.

Kind regards

Uli
George
Telerik team
 answered on 05 May 2011
1 answer
118 views
Hi there,
    I am looking for a way to bind a collection of objects inside a TreeListView Grid column. I am able to bind to all of the objects in my hierarchy and have them displayed correctly in the TreeListView Grid. My Object model is something like this

NoteObject
        Text
        DateCreated
        DateModified
        Collection of Sub Notes ( of type Note )
        Collection of Flag Objects

Flag Object
       text
        type
    

The TreeListView Grid correctly displays the object hierarchy but I do not seem to be able to bind to the collection of Flag Objects. I would also like to use a converter on the Flag objects to change the background color of the cell based on the Flag Type. Could you send me an example of how to do this?

Thanks
Ivan Ivanov
Telerik team
 answered on 05 May 2011
2 answers
670 views
Hello,

I have pretty much the same problem describe in that post : http://www.telerik.com/community/forums/wpf/gridview/rowdetailstemplate-and-text-wrapping.aspx .

Inside my RowDetails I have a control with some textblocs (set to warp). I dont want the horizontal scrollbar, to make my textblock warp.

The difference with the previous link is that I dont want to set the RadGridView width to a constant value. (to follow the window size)

I want the RowDetails width to be the same as the RadGridView width. I've set the ScrollViewer.HorizontalScrollBarVisibility= to "Disabled"

So I tried to bind the MaxWidth of my control inside the RowDetails value with RadGridView but it doesnt work (textblocs don't warp and horizontal scrollbar is still on)

this is my code :

<telerikGrid:RadGridView x:Name="MRUList" 
            ItemsSource="{Binding MRUSupplierItems, Mode=TwoWay}"  
            SelectedItem="{Binding CurrentSelectedSupplierItem, Mode=TwoWay}"
            Grid.Row="1" d:LayoutOverrides="Width" VerticalAlignment="Top"
            IsSynchronizedWithCurrentItem="True" 
            RowIndicatorVisibility="Collapsed" ShowGroupPanel="False" IsFilteringAllowed="False"
            AutoGenerateColumns="False" CanUserInsertRows="False" RowDetailsVisibilityMode="Collapsed"
            IsReadOnly="True" CanUserDeleteRows="True"
            CanUserFreezeColumns="False" Margin="2,2,2,0" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
         >
            <telerikGrid:RadGridView.Columns>
                <telerikGrid:GridViewDataColumn Header="{Binding Resource.GridTitleBrandName, Source={StaticResource Resource}}" UniqueName="PriceList_Name" DataMemberBinding="{Binding PriceList_Name}" IsSortable="True"/>
                <telerikGrid:GridViewDataColumn Header="{Binding Resource.GridTitleProductRef, Source={StaticResource Resource}}" UniqueName="Reference" DataMemberBinding="{Binding Reference}" IsSortable="True"/>
                <telerikGrid:GridViewDataColumn Header="{Binding Resource.GridTitleProductName, Source={StaticResource Resource}}" Width="*" UniqueName="Name" DataMemberBinding="{Binding Name}" IsSortable="True" />
                <telerikGrid:GridViewDataColumn Header="{Binding Resource.GridTitleProductPrice, Source={StaticResource Resource}}" UniqueName="Price" DataMemberBinding="{Binding PublicPrice}" IsSortable="True" />
            </telerikGrid:RadGridView.Columns>
              
            <telerikGrid:RadGridView.RowDetailsTemplate>
                <DataTemplate x:Name="RowDetailsProvider">
                    <local:SupplierItemUserControl 
                        MaxWidth="{Binding Width, ElementName=MRUList}"
                        AddItemToQuotationCommand="{Binding ElementName=ElytecMRUUC, Path=DataContext.AddItemToQuotationCommand, Mode=TwoWay}"
                        AddItemToCartCommand="{Binding ElementName=ElytecMRUUC, Path=DataContext.AddItemToCartCommand, Mode=TwoWay}"
                        DisplayAddToCart="True"
                        DisplayAddToQuotation="{Binding IsCurrentQuotationAvailable, Mode=OneWay}"
                        DisplayRemoveFromCart="False"
                    />
                </DataTemplate>
            </telerikGrid:RadGridView.RowDetailsTemplate>
              
        </telerikGrid:RadGridView>

Thanks for your help!

Regards.
Jean
Top achievements
Rank 1
 answered on 05 May 2011
1 answer
136 views
Hello Telerik Team,

I have a RadOutlookBar, in which is currently one view that inherits from RadOutlookBarItem. In that view I overrided the OnIsSelectedChanged-Method from RadOutlookBarItem.
In the view, that contains the RadOutlookBar-Control, I added an eventhandler to the event PreviewSelectionChanged. So when I started the Application with the View, following methods are called:

1. OnIsSelectedChanged of the RadOutlookBarItem (oldvalue=false, newvalue=true)
2. The event PreviewSelectionChanged of the RadOutlookBar is fired (and certainly my eventhandler is called)

And if SelectionChangedEventArgs.Handled is set to true
3. OnIsSelectedChanged of the RadOutlookBarItem(oldvalue=true, newvalue=false)

Why is OnIsSelectedChanged called before the PreviewSelectionChanged-Event is fired?

Further Question:
If I click on the unselected OutlookBarItem, at first PreviewSelectionChanged from OutlookBar ist fired, if the Handled-Property is set to true, the OnIsSelectedChanged-Method of the Item ist called twice (first time with newValue = false, the second time with newValue = true)

Why is the OnIsSelectedChanged-Method called twice?
Hristo
Telerik team
 answered on 05 May 2011
1 answer
78 views

Hi,

We are currently implementing automated UI testing and would like to know if there has been any progress on the automation support for the RadTreeListView in the upcoming May 12th release.  Please reference http://www.telerik.com/community/forums/wpf/treelist/radtreelistview-automation-testing.aspx for any additional information.

Thanks,

Greg

Yordanka
Telerik team
 answered on 05 May 2011
8 answers
226 views
Hello.

We have a bug that's arisen with a couple of GridViews. In each row, we have a number of columns. One of these columns, let's call it Column X, has a CellStyle that contains a DataTrigger to start a storyboarded animation for a cell's colour based on it's contents. Clearly, this animation is only meant to occur on cells in this particular column, but unfortunately, when the GridView is scrolled horizontally, the colour animation begins to play on cells in other columns in the row. Output from Snoop seems to suggest that the defined CellStyle on Column X is being erroneously retained somewhere and used as a default style for cells in other columns as they are dynamically created and destroyed, or perhaps reused, during the scrolling. The fact that the animation only starts on other columns when Column X is scrolled out of view seems to support this.

I have attempted to fix it by setting normal CellStyles on all of our other columns, but this hasn't alleviated the problem.

Is this an issue that has been observed before? Is there a solution, or perhaps some more steps that I can take to try to fix it?

Thanks,
- Chris M.
ChrisM
Top achievements
Rank 1
 answered on 05 May 2011
1 answer
139 views
I'm creating a windows explorer-like application using a treeview control. When a user double clicks a treeview item, it reloads the treeview with the new directory and its subfolders and files. Works fine. 

I tried to add a progress bar to it and have it update using the backgroundworker object, like this msdn example:
http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx

using this code for the mouse double click event of the treeview items:
private void tvDirectory_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
 
    RadTreeViewItem item = (RadTreeViewItem)((RadTreeView)sender).SelectedContainer;
    string arg = item.Header.ToString();
    
    wrkDeploy.RunWorkerAsync(arg);
 
}

and this for the background worker eventhandlers:
  BackgroundWorker wrkDeploy;
public MainWindow()
        {
            InitializeComponent();
            this.wrkDeploy = new BackgroundWorker();
            wrkDeploy.RunWorkerCompleted += new RunWorkerCompletedEventHandler(wrkDeploy_RunWorkerCompleted);
            wrkDeploy.DoWork += new DoWorkEventHandler(wrkDeploy_DoWork);
            wrkDeploy.ProgressChanged += new ProgressChangedEventHandler(wrkDeploy_ProgressChanged);
        }
 
  private void wrkDeploy_DoWork(object sender, DoWorkEventArgs e)
        {
            string item = e.Argument.ToString();
            if (isDirectory(_currentPath + item.ToString()))
            {
 
                _currentPath += @"\";
                DirectoryInfo di = new DirectoryInfo(_currentPath);
                DirectoryInfo[] directories = null;
                int cnt = 0;
                int maxCnt = 0;
                try
                {
                    directories = di.GetDirectories();
                    FileInfo[] files = di.GetFiles();
                    maxCnt = directories.Length + files.Length;
                    while (cnt < maxCnt)
                    {
 

 
                        foreach (DirectoryInfo dInfo in directories)
                        {
 
                            RadTreeViewItem tvDirectoryItem = new RadTreeViewItem() { Header = dInfo.Name, DefaultImageSrc = "folder_icon.gif", ItemsOptionListType = OptionListType.OptionList, OptionType = OptionListType.None };
                            tvDirectory.Items.Add(tvDirectoryItem);
                            cnt += 1;
                            int percentComplete = (cnt / maxCnt) * 100;
                            wrkDeploy.ReportProgress(percentComplete);
                        }
                        if (files.Length > 0 && cnt == 0)
                        {
 
                            RadTreeViewItem root = new RadTreeViewItem() { Header = "Select/Deselect All Files in Folder" };
                            root.Checked += new System.EventHandler<Telerik.Windows.RadRoutedEventArgs>(tvDirectory_itemChecked);
                            root.Unchecked += new System.EventHandler<Telerik.Windows.RadRoutedEventArgs>(tvDirectory_itemUnChecked);
                            tvDirectory.Items.Add(root);
                        }
 
                        foreach (FileInfo fInfo in files)
                        {
 
                            RadTreeViewItem tvFileItem = new RadTreeViewItem() { Header = fInfo.Name, ItemsOptionListType = OptionListType.CheckList, OptionType = OptionListType.CheckList };
                            tvFileItem.Checked += new EventHandler<Telerik.Windows.RadRoutedEventArgs>(tvDirectory_fileChecked);
                            tvFileItem.Unchecked += new EventHandler<Telerik.Windows.RadRoutedEventArgs>(tvDirectory_fileUnChecked);
                            tvDirectory.Items.Add(tvFileItem);
                            cnt += 1;
                            int percentComplete = (cnt / maxCnt) * 100;
                            wrkDeploy.ReportProgress(percentComplete);
                        }
                    }
                }
                catch (UnauthorizedAccessException uae) { }
            }
        }
        private void wrkDeploy_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {

        }
        private void wrkDeploy_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            this.ProgressBar1.Value = (double)e.ProgressPercentage;
        }

I get an error stating "The calling thread must be STA, because many UI components require this." when I run it on the line that instantiates the first treeview item in my do work event handler
"RadTreeViewItem tvDirectoryItem = new RadTreeViewItem() { Header = dInfo.Name, DefaultImageSrc = "folder_icon.gif", ItemsOptionListType = OptionListType.OptionList, OptionType = OptionListType.None };"

Help please, thanks.
Hristo
Telerik team
 answered on 05 May 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?