Telerik Forums
UI for WPF Forum
2 answers
132 views

I'm having an issue with column header wrapping due to my headers being bound to the DisplayName attribute of my properties.

I have a Property in my view model, using the DisplayName attribute:

[DisplayName("Component Item Identifier")]
public String ComponentItem
{
    get { return componentItem; }
    set
    { ... }
}

I can make that display in the header using:
<telerikGrid:GridViewDataColumn  UniqueName="ComponentItem" 
             DataMemberBinding="{Binding Path=ComponentItem}" 
             Header="{Binding Path=ComponentItem.DisplayName}" >
</telerikGrid:GridViewDataColumn>

However, I need to make the header column wrap the text.  The method I've found in these forums is via using a TextBlock as the header UI element, and I can make that work without the bindings:
<telerikGrid:GridViewDataColumn  UniqueName="ComponentItem"
DataMemberBinding="{Binding Path=ComponentItem}">
    <telerikGrid:GridViewDataColumn.Header>
        <Grid>
            <TextBlock Text="MY LONG TEXT FOR TESTING WRAPPING" TextWrapping="Wrap"/>
        </Grid>
     </telerikGrid:GridViewDataColumn.Header>                            
</telerikGrid:GridViewDataColumn>

But, the problem comes when I try to bind that TextBlock to my DisplayName, as follows, the header ends up blank:
<telerikGrid:GridViewDataColumn  UniqueName="ComponentItem"
DataMemberBinding="{Binding Path=ComponentItem}"
    <telerikGrid:GridViewDataColumn.Header
        <Grid
            <TextBlock Text="{Binding Path=ComponentItem.DisplayName}" TextWrapping="Wrap"/> 
        </Grid
     </telerikGrid:GridViewDataColumn.Header>                             
</telerikGrid:GridViewDataColumn>

Am I binding incorrectly in this code?  Or is this just not supported in this structure?

Sincerely,
Russell.






Russ
Top achievements
Rank 1
 answered on 13 Jul 2011
1 answer
70 views
Hello,
I am trying to use the QueriableCollectionView class for DataGrid databinding.
I have the folowing code on window loaded event:

private QueryableCollectionView _qcv; 
        private void WindowLoaded(object sender, RoutedEventArgs e)
        {
            _qcv =  new QueryableCollectionView(_entities.Countries);
            radGridView1.ItemsSource = _qcv;
            radDataForm1.ItemsSource = _qcv;
        }

then:

  private void ButtonDeleteClick(object sender, RoutedEventArgs e)
        {
            Country c = _qcv.CurrentItem as Country;
            _qcv.Remove(c);
        }

Can you tell me please why _qcv.Count remains the same? The item is not deleted? What am I doing wrong?Am i missing something?
Thank you very much.

PS: QueriableCollectionView.CanRemove returns false.
Rossen Hristov
Telerik team
 answered on 13 Jul 2011
6 answers
299 views
Hello Telerik team,

I am using your radGirdView for viewing some of my records in my database.
When I add a record in my database, the gridview does not refresh.

I am new to WPF and it is just a simple basic program.

Thanks in advance!
Maarten
public void refreshList()
        {
            MySqlConnection conn = new MySqlConnection(connString);
            personList.Clear();
            using (conn)
            {
                String sql = "SELECT * FROM personeel ORDER BY Naam;";
                MySqlCommand cmd = new MySqlCommand(sql, conn);
                conn.Open();
                MySqlDataReader reader = cmd.ExecuteReader();
                StringBuilder htmlStr = new StringBuilder("");
 
                while (reader.Read())
                {
                    String Naam = htmlStr.Append(reader["Naam"]).ToString();
                    htmlStr.Clear();
                    String Voornaam = htmlStr.Append(reader["Voornaam"]).ToString();
                    htmlStr.Clear();
                    String Gsm = htmlStr.Append("0" + reader["GSM"]).ToString();
                    htmlStr.Clear();
 
                    personList.Add(new Person(Voornaam, Naam, Gsm));
                }
                conn.Close();
            }
            //gridView1 = new Telerik.Windows.Controls.RadGridView();
             
            gridView1.ItemsSource = personList;
             
            //CollectionViewSource.GetDefaultView(gridView1.ItemsSource).Refresh();
             
        }
Maarten
Top achievements
Rank 1
 answered on 13 Jul 2011
1 answer
281 views
Ho do i change the spacing between the lines that get created when i press enter inside the Richtectbox the lines are loose and speratesd and the specifying Line spacing as 1 doesnt work.
Also if i copy few lines from notepad and paste it in rich text box even then i have this issue
Please suggest how can i control this spacing
Vesko
Telerik team
 answered on 13 Jul 2011
1 answer
57 views
Is there a way to enable the same resizing behavior for InlineUIContainer as you get with images?
Iva Toteva
Telerik team
 answered on 13 Jul 2011
1 answer
200 views
I am trying to use the RadDocking and place the tabs on the right. However, when I set the TabStripPlacement property of the RadPaneGroup to "Right", the tabs take up the entire width of the control. When I set the width of the RadPane, the tab width is decreased, but the selected pane does not take up the remaining space. I have tried a lot of different things with no success - here is the xaml for the RadDocking:

  <telerik:RadDocking BorderBrush="{x:Null}" BorderThickness="0" Padding="0" Name="_dock" Margin="0">           
            <telerik:RadSplitContainer Name="_splitContainer" Width="450">
                <telerik:RadPaneGroup TabStripPlacement="Right" TabOrientation="Horizontal">
                    <telerik:RadPane Header="Item Image" Content="This is an item image" />
                    <telerik:RadPane Header="Tags" Content="These are the tags" />
                </telerik:RadPaneGroup>         
            </telerik:RadSplitContainer>
   </telerik:RadDocking>

Essentially, I'm trying to get the appearance of the TabControl with the TabStripPlacement property set to "Right" with the functionality of the RadDocking.

I would attach images, but I can't figure out how....
Pana
Telerik team
 answered on 13 Jul 2011
1 answer
926 views
Hi there!

Is there are feature which autosizes a combobox due to its content?
I guess I found something for the dropdown-width, but it would be nice to have something similar for the box itself.

Best Regards,
Matthias
Pana
Telerik team
 answered on 13 Jul 2011
1 answer
209 views
Hi All,
I am working on the Wpf 4.0 and using MVVM and Prism in my application.
I have added the Today button inside the control template for the RadTimePicker which is defined inside a resource dictionary.
Following is the code snippets for it (Bold and Italics part I have added to the control template of the RadDateTimePickerControlTemplate ):

 

 

 

 

<telerik:RadDropDownButton x:Name="PART_DropDownButton" CloseOnEnter="True" Grid.Column="1" DropDownIndicatorVisibility="Collapsed" Focusable="False" telerik:DateTimePickerExtensions.FocusContentOnOpen="True" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" IsTabStop="False" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="-1,0,0,0" Padding="0" PopupPlacementTarget="{Binding ElementName=PART_DateTimeInput}" TabIndex="1" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch"><telerik:RadDropDownButton.DropDownContent>

 

 

 

<Grid>

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

<ColumnDefinition Width="*"/>

 

 

 

 

<ColumnDefinition Width="*"/>

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

<RowDefinition/>

 

 

 

 

<RowDefinition/>

 

 

 

 

<RowDefinition Height="33"/>

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

<telerik:RadCalendar x:Name="PART_Calendar"

 

 

 

Culture="{TemplateBinding Culture}"

 

 

 

Grid.Column="0"

 

 

 

DisplayDateEnd="{Binding DisplayDateEnd, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" DateSelectionMode="{TemplateBinding DateSelectionMode}"

 

 

 

DisplayDateStart="{Binding DisplayDateStart, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" DisplayDate="{Binding DisplayDate, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"

 

 

 

IsReadOnly="{TemplateBinding IsReadOnly}"

 

 

 

Grid.Row="0"

 

 

 

Style="{TemplateBinding CalendarStyle}"

 

 

 

SelectableDateEnd="{Binding SelectableDateEnd, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"

 

 

 

SelectionMode="Single"

 

 

 

SelectedDate="{Binding SelectedDate, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"

 

 

 

SelectableDateStart="{Binding SelectableDateStart, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">

 

 

 

 

</telerik:RadCalendar>

 

 

 

 

<telerik:DateTimePickerClock x:Name="PART_Clock" Culture="{TemplateBinding Culture}" Grid.Column="1" EndTime="{TemplateBinding EndTime}" Header="Clock" IsReadOnly="{TemplateBinding IsReadOnly}" Grid.Row="0" Style="{TemplateBinding ClockStyle}" SelectedTime="{Binding SelectedTime, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" StartTime="{TemplateBinding StartTime}" TimeInterval="{Binding TimeInterval, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">

 

 

 

 

</telerik:DateTimePickerClock>

 

 

 

 

<StackPanel Grid.Row="2" Background="#ABACA7" >

 

 

 

 

<Border BorderThickness="1" Grid.Row="2" VerticalAlignment="Top" BorderBrush="whitesmoke" Margin="1" >

 

 

 

 

<Button Style="{StaticResource DatePickerButton}" Content="Today" />

 

 

 

 

</Border>

 

 

 

 

</StackPanel>

 

 

 

 

<!--Date Picker Button Style -->

 

 

 

 

 

 

 

 

<Style x:Key="DatePickerButton" TargetType="Button">

 

 

 

 

 

 

 

 

<Setter Property="Background" Value="#E0E0DE" />

 

 

 

 

 

 

 

 

<Setter Property="BorderBrush" Value="#91918F"/>

 

 

 

 

 

 

 

 

<Setter Property="VerticalAlignment" Value="Center"/>

 

 

 

 

 

 

 

 

<Setter Property="BorderThickness" Value="1"/>

 

 

 

 

 

 

 

 

<Setter Property = "HorizontalAlignment" Value="Center"/>

 

 

 

 

 

 

 

 

<Setter Property="Height" Value="24"/>

 

 

 

 

 

 

 

 

<Setter Property="Width" Value="50"/>

 

 

 

 

 

 

 

 

<Setter Property="FontSize" Value="11"/>

 

 

 

 

 

 

 

 

<Setter Property="FontWeight" Value="ExtraBold"/>

 

 

 

 

 

 

 

 

<Setter Property= "Margin" Value="2"/>

 

 

 

 

 

 

 

 

<Setter Property= "Cursor" Value="Hand"/>

 

 

 

 

 

 

 

 

<Setter Property="Template">

 

 

 

 

 

 

 

 

<Setter.Value>

 

 

 

 

 

 

 

 

<ControlTemplate TargetType="Button">

 

 

 

 

 

 

 

 

<Border BorderThickness="{TemplateBinding BorderThickness}"

 

 

 

 

 

 

 

BorderBrush="{TemplateBinding BorderBrush}"

 

 

 

 

 

 

 

Background="{TemplateBinding Background}"

 

 

 

 

 

 

 

Padding="{TemplateBinding Padding}"

 

 

 

CornerRadius="2.8"

 

 

 

>

 

 

 

 

 

 

 

 

<ContentControl Content="{TemplateBinding Content}"

 

 

 

HorizontalAlignment="Center"

 

 

 

VerticalAlignment="Center"/>

 

 

 

 

 

 

 

 

</Border>

 

 

 

 

 

 

 

 

</ControlTemplate>

 

 

 

 

 

 

 

 

</Setter.Value>

 

 

 

 

 

 

 

 

</Setter>

 

 

 

 

 

 

 

 

<Style.Triggers>

 

 

 

 

 

 

 

 

<Trigger Property="IsMouseOver" Value="true">

 

 

 

 

 

 

 

 

<Setter Property="Background" Value="{StaticResource SecondaryMouseOverColor}"/>

 

 

 

 

 

 

 

 

<Setter Property="BorderBrush" Value="Gold"/>

 

 

 

 

 

 

 

 

</Trigger>

 

 

 

 

 

 

 

 

<Trigger Property="IsPressed" Value="true">

 

 

 

 

 

 

 

 

<Setter Property="Background" Value="{StaticResource SecondaryMouseOverColor}"/>

 

 

 

 

 

 

 

 

<Setter Property="BorderBrush" Value="Orange"/>

 

 

 

 

 

 

 

 

</Trigger>

 

 

 

 

 

 

 

 

</Style.Triggers>

 

 

 

 

 

 

 

 

</Style>

 

 

 

 


Now in our application we have created a custom control for RadTimePicker , and I need to apply a trigger on today button that on clickof this "Today" button i should get today's date selected in the calendar.

So can I write any trigger in my style to do so ???? or how can we do this in present scenerio ???

Thanks in advance !!!!
Pana
Telerik team
 answered on 13 Jul 2011
1 answer
92 views
I notice that when there is no more space for the last pane in the RadPaneGroup, the pane is truncated. I prefer it not to be shown at all but still appears in the drop down menu navigation. How do I achieve this?
Pana
Telerik team
 answered on 13 Jul 2011
1 answer
142 views
Hi,

Is it possible to apply a ValueConverter to the selected item in an editable ComboBox?

I have successfully applied a ValueConverter to the items in the ComboBox itself (through creating a custom DataTemplate and assigning it to the ItemTemplate property of the ComboBox), but this ValueConverter is not applied to the currently selected item.

I have tried to open the ComboBox in Expression Blend and creating a custom ControlTemplate for it (and assigning this template to the EditableTemplate property). However I could not find a way to apply the converter to the PART_EditableTextbox in the generated template.

Thanks,
Kristian
Pana
Telerik team
 answered on 13 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?