Telerik Forums
UI for WPF Forum
5 answers
195 views

Im am changing the GridView HeaderCellStyle in code.
Calling .UpdateLayout does not show the new header style.

    Private Sub chkComplexFilter_Checked(ByVal sender As ObjectByVal e As System.Windows.RoutedEventArgs) Handles chkComplexFilter.Checked  
        ShowFilterHeader("GridViewHeaderCellFilterComplexStyle")  
        RadGridView1.UpdateLayout()  
    End Sub 
 
    Sub ShowFilterHeader(ByVal styleName As String)  
        For Each col In RadGridView1.Columns  
            col.HeaderCellStyle = CType(Resources(styleName), Style)  
        Next 
    End Sub 

Resizing the window (using the bottom right window corner) to make parts of the grid invisible and than visible again causes the new style to be shown in the freshly painted parts.

Stefan Dobrev
Telerik team
 answered on 26 Feb 2010
2 answers
62 views
Hi Vlad,

I have the following column in my RadGridView:


1
1
1
1
1
2
2
2
2
2
3
3
3
3
3
4
4
4


The column gets its data from a particular column of a List in code-behind. 
If i write the following data template: will each group header display the numbers one by one?

<DataTemplate> 
<TextBlock Background="Black" Foreground="White" Text="{Binding AssetType}" Width="30"></TextBlock> 
</DataTemplate> 


For me the header remains blank.

Also, why am i not able to find a link on your site to create my own thread?
jimit r
Top achievements
Rank 1
 answered on 26 Feb 2010
1 answer
93 views

I have tried modifying background to numberPosition but what it does, is setting the default background.

Andrey
Telerik team
 answered on 26 Feb 2010
1 answer
102 views
Given this XAML

 

 

<grid:GridViewImageColumn DataMemberBinding="{Binding ProtocolTypeBitmap}" Header="Type" UniqueName="Type"/>

Why does my bitmaps never appear? The column is ALLWAYS just white. No error, no nothing. I've checked a million times that the property 'ProtocolTypeBitmap' on the bound to object is valid. It IS a bitmap, it HAS data in it, but never show up. All other properties
(mostly text) that are bound to are showing up fine. The same INSTANCE of this object is used in another part of the app where the bitmap is shown using other techs. So something is going wrong with GridViewImageColumn.

Any ideas?

Vlad
Telerik team
 answered on 26 Feb 2010
2 answers
75 views
Hello, i'm willing to know if there is any way to get some kind of event from DNDmanager or a status that could say "Item is in dropinpossible state but mouse released" so if this case happens i remove item from itemscontrol. I need this because user could easily drag in items he wants, and to remove items - use drag off, not some kind of context menu.
Vaflis Vafliauskas
Top achievements
Rank 1
 answered on 25 Feb 2010
15 answers
193 views
Hi,

We're using the inner grid feature of the GridView control quite heavily and have encoutered an odd problem:
Whenever the parent row's viewmodel fires a NotifyPropertyChanged event, the inner grid is completely redrawn. Since the inner grid's columns use fill width the whole inner grid flashes. Oddly enough, the parent row appear okay.

Any idea why this is happening and how to avoid it?

<telerik:RadGridView  
            RowIndicatorVisibility="Hidden" 
            AutoGenerateColumns="False" 
            ShowGroupPanel="False"  
            RowDetailsVisibilityMode="VisibleWhenSelected" 
            Name="MainGrid" 
            ItemsSource="{Binding Alerts}" 
            ShowColumnHeaders="True" 
            > 
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn Name="Headline" EditTriggers="None" 
                                            DataMemberBinding="{Binding Headline,Mode=OneWay}" /> 
            </telerik:RadGridView.Columns> 
            <telerik:RadGridView.ChildTableDefinitions> 
                <telerik:GridViewTableDefinition  
                    AutoGenerateFieldDescriptors="False" 
                    > 
                    <telerik:GridViewTableDefinition.Relation> 
                        <telerik:PropertyRelation  
                            ParentPropertyName="DescriptionLines" /> 
                    </telerik:GridViewTableDefinition.Relation> 
                </telerik:GridViewTableDefinition> 
            </telerik:RadGridView.ChildTableDefinitions> 
            <telerik:RadGridView.HierarchyChildTemplate> 
                <DataTemplate> 
                    <Grid> 
                        <telerik:RadGridView  
                            RowIndicatorVisibility="Hidden" 
                            AutoGenerateColumns="False" 
                            ShowGroupPanel="False"  
                            RowDetailsVisibilityMode="Collapsed" 
                            ShowColumnHeaders="True" 
                            ItemsSource="{Binding DescriptionLines}" 
                            ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                            RowLoaded="ChildGridView_RowLoaded" 
                            ColumnsWidthMode="Fill" 
                            Margin="10,10,10,10" 
                            > 
                            <telerik:RadGridView.Columns> 
                                <telerik:GridViewDataColumn  
                                    Header="Device Name" 
                                    MaxWidth="300" 
                                    EditTriggers="None" 
                                    > 
                                    <telerik:GridViewDataColumn.CellTemplate> 
                                        <DataTemplate> 
                                            <ContentPresenter Content="{Binding AssociatedViewModel}" /> 
                                        </DataTemplate> 
                                    </telerik:GridViewDataColumn.CellTemplate> 
                                </telerik:GridViewDataColumn> 
                                <telerik:GridViewDataColumn  
                                    Header="Description" 
                                    DataMemberBinding="{Binding Description}"  
                                    TextWrapping="Wrap" 
                                    EditTriggers="None" 
                                    /> 
                                <telerik:GridViewDataColumn  
                                    Header="" 
                                    MaxWidth="100" 
                                    EditTriggers="None" 
                                    > 
                                    <telerik:GridViewDataColumn.CellTemplate> 
                                        <DataTemplate> 
  
                                            <!-- This contains a RadDropDownButton, I've cut it out now -->  
                                        </DataTemplate> 
                                    </telerik:GridViewDataColumn.CellTemplate> 
                                </telerik:GridViewDataColumn> 
                            </telerik:RadGridView.Columns> 
                        </telerik:RadGridView> 
                    </Grid> 
                </DataTemplate> 
            </telerik:RadGridView.HierarchyChildTemplate> 
 
        </telerik:RadGridView> 

Thanks,
yonadav
Hristo
Telerik team
 answered on 25 Feb 2010
2 answers
692 views
Hello,

To simplify my question, I have project with one RadGridView and 2 text boxes. textBox2 is binded to textBox1 and TextBlock inside RowDetailsTemplate is also binded to that same textBox1 exactly same way. Binding to inside RowDetailsTemplate does not work, binding from textBox1 to textBox2 works ok.
Can you please point me what I do wrong?

XAML is:
<Window x:Class="WpfApplication11.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="Window1" Height="371" Width="747" xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView">  
    <Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition></RowDefinition>  
            <RowDefinition Height="Auto" MinHeight="19"></RowDefinition> 
        </Grid.RowDefinitions> 
          
        <my:RadGridView Grid.Row="0" Name="radGridView1" RowDetailsVisibilityMode="VisibleWhenSelected">  
            <my:RadGridView.RowDetailsTemplate> 
                <DataTemplate> 
                    <StackPanel Orientation="Horizontal" Margin="10,10,10,10">  
                        <TextBlock Text="Detail from textBox1 is : " /> 
                        <TextBlock Text="{Binding ElementName=textBox1, Path=Text}" /> 
                    </StackPanel> 
                </DataTemplate> 
            </my:RadGridView.RowDetailsTemplate> 
        </my:RadGridView> 
          
        <StackPanel Grid.Row="1" Orientation="Horizontal">  
            <TextBox Width="100" Name="textBox1"></TextBox> 
            <TextBox Width="100" Text="{Binding ElementName=textBox1, Path=Text}" Name="textBox2"></TextBox>      
        </StackPanel> 
          
    </Grid> 
</Window> 
 
 and the code behind is:
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Text;  
using System.Windows;  
using System.Windows.Controls;  
using System.Windows.Data;  
using System.Windows.Documents;  
using System.Windows.Input;  
using System.Windows.Media;  
using System.Windows.Media.Imaging;  
using System.Windows.Navigation;  
using System.Windows.Shapes;  
using System.Data;  
 
namespace WpfApplication11  
{  
    /// <summary> 
    /// Interaction logic for Window1.xaml  
    /// </summary> 
    public partial class Window1 : Window  
    {  
        public Window1()  
        {  
            InitializeComponent();  
            DataToGrid1();  
        }  
 
        private void DataToGrid1()  
        {  
            DataTable myDataTable = new DataTable();  
            myDataTable.Columns.Add("Id", typeof(int));  
            myDataTable.Columns.Add("Model", typeof(string));  
            myDataTable.Columns.Add("Color", typeof(string));  
            myDataTable.Columns.Add("Prize", typeof(double));  
 
            for (int i = 0; i < 6; i++)  
            {  
                myDataTable.Rows.Add(i, "BMW", "Blue", 5700);  
            }  
            myDataTable.AcceptChanges();  
 
            radGridView1.ItemsSource = myDataTable;    
 
        }  
    }  
}  
 
Tatu Nokelainen
Top achievements
Rank 1
 answered on 25 Feb 2010
1 answer
62 views
Hi,
I am using RAD tree and Tab control from telerik in my application.
This might have been asked on here before - but I couldn't find it through the searches.
In my application I have 2 tabs - first tab containing list of objects. I want to be able to grab a selected object from the first tab, and drag it over second tab that I want to drop it into. So when I have it over the desired tab, the tab selection will change to that.

Is this possible? Would anyone care to share any ideas as to how to do it?

Thanks,
Balaram
Miroslav
Telerik team
 answered on 25 Feb 2010
1 answer
207 views
Greetings All,

Ran into a problem with creating groups via XAML GroupDescriptors. I would like to set some basic groups to start with when the grid loads, and still allow the user to add new grouping using the "drag and drop into the group panel" interface. For example, load the grid grouped by county, then allow the user to choose if they would like to further group by state, city, whatever.

My problem is, when I attempt to add another group via the interface, the grouping works but each new group only has one child row even if many are available. If I then click the row header of the new grouped column, the data in the one visible row changes. So... the other rows are there somewhere, I can just see one at a time. Very odd.

 If I attempt the same thing using only drag and drop with no predefined GroupDescriptors it works wonderfully.

Am I missing something, or have I run into a limitation of Grouping in the RadGridView?

Thanks for any help!


Tsvyatko
Telerik team
 answered on 25 Feb 2010
1 answer
134 views
Hi

 i need to create make my slider dynamic. so i need to change my maximum value for each 5 mins, so am trying to  bind my maximum and minimum value(DateTime) from database. here am facing problem,that i cannot bind the values in minimum,maximum and in the textblock, i cant even call the biniding function here, please tel me how to call and bind my values to the slider

 

<

 

telerik:RadSlider Minimum="{Binding {StaticResource MinValue}}" Maximum="{Binding {StaticResource MaxValue}}" TickFrequency="1" TickPlacement="BottomRight" IsSnapToTickEnabled="True" Margin="133,175,114,204">

 

 

 

 

 

 

 

<telerik:RadSlider.TickTemplate>

 

 

 

 

 

 

 

<DataTemplate>

 

 

 

 

 

 

 

<StackPanel>

 

 

 

<Ellipse Width="5" Height="5" Fill="Black" HorizontalAlignment="Center"/>

 

 

 

<TextBlock Text="{Binding}" FontSize="10"/>

 

 

 

</StackPanel>

 

 

 

 

 

 

 

</DataTemplate>

 

 

 

 

 

 

 

</telerik:RadSlider.TickTemplate>

 

 

 

 

 

 

 

</telerik:RadSlider>

 

Kiril Stanoev
Telerik team
 answered on 25 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?