Telerik Forums
UI for WPF Forum
4 answers
342 views
Good day!
I have such a xaml:

<Window x:Class="CAP.AdminTool.Questions"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Вопросы" Height="700" Width="750" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Icon="/CAP.AdminTool;component/favicon.ico" FontFamily="Verdana" FontSize="13" Loaded="Window_Loaded" >
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" MinHeight="60"></RowDefinition>
            <RowDefinition Height="auto" MinHeight="30"></RowDefinition>
            <RowDefinition Height="auto" MinHeight="60"></RowDefinition>
            <RowDefinition Height="auto" MinHeight="30"></RowDefinition>
        </Grid.RowDefinitions>
        <telerik:RadGridView Grid.Row="0"
             HorizontalAlignment="Left"
             Name="grQuestionSets"
             VerticalAlignment="Top"
             Height="auto"
             MinWidth="700"
             AutoGenerateColumns="False"
             SelectionChanged="grQuestionSets_SelectionChanged"  >
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Раздел вопросов" UniqueName="Name" Width="auto" MinWidth="300"/>
                <telerik:GridViewDataColumn Header="Описание" UniqueName="Description" Width="auto" MinWidth="400"/>             
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>       
    </Grid>
</Window>


I want my RadGridView width to change when I change the width of the window.
How can I do it?
lina fetisova
Top achievements
Rank 1
 answered on 22 Jun 2010
1 answer
408 views
1) When I bind the menu icon to an image which is defined as a StaticResource, the image does not appear but I can see the text "pack:" What am I doing wrong?

2) I want to bind the visibility to the underlying datasource using the BooleanToVisibilityConverter, so that when a menu item is selected the image is visible. I know how to use the converter but where in xaml do I set the binding.

Datasource:

public partial class Toolbar : UserControl 
    { 
        public Toolbar() 
        { 
            InitializeComponent(); 
 
            this.zoomMenu.ItemsSource = GetZoomMenuItems(); 
        } 
 
        private ObservableCollection<ZoomMenuItem> GetZoomMenuItems() 
        { 
            return new ObservableCollection<ZoomMenuItem>() 
            { 
                new ZoomMenuItem(){ IsSelected=false, ZoomSetting=10, ZoomSettingText="10%" }, 
                new ZoomMenuItem(){ IsSelected=false, ZoomSetting=25, ZoomSettingText="25%" }, 
                new ZoomMenuItem(){ IsSelected=false, ZoomSetting=50, ZoomSettingText="50%" }, 
                new ZoomMenuItem(){ IsSelected=false, ZoomSetting=75, ZoomSettingText="75%" }, 
                new ZoomMenuItem(){ IsSelected=false, ZoomSetting=100, ZoomSettingText="100%" }, 
                new ZoomMenuItem(){ IsSelected=false, ZoomSetting=200, ZoomSettingText="200%" }, 
                new ZoomMenuItem(){ IsSelected=false, ZoomSetting=400, ZoomSettingText="400%" }, 
                new ZoomMenuItem(){ IsSelected=false, ZoomSetting=600, ZoomSettingText="600%" }, 
                new ZoomMenuItem(){ IsSelected=false, ZoomSetting=800, ZoomSettingText="800%" }                 
            }; 
        } 
    } 

Menu:

<BitmapImage x:Key="tickImage" UriSource="../Images/tick.png" DecodePixelWidth="10"/> 
 
<Style x:Key="ZoomMenuItemStyle" TargetType="telerikNav:RadMenuItem"
            <Setter Property="Icon" Value="{Binding Source={StaticResource tickImage}}" />             
</Style> 
 
<HierarchicalDataTemplate  
            x:Key="zoomMenuItemTemplate" 
            ItemsSource="{Binding ZoomMenuItem}"
            <TextBlock Text="{Binding ZoomSettingText}" /> 
</HierarchicalDataTemplate> 
 
<telerik:RadDropDownButton  
                x:Name="RadDropBtnZoom" 
                Height="20" 
                Width="15"
                <telerik:RadDropDownButton.DropDownContent> 
                    <telerikNav:RadContextMenu 
                        x:Name="zoomMenu" 
                        Width="75"  
                        BorderThickness="0" 
                        ItemContainerStyle="{StaticResource ZoomMenuItemStyle}" 
                        ItemTemplate="{StaticResource zoomMenuItemTemplate}"
                    </telerikNav:RadContextMenu> 
                </telerik:RadDropDownButton.DropDownContent>                 
</telerik:RadDropDownButton> 



Pana
Telerik team
 answered on 22 Jun 2010
1 answer
90 views
By default each column can be sorted in 3 ways: Ascending, Descending, No Sort. How do I get rid of the third state, but have each the column can only be sorted either in ascending or descending order when I click the column header?

Thanks,
Yang
Ваня
Top achievements
Rank 1
 answered on 21 Jun 2010
3 answers
139 views
Hi All

I have bound the ItemSource of the RadBook to an ObservableCollection of classes, then I am using the item template to create a user control that binds it DataContext to the object. This is working well. I found however that I need to ensure that all the UserControls are loaded as soon as the ItemSource of the RadBook is Updated. Right now they only load when you navigate to that page.

Is there any method that I can call that does not require me to cause the book to iterate through all the pages?

Thanks for you help

Nick
Kiril Stanoev
Telerik team
 answered on 21 Jun 2010
1 answer
289 views

       Hello!  you may have a look at the attach.why the horizontal scrollbar can't auto hide? how to solve this problem ?

          

<Telerik:RadTreeView Name="_treeView" ScrollViewer.VerticalScrollBarVisibility="Auto"  ScrollViewer.HorizontalScrollBarVisibility="Auto"  SelectionMode="Extended" ExpanderStyle="{StaticResource Expander}" local:TreeViewHelper.EnableRightClickSelection="True" MouseRightButtonDown="_treeView_MouseRightButtonDown" PreviewMouseRightButtonDown="_treeView_PreviewMouseRightButtonDown">  
            <telerikNavigation:RadContextMenu.ContextMenu > 
                <telerikNavigation:RadContextMenu  x:Name="radTreeViewMenu">  
                    <telerikNavigation:RadMenuItem Header="View In Master Document" Tag="View in Master Document"/>  
                    <telerikNavigation:RadMenuItem Header="Show PDF" Tag="SHOW PDF" IsEnabled="False"/>  
                    <telerikNavigation:RadMenuItem Header="Show PDF AT Division" Tag="Show PDF AT Division" IsEnabled="False"/>  
                    <telerikNavigation:RadMenuItem Header="Copy Division" Tag="Copy Division" IsEnabled="False"/>  
                    <telerikNavigation:RadMenuItem Header="Job Ticket" Tag="Job Ticket" IsEnabled="False"/>  
                </telerikNavigation:RadContextMenu> 
            </telerikNavigation:RadContextMenu.ContextMenu> 
</Telerik:RadTreeView> 

If you see this message,please reply as soon as possible.I 'm very anxious. Thanks my friend.

Dimitrina
Telerik team
 answered on 21 Jun 2010
1 answer
86 views
Hi,

I've set up a RadComboBox with the following configuration:

IsTextSearchEnabled="True" 
IsFilteringEnabled="True" 
TextSearchMode="Contains"

SelectedItem, SelectedText, IsDropDownOpen and Text are bound to my data.  I can start typing and click to select an item once, but if I search (type) again and click on the same item a second time, it is not selected.  Only the text I typed is displayed in the combobox.

After removing IsFilteringEnabled and TextSearchMode, clicking the item a second time works as expected.  Adding either of them will re-create the problematic behavior.

Is anyone aware of a workaround?

Thanks,
Andrew
George
Telerik team
 answered on 21 Jun 2010
1 answer
79 views
Hello, how do I change the image for a WPF Radbutton for onClick or other events like onHover etc?

Thanks
Dimitrina
Telerik team
 answered on 21 Jun 2010
4 answers
275 views
I have a grid view containing several hundred rows, each of which will need to contain an image referenced via a URL. These images will come from a remote server via http.

Using an imagecolumn, with the image source bound to my arraylist containing the URL, the grid does not display until all images are downloaded, which takes some time and causes the UI thread to be unresponsive. I need to add the images asynchronously so that the rest of the row data is visible but the images appear one by one as they are downloaded (as a standard web page would).

How can I best achieve this?

Many thanks.
Vlad
Telerik team
 answered on 21 Jun 2010
3 answers
139 views
Hi,

I use a RadTimePicker as a CellEditTemplate in a RadGridView with binding a DataTable.
I managed to bind the data to the TimePicker and it displays correctly (e.g. 12:23:59), but I can change its value only to timestamps in hour (e.g. 12:00:00). How can I change its value to such a date as 23:34:56?

Thanks in advance!

Feri
Konstantina
Telerik team
 answered on 21 Jun 2010
1 answer
290 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
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?