Telerik Forums
UI for WPF Forum
2 answers
387 views
Good day!

I have a form with a stack panel of questions. Each question has a number of answers which look like a list of radiobuttons.
I make my xaml dynamically:

<StackPanel x:Name="spQuestions" Orientation="Vertical" Grid.Column="1" Grid.Row="8" Grid.ColumnSpan="3" HorizontalAlignment="Left">
</StackPanel>


foreach (QuestionDTO question in questions)
            {
                StackPanel newsp = new StackPanel();
                newsp.Orientation = Orientation.Vertical;
                TextBlock textBlock = new TextBlock();
                textBlock.Text = question.Text;
                newsp.Children.Add(textBlock);
                   RadGridView gridView = new RadGridView();
                    gridView.Name = "grAnsw" + question.Id.ToString();
                    gridView.ItemsSource = question.Answers;
                    gridView.AutoGenerateColumns = false;
                    gridView.IsReadOnly = true;
                    GridViewRadioButtonColumn col = new GridViewRadioButtonColumn();    
                    gridView.Columns.Add(col);
                    newsp.Children.Add(gridView);
                    spQuestions.Children.Add(newsp);
       }


where

public class GridViewRadioButtonColumn : GridViewDataColumn
{
        public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
        {
            var radioButton = cell.Content as RadioButton;
            if (radioButton == null)
            {
                radioButton = new RadioButton();
                radioButton.SetBinding(RadioButton.ContentProperty, new Binding("Text")
                {
                  Source = dataItem
                });
                cell.Content = radioButton;
            }
            return radioButton;
        }
}


In the result I have the page which I wanted, but all radio buttons look like they are in the same list. So I can check only one radiobutton on the page, but I want to check one radiobutton in one question, but there are a number of questions on the page =(
How can I make the page see that there are different lists of radiobuttons for each question?

Thank you.
lina fetisova
Top achievements
Rank 1
 answered on 21 Jun 2010
5 answers
113 views
Has anyone else found the level of changes to public members in each new release very frustrating?

I have a few developers working with the Calendar, GridView and Charts and with each new release we find ourselves spending a significant amount of time recreating templates because of breaking changes introduced by the latest binaries. We have customized the look of these controls to suit our needs and in many cases we found it necessary to provide our own template.

I've attached a screenshot of the Calendar after applying the 2010.1 603 release. I'd like to hear from others using this forum if you have had similar experiences.

Thanks,
Mike


Hristo
Telerik team
 answered on 19 Jun 2010
1 answer
123 views

 

I am trying to create a TIleView in a WPF form that is bound to an observable collection. Everything seems to be working but my issue is that I want to have a nested tileview in the parent's large content template. This child tileview should display a collection that is a property in the parent item.
 
An example is this

I have Customers Collection. Each customer has orders collection.

Whats needed:
Display customers in tileview. When double clicking a customer tileviewitem, display orders in another tileview inside the item's large content using the orders collection that belongs to that customer.

I have tried using HierarichalDataTemplates but the result was not satisfactory. Is there a way to do this?
I am using Linq to Entities and just setting the ItemsSource of the child tileview to the child collection actually makes a call to the database to get the children using the id of the parent item that is bound to the TileViewItem that was maximized. I actually want to use the orders that exists in the Customer object instead since they are filtered instead of making the call to the database.
Any help would be appreciated.
Thanks,
Tina Stancheva
Telerik team
 answered on 18 Jun 2010
1 answer
114 views
There was mention of smart tag support being available for the wpf controls in Q2 - Not that it's a necessity , but it would be a very nice to have and was wondering if it would be featuring in Q2 or not ? I've installed the beta but don't see smart tags available on any of the controls I have tried so far.

Another question ,  the collections editor for the ribbonbar works great up until you get to adding items to a group and then the collection editor only allows you to add buttons. This has been this way for some time , again it's not really necessary to make it any different as the xaml is easy enough to add but can we expect to see the collection editor have a full range of options as the windows forms controls do ? It just really makes life alot easier having the support you guys provided for the winforms controls in the designer.

Valentin.Stoychev
Telerik team
 answered on 18 Jun 2010
3 answers
318 views
Is there some way to hide the tab headers from visibility?  In Windows Forms I use the following line of code and it works fine, but i am not clear on how to do this with the WPF tabcontrol.
radTabStrip1.TabStripElement.TabLayout.Visibility = Telerik.WinControls.ElementVisibility.Collapsed; 


Thanks in advance,
Lee
Vlad
Telerik team
 answered on 18 Jun 2010
1 answer
119 views
Hi All

I am getting the following error when adding or removing objects from an observable collection in the ViewModel from which the RadBook is bound to :
Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.Book.BookPanel.MeasureOverride(System.Windows.Size availableSize = {System.Windows.Size}) Line 181

Its Looking for this file:
c:\Builds\WPF_Scrum\Navigation_WPF_2010_Q1\Sources\Development\Controls\Navigation\Book\BookPanel.cs

This is very urgent as the error was not detected during testing, is very random in its nature and is in a production system.

Regards

Nick
Kiril Stanoev
Telerik team
 answered on 17 Jun 2010
3 answers
118 views
Hello,

When I press the Ctrl+C inside GridView, I get following exception

Am I doing something wrong?

System.NullReferenceException was unhandled
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls.GridView
  StackTrace:
       at Telerik.Windows.Controls.GridViewExportWriter.RenderDataCells(Object item)
       at Telerik.Windows.Controls.GridViewExportWriter.RenderDataRows(IEnumerable items)
       at Telerik.Windows.Controls.GridViewExportWriter.Render()
       at Telerik.Windows.Controls.GridView.GridViewDataControl.Export(Stream stream, GridViewExportOptions options)
       at Telerik.Windows.Controls.ExportExtensions.GetContent(ExportFormat format, GridViewDataControl source, Boolean includeHeader, Boolean includeFooter, IEnumerable items)
       at Telerik.Windows.Controls.ExportExtensions.ToCsv(GridViewDataControl source, IEnumerable items, Boolean includeHeader)
       at Telerik.Windows.Controls.GridView.GridViewDataControl.CopyExecuted(Object sender, ExecutedRoutedEventArgs e)
       at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
       at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
       at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
       at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
       at System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
       at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
       at System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)
       at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)
       at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
       at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)
       at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
       at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
       at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled)
       at System.Windows.Interop.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(MSG& msg, Boolean& handled)
       at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at Kymdata.CableTool.UI.App.Main() in C:\DEV\CMT\UI\obj\x86\Debug\App.g.cs:line 50
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:


Vlad
Telerik team
 answered on 17 Jun 2010
1 answer
123 views
Sorting and filtering on image columns looks to be disabled (for obvious reasons).

However, I have an image column that only displays one of two different images, bound to a URL. Let's say that these images represent YES or NO (but I want this to be displayed pictorially rather than as text or a checkbox).

Is there any way that I can sort or filter on this column, displaying the URL (or custom text basd on the URL) as the filter, for example.

Thanks.
jwhitley
Top achievements
Rank 1
 answered on 17 Jun 2010
4 answers
85 views
Hello,

My view has two GridViews controls.

When user selects several rows in first GridView I need to response to Ctrl+C and remember the rows he selected (I do not need to store data in a clipboard).

When user focuses second grid and presses Ctrl+V I need to copy selected rows from first to second grid.

I don't have problem coping these rows, I just to know how can I capture Ctrl+C and Ctrl+V when grids are focused.

Thank You!
Daniil
Top achievements
Rank 1
 answered on 17 Jun 2010
4 answers
164 views
hi,

I am trying to add a row in a grid that is insine a Pane Group. It works fine if the pane is docked, however, when it's in auto hide mode the property SelectedPane returns the pane that is docked behind it, and if there is no pane docked it returns a null pointer. How can I get the "focused" pane, instead of the selected pane? Thanks.
Miroslav Nedyalkov
Telerik team
 answered on 17 Jun 2010
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?