Telerik Forums
UI for WPF Forum
4 answers
112 views
Hi.
Small problem:
Imagine a class setup of:
public class DisplayData 
   public string Name { getset; } 
   public SomeOtherClass Prop { getset; } 
 
public class SomeOtherClass  
   public string OtherName { getset; } 

Now I have an ObservableCollection<DisplayData> to display in my Grid.
Problem is the following setup does no display SomeOtherClass nicely (how should it...)
<telerik:GridViewDataColumn  
     Header="Name" 
     DataMemberBinding="{Binding Path=Name, Mode=OneWay}" 
     Width="2*" 
     IsReadOnly="True"/> 
<telerik:GridViewDataColumn  
     Header="Other" 
     DataMemberBinding="{Binding Path=Prop, Mode=OneWay}" 
     Width="3*" 
     IsReadOnly="True"/> 

If I change the second column like this:
<telerik:GridViewDataColumn   
     Header="Name"  
     DataMemberBinding="{Binding Path=Name, Mode=OneWay}"  
     Width="2*"  
     IsReadOnly="True"/>  
<telerik:GridViewDataColumn   
     Header="Other"  
     DataMemberBinding="{Binding Path=Prop.OtherName, Mode=OneWay}"  
     Width="3*"  
     IsReadOnly="True"/>  

All displays fine. However I loose the Ability to Filter/Group the second column.
I am searching for something like:
<telerik:GridViewDataColumn    
     Header="Name"   
     DataMemberBinding="{Binding Path=Name, Mode=OneWay}"   
     Width="2*"   
     IsReadOnly="True"/>   
<telerik:GridViewDataColumn    
     Header="Other"   
     DataMemberBinding="{Binding Path=Prop, Mode=OneWay}" 
     DisplayMemberPath="OtherName"   
     Width="3*"   
     IsReadOnly="True"/>   

And I can't seem to find any solution..

I seem to walking in the dark here.. so could someone please enlighten me ?

Yours,
Nils
Nils
Top achievements
Rank 1
 answered on 11 Aug 2009
1 answer
189 views
Hello everybody.

We have a RadGridView with 4 columns: 2 are simply text column, while 2 have a button.

The problem we can't figure out is: how we can know the row index number (=item) starting from the button click event?

Thank you for your cooperation.

Attilio Gelosa.
Vlad
Telerik team
 answered on 11 Aug 2009
7 answers
330 views
I am creating tabs on the fly and need to be able to apply a theme to the actual RadTabItem.

I have tried the following with no success:
1) tab1.SetValue(Telerik.Windows.Controls.StyleManager.ThemeProperty, new VistaTheme());
2) Telerik.Windows.Controls.StyleManager.SetTheme(tab1, new VistaTheme());

tab1 is the tab I created:
RadTabItem tab1 = new RadTabItem();

Also, I cannot apply the theme to an existing tab (within the actual XAML) dynamically either.  If a RadTabItem exists with name "tab2" on the xaml form and I try and go and programatically apply a theme somewhere in the code it does not apply at all...

Any help with this would be great.  I really need to be able to apply themes on the fly to dynamically created telerik objects.

Thanks

 

Bobi
Telerik team
 answered on 11 Aug 2009
4 answers
115 views
Hy
How can I make the width of the grid to be strech on all window width?
Thanks
Orit
Top achievements
Rank 1
 answered on 11 Aug 2009
1 answer
225 views
If a I create a simple form with just a RadGridView control:

<Grid>
        <telerik:RadGridView Name="radGridView1"/>
</Grid>

As I resize the window, the grid streches with the window and vertical/horizontal scrollbars appear if there's any extra rows/columns in the grid.  But if I change the container to a canvas:

<Canvas>
        <telerik:RadGridView Name="radGridView1"/>
</Canvas>

Then any overflow is hidden.  Even if I wrap the RadGridView in it's own grid under the canvas no scrollbars appear.  This seems to happen if there's a canvas element anywhere in the container hierarchy.  
Hristo
Telerik team
 answered on 10 Aug 2009
1 answer
129 views
Working with: Version 2009.1.526.35

Trying to set SelectedItem.
Code:

<telerik:RadGridView AutoGenerateColumns="False"
                             SelectedItem="{Binding Path=Entity, Mode=TwoWay}" IsReadOnly="False"
            ItemsSource="{Binding Path=Entities}"

In my constructor of my model I create a instance of Entity (Selected) and a List of Entities(ItemSource).

When I run, I get a Object Reference not Set... exception.
The same code works fine with a ListBox.

Rossen Hristov
Telerik team
 answered on 10 Aug 2009
1 answer
180 views
Hy
I want to add a Radio button column to my grid
I used the follwing code
how can I let only one radio button to be select
(a kind of a radio button group)
Thanks

<telerik:RadGridView.Resources> 
                        <ControlTemplate x:Key="cellTemplate1" TargetType="{x:Type telerik:GridViewCell}">  
                            <RadioButton IsChecked="{Binding Field.Record.Data.RB, RelativeSource={RelativeSource TemplatedParent}}"   
                                            HorizontalAlignment="Center" VerticalAlignment="Center"  /> 
                        </ControlTemplate> 
                        <Style x:Key="RBbooleanCellStyle">  
                            <Setter Property="telerik:GridViewCell.Template" Value="{StaticResource cellTemplate1}" /> 
                        </Style> 
                    </telerik:RadGridView.Resources> 
Orit
Top achievements
Rank 1
 answered on 10 Aug 2009
2 answers
47 views
Hello guys,
I've rebuilded the First Look Example with ChildTemplate, foto... etc.
Now my problem ist, that whenever I group by a column by dragging it into the header, only the first and the last record's childtemplate show up, when clicking the plus (+). When I click the plus of other records, the plus only changes to a minus and nothing happens. But when I cancel grouping this records, the record's childTemplates are expanded and shown. It looks like they are expanded in the background but cannot be shown in the grouped grid.

I'm using following methods seen in one of your examples. The first I'm using to have default collapsed grouping and the second to change selected row on first click (needs your sample class DependencyObjectExtensions.cs).

private void GridViewGroupRow_Loaded(object sender, RoutedEventArgs args)
{
GridViewGroupRow groupRow = (GridViewGroupRow)args.OriginalSource;
groupRow.IsExpanded = 
false; }

private
 void HeaderButton_Click(object sender, RoutedEventArgs e) {
FrameworkElement element = (FrameworkElement)sender;
var row = element.GetVisualParent<GridViewRow>();
row.IsSelected = 
true;

Is possibly here something going wrong?


Any help would be appreciated
flo ulmé
Top achievements
Rank 1
 answered on 07 Aug 2009
2 answers
416 views
Hi,

I'm having a problem with the GridView control on a client's machine. When I or my colleagues compile and run it everything goes right. However, when we deploy on a client's machine we get an error message saying "Cannot add content of type 'Telerik.Windows.Controls.GridViewDataColumn' to an object of type 'Telerik.Windows.Controls.GridViewColumnCollection'. Error at object 'Telerik.Windows.Controls.GridViewDataColumn' in markup file 'CowculationsWindows;component/useradmin.xaml' Line 57 Position 18."

This is the code:

<telerik:RadGridView Margin="15,66,9,46" Name="rgvUsers" AutoGenerateColumns="False" AddingNewDataItem="rgvUsers_AddingNewDataItem" ValidationMode="Row" AutoGenerateHierarchyFromDataSet="True" ColumnsWidthMode="Auto">   
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataType="{x:Null}" HeaderText="Full Name" UniqueName="UserFullName" Header="Full Name"/>
                <telerik:GridViewDataColumn DataType="{x:Null}" HeaderText="User Name" UniqueName="UserName" Header="User Name"/>
                <telerik:GridViewDataColumn DataType="{x:Null}" HeaderText="Password" UniqueName="Password"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

The particular line where the error happens is this:

<telerik:GridViewDataColumn DataType="{x:Null}" HeaderText="Full Name" UniqueName="UserFullName" Header="Full Name"/>

The GridView uses hierarchy, so that might be an issue.

Please help.

Regards,

-Harun



Harun Residbegovic
Top achievements
Rank 1
 answered on 07 Aug 2009
1 answer
695 views

Hello,

I know how to create a combobox column and fill it with value, however

each combobox cell in the column does not show the drop down arrow, unless

the user clicks on the cell.

I tries using a combobox template on the column and visually it works, however when I do so

the combobox's possible values are not displayed in its drop down.

Hope you can assist.

Erez

 

Rossen Hristov
Telerik team
 answered on 07 Aug 2009
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?