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

I have the following structure in my application:
RadOutlookBar
    -RadOutlookBarItem
        -RadPanelBar
            -RadPanelBarItem
                -RadTreeView (with Items)

So, a RadOutlookBar with a RadOutlookBarItem contains a RadPanelBar with RadPanelBarItems. The RadPanelBarItem contains a RadTreeView with RadTreeViewItems.

In the RadTreeView is also a RadContextMenu.

When I right-clicked on a TreeViewItem of the TreeView, the ContextMenus opened-event is fired and ContextMenu.GetClickedElement<RadTreeViewItem>(); will return the right RadTreeViewItem. Then I click on a MenuItem and the ItemClick-event is fired. So far, so good.

Well when I do this a second time, the ContextMenu.GetClickedElement<RadTreeViewItem>(); returns the RadPanelBarItem which contains the TreeView.
As I see the RadPanelBarItem inherits from the RadTreeViewItem and the documentation says, GetClickedElement<T>() will return the top-most element of T. I think this is an incorrect behavior, because it returns two different elements and the second time the top-most element of T.
The error occurs, when at the first time the ItemClick-event of the ContextMenu was fired, after a MenuItem was clicked.

Got it?

GetClickedElement<T>() should always return the last element (the innermost) of T or am I wrong?

Thanks,
Daniel
Hristo
Telerik team
 answered on 27 May 2011
1 answer
111 views
Hello

I have a ControlTemplate where I want to bind the datacontent.

<Button Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75">
    <Button.Template>
        <ControlTemplate>
            <StackPanel>
                <telerik:RadComboBox ItemsSource="{Binding ListCombo, Mode=OneWay}"  
                    Text="{Binding Filter.SelectedText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEditable="True"  
                    IsSynchronizedWithCurrentItem="True" IsFilteringEnabled="True"  Margin="0,0,0,81" />
            </StackPanel>
        </ControlTemplate>
    </Button.Template>
</Button>








 
Now it doesn't work properly but if I use only the control like below it work properly:

<telerik:RadComboBox ItemsSource="{Binding ListCombo, Mode=OneWay}"  
      Text="{Binding Filter.SelectedText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEditable="True"  
       IsSynchronizedWithCurrentItem="True" IsFilteringEnabled="True" Margin="0,0,0,81" />

 

What can I do to use it into a controltemplate?

Thanks in advance,

Pana
Telerik team
 answered on 27 May 2011
4 answers
318 views
Hi there,

I created a custom filter control as user control in my WPF application. I have a button in my MainWindows.xaml which clear all filters programatically for GridView. Everything works fine. when i click on button, it clear all filters and load grid data again, but it didn't clear filter's appearance in GridView. can you please suggest me how should i change appearance of filters in GridView when click on button?
kalpesh
Top achievements
Rank 1
 answered on 26 May 2011
21 answers
298 views
Floating panes doe not move smoothly when I move them around with the mouse. They jerk about 1cm at a time.
The complete WPF Window moves smoothly.

This problem only occurs on my desktop PC not on my far less powerful notebook.


Using: WPF40_2010_2_0812
Gregory
Top achievements
Rank 1
 answered on 26 May 2011
1 answer
345 views
I'm using the RadGridView in an MVVM application. The SortingState of each column is bound to a property (one per column) in my ViewModel. When I set a new value to these properties in code I expect the sorting of the corresponding column to be updated. However, that doesn't work as expected. The column header indicates that the column is ordered as I specified, but the rows are not ordered. Also, if I update the data in the GridView the sorting I set through code completely disappears.

I've found one perticular interesting scenario:
1. I start the application and load some data into the GridView.
2. I sort the data by column A by clicking the header of this column (works fine).
3. I press a button that invokes a command in the ViewModel that sets the SortingState of column A to SortingState.None (removes the sorting that is) and sets the SortingState of column B to SortingState.Ascending
4. The GridView header now indicates that the data should be sorted ascending by column B and not sorted by any other column. However, the rows are still sorted as before (by column A).
5. Now I fetch some new data (completely replace the old data).
6. The GridView now reverts into my previous sorting order, that is to sort by column A. This is both indicated by the GridView header and by the way the rows are actually sorted.

What am I doing wrong?

Here's how my XAML looks:
<tgv:RadGridView ItemsSource="{Binding Path=DataRows, Mode=OneWay}" AutoGenerateColumns="False" Grid.Row="0">
    <tgv:RadGridView.Columns>
        <tgv:GridViewDataColumn Header=Column A"
            DataMemberBinding="{Binding Path=Id}"
            SortingState="{Binding Path=SortingStateColumnA, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
        <tgv:GridViewDataColumn Header="Column B"
            DataMemberBinding="{Binding Path=FirstName}"
            SortingState="{Binding Path=SortingStateColumnB, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
    </tgv:RadGridView.Columns>
</tgv:RadGridView>
<Button Grid.Row="1" Command="{Binding Path=ApplySortOrderCommand, Mode=OneTime" />

And the ViewModel:
public class MainWindowViewModel : ViewModelBase
{
    private RadObservableCollection<DataRowViewModel> _dataRows;
    private RelayCommand _applySortOrderCommand;
    private SortingState _sortingStateColumnA = SortingState.None;
    private SortingState _sortingStateColumnB = SortingState.None;
 
    public MainWindowViewModel()
    {
        _dataRows = new RadObservableCollection<DataRowViewModel>();
    }
 
    public RadObservableCollection<DataRowViewModel> DataRows
    {
        get
        {
            return _dataRows;
        }
    }
     
    public SortingState SortingStateColumnA
    {
        get
        {
            return _sortingStateColumnA;
        }
        set
        {
            if (value != _sortingStateColumnA)
            {
                _sortingStateColumnA = value;
                OnPropertyChanged("SortingStateColumnA");
            }
        }
    }
     
    public SortingState SortingStateColumnB
    {
        get
        {
            return _sortingStateColumnB;
        }
        set
        {
            if (value != _sortingStateColumnB)
            {
                _sortingStateColumnB = value;
                OnPropertyChanged("SortingStateColumnB");
            }
        }
    }
 
    public ICommand ApplySortOrderCommand
    {
        get
        {
            if (_applySortOrderCommand == null)
            {
                _applySortOrderCommand = new RelayCommand(param => ApplySortOrder());
            }
            return _applySortOrderCommand;
        }
    }
 
    private void ApplySortOrder()
    {
        SortingStateColumnB = SortingState.Ascending;
    }
}

Code to fetch data removed for brevity. Note that this is not my actual code so please disregard typos.
Vlad
Telerik team
 answered on 26 May 2011
1 answer
90 views
Hi,

in my gridview, I have a column base on a bool value and for each rows, for this column, a checkbox is visible. I would like to know if it's possible to center horizontally those checkboxes?

Thank's
Vanya Pavlova
Telerik team
 answered on 26 May 2011
3 answers
245 views
Hi,

im using a TreeListView and would like to get an event, when the selection in a ComboboxColumn changes. I can't find any event helping me. Here is my XAML:

		<telerik:RadTreeListView Name="rtlvQuery" Grid.Column="0" Grid.Row="0" IsDragDropEnabled="true" Margin="30" AutoGenerateColumns="False" >
			<telerik:RadTreeListView.ChildTableDefinitions>
				<telerik:TreeListViewTableDefinition ItemsSource="{Binding Filters}" />
			</telerik:RadTreeListView.ChildTableDefinitions>
			<telerik:RadTreeListView.Columns>
				<telerik:GridViewDataColumn DataMemberBinding="{Binding IsActive}" Header="Active" />
				<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" />
				<telerik:GridViewDataColumn DataMemberBinding="{Binding Description}" Header="Description"/>
				<telerik:GridViewComboBoxColumn ItemsSourceBinding="{Binding AvailableFilterTypes}" DataMemberBinding="{Binding FilterType}"  
												Header="Type" SelectedValueMemberPath="Value"  DisplayMemberPath="DisplayName" />
				<telerik:GridViewDataColumn DataMemberBinding="{Binding IsNegated}" Header="Negate"/>
 
			</telerik:RadTreeListView.Columns>
		</telerik:RadTreeListView>

I use a ItemSourceBinding because the available Combobox is bound to a filtered List of EnumMemberViewModel build by EnumDataSource.FromType<FilterType>( );

I tried the following, that I found in the forum for RadGridView, but thta doesn't seem to work in TLV:

		<Grid.Resources>
			<Style TargetType="telerik:RadComboBox" >
				<EventSetter Event="SelectionChanged" Handler="ComboBox_SelectionChanged" />
			</Style>
		</Grid.Resources>

Any idea, how I could solve this?

Thanks
Hans




Pavel Pavlov
Telerik team
 answered on 26 May 2011
1 answer
118 views
Hi,

i am trying to change the selection of a RadComboBox with seperate Buttons.
One to select the previous entry in the RadComboBox and one to select the next.
Is there a way to do that with build-in commands?
Or is there another possibility to do that without Code-Behind?
Valeri Hristov
Telerik team
 answered on 26 May 2011
5 answers
135 views
Greetings,

I'm using the RadGridView inside of a Windows Forms ElementHost and have lost the ability to drag the column headers. I'm using Q1 2010 release. It worked great for us in Q3 2009 SP2. Any Suggestions for a work around would be great.

Thanks much
~Boots
Ariel
Top achievements
Rank 1
 answered on 26 May 2011
12 answers
228 views
Hello,

I'm not sure if this is working as designed or a bug, but here is the issue.

We have a GridView hosted in a RadPane.  If the Pane is pinned, grouping works great.  If the pane is unpined, you can hover over it to expand the pane, but none of the grouping features work until you pin the pane again.

On a secondary note, I also noticed the sorting also get's lost when the pane is pinned and unpinned.

We are using the latest release 2010.2 812 of the controls.

Here is a quick sample on how we are using it:
<telerik:RadDocking>
    <telerik:RadDocking.DocumentHost>
        <telerik:RadSplitContainer>
            <telerik:RadPaneGroup />
        </telerik:RadSplitContainer>
    </telerik:RadDocking.DocumentHost>
    <telerik:RadSplitContainer InitialPosition="DockedLeft">
        <telerik:RadPaneGroup>
            <telerik:RadPane Title="Pane 1" CanUserClose="False" CanFloat="False" CanDockInDocumentHost="False">
                <telerik:RadGridView x:Name="radGridView" AutoGenerateColumns="False">
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding LastName}" Header="Last Name"/>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Married}" Header="Is Married"/>
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>
            </telerik:RadPane>
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>
</telerik:RadDocking>
Tsvyatko
Telerik team
 answered on 26 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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?