Telerik Forums
UI for WPF Forum
0 answers
634 views
I am quite new to all of this, so it maybe no surprise that I would be a little lost...
Here is where I am at: I would like to get the CustomerID (from a viewModel) when a row is selected, to pass it to anotherViewModel to filter orders matching the currently selected Customer.
in XAML I have:
<telerik:RadGridView x:Name="CustomersGrid" IsReadOnly="true"
                                                     ItemsSource="{Binding CustomersList, Mode=TwoWay}"                                                    
                                                     CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed"                                                      
                                                     AutoGenerateColumns="False">
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="SelectionChanged" >
                                            <Command:EventToCommand Command="{Binding SelectCustomer}" PassEventArgsToCommand="True" />
                                            <!--<Command:EventToCommand CommandParameter="{Binding SelectedItem, ElementName=CustomersGrid}" Command="{Binding SelectCustomer, Mode=OneWay}" /> -->
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>

In the viewModel, I have a delegate command.
I have been following the example in the documentation about RadEventsToCommandExamples, and when I look in the debugger, I can see that my Object is of type Telerik.Windows.Controls.SelectionChangeEventsArgs, but if I try to cast the Object to this, I get an error, as it find Windows.Controls.SelectionChangedEventsArgs (note the difference between change and changed).
I did try to cast it from RadRoutedEventArgs, but I am not too sure how to do.

How should I do? Looks like a bug to me, but I would really like to know about a work around. Thanks in advance!
Bernard
Bernard Grosperrin
Top achievements
Rank 1
 asked on 17 Apr 2012
1 answer
124 views
for the last 2 hours I've been trying to figure this one out. i have a column displaying an enum value. the enum value is displayed using a custom template and works fine. every enum value has its corresponding icon. now i was asked to provide a way to edit all the selected rows at once. the data behind are observableobjects (INotifyPropertyChanged). My code is simple, after setting a value in a dialog and accepting, I modify all the selected elements property to the new value. this works fine for string and double by the way. it also mostly works for my enum, but sometimes (mainly when i repeat this process quickly) i get a crash with the (consistent) error listed below.

I removed my template and the code worked. if i only display text in my template and no icon, it also seems fine. the main reason, why i think this must be telerik related, or at least a combination effect: I dont get an exception in my own code and can not debug a thing. if i edit the cells directly i also have no problems. it only seems to occur by modifying multiple data-objects at once.

I've also tried the following: prevent my objects notifying that the enum value has changed -> no exception. then calling rebind on the grid -> same exception.

Telerik.Windows.Data, Version=2012.1.215.40

System.ArgumenNullException: {"Der Wert darf nicht NULL sein.\r\nParametername: element"} //german: element is null

bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei Telerik.Windows.Controls.ChildrenOfTypeExtensions.<GetChildrenRecursive>d__3.MoveNext()
   bei System.Linq.Enumerable.<OfTypeIterator>d__aa`1.MoveNext()
   bei System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   bei Telerik.Windows.Controls.GridView.GridViewCell.<GetDataErrors>d__7.MoveNext()
   bei Telerik.Windows.Data.EnumerableExtensions.Count(IEnumerable source)
   bei Telerik.Windows.Controls.GridView.GridViewCell.UpdateIsValidState()
   bei Telerik.Windows.Controls.GridView.GridViewCell.UpdateValue()
   bei Telerik.Windows.Controls.GridView.GridViewCell.SetCellElement()
   bei Telerik.Windows.Controls.GridView.GridViewRow.PrepareCell(GridViewCellBase cellBase, GridViewColumn column)
   bei Telerik.Windows.Controls.GridView.GridViewCellsPanel.PrepareCell(GridViewCellBase cell, GridViewColumn column)
   bei Telerik.Windows.Controls.GridView.GridViewCellsPanel.GetVirtualizedCell(GridViewColumn column, Boolean createIfNull)
   bei Telerik.Windows.Controls.GridView.GridViewCellsPanel.RealizeAndMeasureCells(Int32 startIndex, Int32 predictedLastIndex, Func`2 calculateNextIndex)
   bei Telerik.Windows.Controls.GridView.GridViewCellsPanel.UpdateVirtualizedCells()
   bei Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(Size availableSize)
   bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   bei System.Windows.UIElement.Measure(Size availableSize)
   bei System.Windows.ContextLayoutManager.UpdateLayout()
marc
Top achievements
Rank 1
 answered on 17 Apr 2012
4 answers
129 views

Hello Telerik,
    first; my apologises. I have searched the GridView forum for answers to the following question and came up with nothing useful.
    The same goes for Google.

Problem:
    I have a ObservableCollection containing a 'ColumnVisibility' class - which is bound to a ComboBox control.
    But I am unable to specify a particular indexed element to the RadGridView's columns (bound to IsVisible property, see below).

<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=DetailsBAMCollection.VendorName}"
                    Header="Vendor"
                    Width="*"
                    IsVisible="{Binding Path=ColumnData[0].ColumnVisible, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"/>
    
As you can see, the DataMemberBinding references a different collection and I have previously used the RadGridView's itemsource property to attach this collection to the Grid - neither gave me the desired effect (which is to hide certain columns based upon the user's ComboBox selections).

Can you give me any pointers?
Adam
Top achievements
Rank 1
 answered on 17 Apr 2012
3 answers
105 views
I get an index out of range error when i search for a property that does not exist within my property list.

Is there something I can do to have it just show a blank property grid?

Thanks

Stefan
Ivan Ivanov
Telerik team
 answered on 17 Apr 2012
0 answers
120 views
Hello,
I have a problem with a wpf application : theorically wpf is indipendent from the dpi of the screen, but in my wpf application if I set the screen size to 125% or 150% the visual elements of the applications are bigger.
My goal is to have always the same size of the application, because is a visual benchmark application, so it is important for me the visual aspect of the is fixed with every dpi/% of the screen.
Is there a way to fix the size of the application and make it indipendent from the screen settings?
Jean-Marc
Top achievements
Rank 1
 asked on 17 Apr 2012
3 answers
181 views
Hello,

I am using the Richtextbox to create a text that the user can then copy to outlook or word. In this text I also have a table. But when it is coppied every cell starts on a new line. Do I need to set something so the table is Copied as a real table?

I used to use the windows Richtextbox with FlowDocument and there this worked only line ends were skipped.
Martin Ivanov
Telerik team
 answered on 17 Apr 2012
2 answers
230 views

I'm experiencing a strange behavior: The RadBusyIndicators's content (the yellow circle and the text "Loading...") appears far too late, but the BusyIndicator becomes grey at the right moment. The content (progress bar) appears not until the time-consuming action is over.

Here is what I'm doing in Pseudocode:

MyDialog dialog = new Dialog();             // A Window that contains the BusyIndicator
dialog.myRadBusyIndicator.IsBusy = true;    // Startup with the BusyIndicator activated
dialog.Dispatcher.BeginInvoke(new System.Action(MyLoginAction));   // Start some time-consuming action in the Background
dialog.ShowDialog();                        // Show the user a Dialog with busy information

Problem: The yellow circle in the BusyIndicator shows up AFTER the time-consuming action is over, but Busy-State (graying) is activated correctly when the Dialog pops up.

Some intricate threading problem?

Peter
Top achievements
Rank 1
 answered on 17 Apr 2012
1 answer
150 views
I have to use the control RadDropDownButton and inside that I have to place a usercontrol

Till here it works fine for me.
But I need to resize the telerik:RadDropDownButton.DropDownContent. I need a splitther or a resizer at the bottom of the DropDownContent to resize the content area where I have placed my control. pls tell how to achieve that thing.
Tina Stancheva
Telerik team
 answered on 17 Apr 2012
3 answers
306 views
Hi,

I'm looking for a way to call the save command from code behind. I tried different kinds of maner but with no success.

Thanks
Vasil
Telerik team
 answered on 17 Apr 2012
2 answers
178 views
I have a RadComboBox on a form in my WPF application:

<telerik:RadComboBox BorderBrush="{DynamicResource ControlBorder}"
                     CanAutocompleteSelectItems="True"
                     Focusable="True"
                     FontSize="18"
                     FontWeight="Bold"
                     Foreground="{DynamicResource TextForeground}"
                     Height="32"
                     HorizontalAlignment="Left"
                     IsEditable="True"
                     IsFilteringEnabled="True"
                     IsTextSearchCaseSensitive="False"
                     IsTextSearchEnabled="True"
                     ItemsSource="{Binding Path=RecentUsers, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type c:LoginForm}}}"
                     Name="UsersName"
                     TabIndex="1"
                     Width="300" />

In my code-behind, I have declared a DependencyProperty called RecentUsersProperty:

public static readonly DependencyProperty RecentUsersProperty =
    DependencyProperty.Register( "RecentUsers", typeof( string[] ), typeof( LoginForm ), new PropertyMetadata( null ) );
  
public string[] RecentUsers {
    get { return (string[]) GetValue( RecentUsersProperty ); }
    set { SetValue( RecentUsersProperty, value ); }
}

In the Loaded event handler of the window that contains this field, I set the RecentUsers to an array of strings retrieved from the database:

RecentUsers = DataInterface.GetRecentUsers( 90 );

Here's the data that's returned by the call to GetRecentUsers:

"adam.st.onge@eoc4.elsagrd.com"
"chris.theet"
"jklepacz1"
"nwhaley"
"rcass"
"tonyb"
"tony.vitabile"

When the window is displayed and I start typing the name of a user that is in the RecentUsers array, autocomplete does not fill in the rest of the matching name.  If I tab out of the field, though, it selects the first one that matches. 

What am I doing wrong?  I'm using the 2012.1.326.40 version of the Telerik libraries.

Tony
Tony
Top achievements
Rank 1
 answered on 17 Apr 2012
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?