Telerik Forums
UI for WPF Forum
1 answer
319 views
Hi,

I am using Telerik Controls for WPF Q3 2009 (2009.3.1314.35), .NET 3.5 SP1, Windows XP SP2. I have two problems.

(1)
I have a grid bound to a (strongly typed) DataTable which has two dependent columns (in my project they're bound to the same data but display it differently). My goal is to have one column update when another changes, meaning on CellEditEnded (preferably) or RowEditEned.

For example:
<telerik:RadGridView Name="RadGridView" AutoGenerateColumns="False">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Product_Name}" Header="Product Name"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Product_Name}" Header="Product Name Again"/>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

I want "Product Name Again" to refresh after "Product Name" is edited.

Searching through the forums and experimenting, I couldn't find a solution that completely works.
I should note that the same situation, but when binding to an ObservableCollection of CLR objects, works with no problem.

I tried the following:

When binding to DataTable.DefaultView, the dependent column is affected when UPDATING an existing row, but not when INSERTING a new row.
When inserting, the dependent column refreshes only after entering edit mode again and committing.

When binding directly to DataTable, updating works, but when inserting the new row visually disappears when the editing is finished. I implemented AddingNewDataItem and RowEditEnded to enable inserting.

I did something like this (assuming null is valid for all columns of the products table):
        private void RadGridView_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            // _productsDataTable is a strongly typed reference to the DataTable
            var product = _productsDataTable.NewProductsRow();
            e.NewObject = product;
        }

        private void RadGridView1_RowEditEnded(object sender, Telerik.Windows.Controls.GridViewRowEditEndedEventArgs e)
        {
            if (e.EditOperationType == Telerik.Windows.Controls.GridView.GridViewEditOperationType.Insert &&
                e.EditAction == Telerik.Windows.Controls.GridView.GridViewEditAction.Commit)
            {
                _productsDataTable.AddProductsRow(e.NewData as ProductsRow);
            }
        }
       
(I also tried adding the row to the table in AddingNewDataItem instead of in RowEditEnded, but got the same result)

Do have any suggestions on what might work?

=============

(2)
I have a grid ordered by a non-visible "priority" field, with CanUserReorderColumns=False. I'm unable to make the ordering refresh when the "priority" changes.

The grid has one column that looks something like this:

Change priority
---------------
   [+] [-]
   [+] [-]
   [+] [-]

If for example, the user clicks [+] on the second row, a command is invoked on a ViewModel class which changes the "priority" values of the first and second rows, so that after reordering the rows will swap places.

A requirement is that the user will always be able to click the buttons in one step, without needing to enter edit-mode first with F2/click etc.
To achieve this, I defined the buttons in the column's CellTemplate and prevented it from ever entering edit mode.

The problem is, after clicking the buttons, the underlying data changes but the grid isn't automatically reordered (which I guess is because the grid isn't aware of any edit action). The underlying data implements INotifyPropertyChanged.

I tried triggering reordering manually, but the buttons' OnClick/OnMouseUp events fire before their commands, so it had no effect.

Thanks in advance,
Yuri
Stefan Dobrev
Telerik team
 answered on 21 Jun 2010
2 answers
414 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
124 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
137 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
130 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
340 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
130 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
131 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
135 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
97 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
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
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?