Telerik Forums
UI for WPF Forum
1 answer
131 views
Hi ,im facing strange problem  , project compiles successfully,app works fine to, but designer window shows error , i dunno whats the "type: Customer" it doesnt exits in my project
thanks
itemsource provider is EntityFramework
<telerik:RadGridView.Columns>
              
  <telerik:GridViewDataColumn Header="Cost" DataMemberBinding="{Binding Cost}"  DataType="{x:Type System:Double}" >
                    <grid:GridViewDataColumn.AggregateFunctions>
                        <data:SumFunction Caption="Sumا "  SourceField="Cost" />
                    </grid:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>

</telerik:RadGridView.Columns>



Error:
Invalid property or field - 'Cost' for type: Customer
   at Telerik.Windows.Data.Expressions.MemberAccessTokenExtensions.CreateMemberAccessExpression(IMemberAccessToken token, Expression instance) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\MemberAccess\Tokenizer\MemberAccessTokenExtensions.cs:line 21
   at Telerik.Windows.Data.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\ExpressionFactory.cs:line 32
   at Telerik.Windows.Data.Expressions.ExpressionFactory.MakeMemberAccess(Expression instance, String memberName, Boolean liftMemberAccessToNull) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\ExpressionFactory.cs:line 42
   at Telerik.Windows.Data.Expressions.PropertyAccessExpressionBuilder.CreateMemberAccessExpression() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\MemberAccess\PropertyAccessExpressionBuilder.cs:line 15
   at Telerik.Windows.Data.Expressions.EnumerableSelectorAggregateFunctionExpressionBuilder.CreateMemberSelectorExpression() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\Aggregates\EnumerableSelectorAggregateFunctionExpressionBuilder.cs:line 37
   at Telerik.Windows.Data.Expressions.EnumerableSelectorAggregateFunctionExpressionBuilder.CreateAggregateExpression() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\Aggregates\EnumerableSelectorAggregateFunctionExpressionBuilder.cs:line 28
   at Telerik.Windows.Data.EnumerableSelectorAggregateFunction.CreateAggregateExpression(Expression enumerableExpression) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Data\Grouping\Aggregates\EnumerableSelectorAggregateFunction.cs:line 22
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.<ProjectionPropertyValueExpressions>b__3(AggregateFunction f) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilder.cs:line 212
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.CreateProjectionInitExpression() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilder.cs:line 203
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.CreateAggregateFunctionsProjectionMemberBinding() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilder.cs:line 195
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.<CreateMemberBindings>d__0.MoveNext() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilder.cs:line 113
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at System.Linq.Expressions.ReadOnlyCollectionExtensions.ToReadOnlyCollection[T](IEnumerable`1 sequence)
   at System.Linq.Expressions.Expression.MemberInit(NewExpression newExpression, IEnumerable`1 bindings)
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.CreateSelectBodyExpression() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilder.cs:line 105
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilder.CreateSelectExpression() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilder.cs:line 97
   at Telerik.Windows.Data.Expressions.GroupDescriptorExpressionBuilderBase.CreateQuery() in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Expressions\Grouping\GroupDescriptorExpressionBuilderBase.cs:line 30
   at Telerik.Windows.Data.QueryableExtensions.Aggregate(IQueryable source, IEnumerable`1 aggregateFunctions) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\Collections\QueryableExtensions.cs:line 92
   at Telerik.Windows.Controls.GridView.GridViewDataControl.CalculateAggregates() in c:\Builds\WPF_Scrum\GridView_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 3066
   at Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass3c.<Bind>b__3b() in c:\Builds\WPF_Scrum\GridView_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 3345
   at Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Controls\CursorManager.cs:line 16
   at Telerik.Windows.Controls.GridView.GridViewDataControl.Bind(Object newValue) in c:\Builds\WPF_Scrum\GridView_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 3271
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnItemsSourceChanged(Object oldValue, Object newValue) in c:\Builds\WPF_Scrum\GridView_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 2946
   at Telerik.Windows.Controls.DataControl.OnItemsSourcePropertyChanged(DependencyObject origin, DependencyPropertyChangedEventArgs args) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\DataControl.cs:line 361
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.DataControl.set_ItemsSource(Object value) in c:\Builds\WPF_Scrum\Core_WPF\Sources\Development\Core\Data\DataControl.cs:line 149
   at Telerik.Windows.Controls.RadGridView.OnApplyTemplate() in c:\Builds\WPF_Scrum\GridView_WPF\Sources\Development\Controls\GridView\GridView\GridView\RadGridView.cs:line 226
   at System.Windows.FrameworkElement.ApplyTemplate()
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Designer.SimpleViewManager.DesignerBackground.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Decorator.MeasureOverride(Size constraint)
   at Microsoft.Windows.Design.Interaction.DesignerView.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Designer.Viewport.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   at MS.Internal.Designer.VSIsolatedDesigner.ViewHolder.Initialize()
   at MS.Internal.Designer.VSIsolatedDesigner.ViewHolder..ctor(UIElement content)
   at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.get_ViewHandle()
   at MS.Internal.Host.Isolation.IsolatedView.get_ViewHandle()
   at MS.Internal.Designer.DesignerPane.LoadDesignerView()
Stefan Dobrev
Telerik team
 answered on 30 Oct 2009
1 answer
84 views
Hi all,

I want to interface the Telerik RadGridView control with some data on my SQL Server backend. At the moment I am deciding the best method to do this, what I want to do on the grid is to have regions where user input is allowed (editable) and regions where it is only read only. Users will need to be able to change the editable values (which are pulled from the database) and these changes will need to be updated into the database, then used to recalculated (on the client end) and then reflected in the read only regions of the grid.

At the moment I've written functionality to get data from the database (LINQ TO SQL) and then individually create rows which are inserted into a data table which is then bound to the RAD datagrid. Will I be able to control the properties of each row this way? For example having some rows editable, some read only and also styling options such as cell back ground colour, font bolding etc.

I apologise if my description is very vague but it's the best way I can explain it at the moment!

Thanks in advance!

Tim.
Stefan Dobrev
Telerik team
 answered on 30 Oct 2009
1 answer
109 views
Hi All.

I have an XML and I need to create the GridView based on it's content. I need to be able to add rows to the GridView manually in code. No DataView or DependencyProperties. Would appreciate a code example. The headers was easy to create, only need the rows themselves.

Regards
 Kjetil
Vlad
Telerik team
 answered on 30 Oct 2009
4 answers
171 views
Please help me!!!!

Hi guys!!!, Im realy scared in my RadGrid appear a ghost row, when this show 2 or more rows whit child, this event takes place when in other RadGrid changes the selection item, attach image, my code for this radGrid is the next:
                    DataTable _dtStudy =  wpfWebServexCore.ServiceGeneralClass.studys(((DataRow)rgvPatients.SelectedItem).ItemArray[0].ToString());
                    _idPatient = ((DataRow)rgvPatients.SelectedItem).ItemArray[0].ToString();
                    rgvSeries.ItemsSource = _dtStudy;
                    rgvSeries.DataMember = _dtStudy.TableName;
                    if (rgvSeries.TableDefinition.ChildTableDefinitions.Count > 0)
                    {
                        for (int i = 0; i < rgvSeries.TableDefinition.ChildTableDefinitions.Count; i++)
                        {
                            rgvSeries.TableDefinition.ChildTableDefinitions.RemoveAt(i);
                        }
                    }

                    foreach (DataRow _dr in _dtStudy.Rows)
                    {
                         
                        GridViewTableDefinition definition = new GridViewTableDefinition();
                        definition.AutoGenerateFieldDescriptors = false;
                        definition.DataSource = wpfWebServexCore.ServiceGeneralClass.series(_dr["StudyInstanceUID"].ToString());

                        //rgvSeries.UpdateLayout();

                        TableRelation _relation = new TableRelation();
                        _relation.FieldNames.Add(new FieldDescriptorNamePair("StudyInstanceUID", "StudyInstanceUID_FKey"));
                        definition.Relation = _relation;

                        rgvSeries.TableDefinition.ChildTableDefinitions.Add(definition);
                       
                        rgvSeries.AddHandler(GridViewDataControl.RowValidatingEvent, new EventHandler<GridViewRowValidatingEventArgs>(this.selectChild_clik));
                        
                    }
                    ((ExpandableDataRecord)rgvSeries.Records[0]).IsExpanded = true;
                    wpfWebServexCore.ClassGlobal.DtStudy = _dtStudy;
                    rgvImages.ItemsSource = new DataTable();

AND the XAML

 <telerik:RadGridView Height="auto" Name="rgvSeries" Width="auto" SelectionChanged="rgvSeries_SelectionChanged" ShowGroupPanel="False" IsFilteringAllowed="False" telerik:StyleManager.Theme="Office_Black" IsReadOnly="True" AutoGenerateColumns="False" ItemsSource="{Binding}" MouseDoubleClick="buttonAbrirEstudio_Click" CanUserReorderColumns="True" CanUserResizeColumns="True" CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" Background="White" ColumnsWidthMode="Fill" HorizontalAlignment="Right" VerticalAlignment="Top">
                                <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn HeaderText="UID" UniqueName="StudyInstanceUID" DataType="{x:Null}"   IsVisible="False" />
                                <telerik:GridViewDataColumn HeaderText="Fecha" UniqueName="Fecha" DataType="{x:Null}"  />
                                <telerik:GridViewDataColumn HeaderText="Descripción" UniqueName="Descripcion" DataType="{x:Null}"  />
                                <telerik:GridViewDataColumn HeaderText="Modalidad" UniqueName="Modalidad" DataType="{x:Null}"  />
                                <telerik:GridViewDataColumn HeaderText="Medico" UniqueName="Medico" DataType="{x:Null}"  />
                                <telerik:GridViewDataColumn HeaderText="Reporte" UniqueName="Reporte" DataType="{x:Null}"  />
                            </telerik:RadGridView.Columns>
                                    
                            <telerik:RadGridView.HierarchyChildTemplate>
                                <DataTemplate>
                                    <Border BorderBrush="#FFFDDFAA" BorderThickness="2" Margin="20,2">
                                      
                                       
                                        <telerik:RadGridView x:Name="rgvhijoSerie" IsFilteringAllowed="False" ShowGroupPanel="False" IsReadOnly="True" SelectionChanged="rgvhijoSerie_SelectionChanged" MouseDoubleClick="buttonAbrirEstudio_Click" RowIndicatorVisibility="Collapsed"  CanUserFreezeColumns="False" ShowColumnHeaders="False" Background="White" GridLinesVisibility="None">                                            
                                            <telerik:RadGridView.Columns>
                                                <telerik:GridViewDataColumn HeaderText="UID" UniqueName="StudyInstanceUID" DataType="{x:Null}"  IsVisible="False" />
                                               

                                                <telerik:GridViewDataColumn HeaderText="Fecha" UniqueName="" DataType="{x:Null}" Width="auto" IsVisible="False"  />
                                                <telerik:GridViewDataColumn HeaderText="Descripción" UniqueName="Descripcion" DataType="{x:Null}" Width="auto" />
                                                <telerik:GridViewDataColumn HeaderText="Modalidad" UniqueName="" DataType="{x:Null}" Width="auto" IsVisible="False"/>
                                                <telerik:GridViewDataColumn HeaderText="Medico" UniqueName="" DataType="{x:Null}" Width="auto" IsVisible="False" />
                                                <telerik:GridViewDataColumn HeaderText="Reporte" UniqueName="" DataType="{x:Null}" Width="auto" IsVisible="False" />

                                            </telerik:RadGridView.Columns>                                            
                                        </telerik:RadGridView>
                                        
                                       
                                    </Border>
                                </DataTemplate>
                            </telerik:RadGridView.HierarchyChildTemplate>                            
                        </telerik:RadGridView>
 

Pleas help me, or can you give me any idea

Regards!!
Armando
Top achievements
Rank 1
 answered on 29 Oct 2009
1 answer
174 views
I want to change foreground color of a column STATUS cell value  in a grid such that if STATUS=Available then text should appear in Green else in Red.I applied the style ,while debugging Convert method is debuggung sucessfully reading correct value but doesn't show up on grid.

 <Converter:DocumentColorConverter  x:Key="ConvertDocumentColor" />

                                                                            <Style TargetType="{x:Type telerik:GridViewCell}">
                                                                                <Setter Property="Foreground" Value="{Binding [STATUS], Converter={StaticResource ConvertDocumentColor}}" />
                                                                            </Style>
 public class DocumentColorConverter : IValueConverter
    {

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            System.Windows.Media.Brush returnValue;
            string controlType = "";
            if (value != null)
                controlType = value.ToString();

            switch (controlType)
            {
                case "Available":
                    returnValue = Brushes.Green;
                    break;
                case "UnAvailable":
                    returnValue = Brushes.Red;
                    break;
                default:
                    returnValue = Brushes.Black;
                    break;

            }

            return returnValue;
        }

        #endregion

        #region IValueConverter Members


        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }

Pavel Pavlov
Telerik team
 answered on 29 Oct 2009
2 answers
285 views
Hello,

I ran into a problem when adding a columns thru code. It seemed to work fine in the 2009 Q3 Beta 1 version. basically i'm adding the columns in codebehind then later on i'm adding data to the grid. When I do that the filters dont show up on the Column Headers.

here is some sample code.
<Window x:Class="WpfApplication1.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    Title="Group Chart Test">  
    <Grid>          
        <Grid.RowDefinitions> 
            <RowDefinition /> 
            <RowDefinition Height="30" /> 
        </Grid.RowDefinitions> 
        <Grid.ColumnDefinitions> 
            <ColumnDefinition /> 
            <ColumnDefinition /> 
        </Grid.ColumnDefinitions> 
        <telerik:RadGridView Name="rgv"   
                             AutoGenerateColumns="False" 
                             Grid.Row="0" 
                             Grid.ColumnSpan="2"/>  
 
        <Button Click="Button_Click"   
                Grid.Row="1"   
                Grid.Column="0" 
                Content="Add Columns"/>  
        <Button Click="Button_Click_1"   
                Grid.Row="1" 
                Grid.Column="1" 
                Content="Add Items"/>  
    </Grid> 
</Window> 
public partial class Window1 : Window  
    {  
 
        ArrayList arrayList = new ArrayList();  
        public Window1()  
        {  
            try 
            {  
 
                InitializeComponent();  
 
                for (int i = 0; i < 100; i++)  
                {  
                    arrayList.Add(new myObject()  
                    {  
                        Year = 2002,  
                        Quarter = "First",  
                        Make = "Chevrolet",  
                        Sales = 1000  
                    });  
                }  
            }  
            catch (Exception ex)  
            {  
                MessageBox.Show(ex.ToString());  
            }  
        }  
 
        private void Button_Click(object sender, RoutedEventArgs e)  
        {  
            rgv.Columns.Add(new GridViewDataColumn()  
            {  
                UniqueName = "Year",  
                Header = "Year" 
            });  
 
            rgv.Columns.Add(new GridViewDataColumn()  
            {  
                UniqueName = "Quarter",  
                Header = "Quarter" 
            });  
 
            rgv.Columns.Add(new GridViewDataColumn()  
            {  
                UniqueName = "Make",  
                Header = "Make" 
            });  
 
            rgv.Columns.Add(new GridViewDataColumn()  
            {  
                UniqueName = "Sales",  
                Header = "Sales" 
            });  
        }  
 
        private void Button_Click_1(object sender, RoutedEventArgs e)  
        {  
            rgv.ItemsSource = arrayList;  
        }  
    }  
 
    class myObject  
    {  
        public int Year { getset; }  
        public String Quarter { getset; }  
        public String Make { getset; }  
        public double Sales { getset; }  
    } 

if I set the DataType of the column the filters show up. Not sure if its a bug or not but thought i would ask.

Thanks Again,
Boots
Stefan Dobrev
Telerik team
 answered on 29 Oct 2009
1 answer
38 views
Hi, in every row of my RadGridView appears a circle, and in  the child too. I attach an image where you can see it.
Vlad
Telerik team
 answered on 29 Oct 2009
1 answer
127 views
I want to not to show horizontal scroolbar on grid .I used this style but doesn't work
<Style TargetType="{x:Type telerik:GridViewScrollViewer}">
                                                            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
                                                        </Style>
Hristo
Telerik team
 answered on 28 Oct 2009
1 answer
129 views
So, we are using an older version of the Grid control.  Kinda stuck with it for now because we are at the very end of product development and we can't afford to be changing anything at this point.

I have had an annoying problem for awhile that has been a lower bug issue, but now I'm finally getting to it.

I'm assuming the developers used this method of binding data to the cell because this was the only way to use a converter. But this is messing up the default cell style. the cell doesn't look like the other cells. It's kinda a pain to go into every instance of the grid we are using in the application and fix the style where they have overridden the template.

Question: Is this the best way to do this? Is there a better way to do this binding without overriding the template?  Again, we can't update the control. We are stuck with 2009.1.312.35 for now. 


<
telerik:GridViewDataColumn UniqueName="UserNames" 
                                                    HeaderText="{x:Static properties:Resources.Population_GridHeader_UserName}"
                            <telerik:GridViewColumn.CellStyle> 
                                <Style TargetType="{x:Type telerik:GridViewCell}"
                                    <Setter Property="Template"
                                        <Setter.Value> 
                                            <ControlTemplate TargetType="{x:Type telerik:GridViewCell}"
                                                <Border BorderThickness="{TemplateBinding BorderThickness}" 
                                                        BorderBrush="{TemplateBinding BorderBrush}" 
                                                        Background="{TemplateBinding Background}"
                                                    <TextBlock Text="{Binding Path=UserNames, Mode=OneWay, Converter={StaticResource UserNameListToStringConverter}}" 
                                                               VerticalAlignment="Center" 
                                                               Margin="5" /> 
                                                </Border> 
                                            </ControlTemplate> 
                                        </Setter.Value> 
                                    </Setter> 
                                </Style> 
                            </telerik:GridViewColumn.CellStyle> 
                        </telerik:GridViewDataColumn> 
Vlad
Telerik team
 answered on 28 Oct 2009
6 answers
128 views
Hi,
I have bound the GridView to an collection of business-objects that have a IsSelected-Property(bool) and an according CheckBox-Column.
To be able to change this property for all objects in a group I came up with this:
 
<Style x:Key="CustomRowStyle"  TargetType="telerik:GridViewGroupRow"
    <EventSetter Event="Loaded" Handler="GridViewGroupRow_Loaded" /> 
</Style> 
 
        private void GridViewGroupRow_Loaded(object sender, RoutedEventArgs args) 
        { 
            GridViewGroupRow groupRow = (GridViewGroupRow)args.OriginalSource; 
 
            CheckBox cb = new CheckBox() { Content = groupRow.Group.Key }; 
 
            cb.Tag = groupRow
 
            cb.Checked += new RoutedEventHandler(groupRow_CheckChanged); 
            cb.Unchecked += new RoutedEventHandler(groupRow_CheckChanged); 
 
            groupRow.Header = cb
        } 
 
 
 
        void groupRow_CheckChanged(object sender, RoutedEventArgs e) 
        { 
            GridViewGroupRow groupRow = (sender as CheckBox).Tag as GridViewGroupRow; 
 
            recursiveGroupSelection(groupRow.Group, (sender as CheckBox).IsChecked ?? false); 
        } 
 
        private void recursiveGroupSelection(IGroup g, bool check) 
        { 
            foreach (var item in g.Items)//select items in this group 
            { 
                if (item is BusinessObject) 
                { 
                    (item as BusinessObject).IsSelected = check
                } 
            } 
             
            //the same for all subgroups 
            foreach (Group sub in g.Subgroups) 
            { 
                recursiveGroupStationSelection(sub, check); 
            } 
        } 
1. This checks and unchecks all items in the group and subgroups but I do not know how to get to the GridViewGroupRow of the subgroups and also (un)check their CheckBoxes. I can get the Group from GridViewGroupRow but when walking down the subgroups I do not know how to get their GridViewGroupRows.
2. I also wasn't able to get the PropertyName from the Group - the Group's Key-Property is the actual property's value. How to get the property's name to know what property is grouped by this Group?
3. And it would be very nice if (un)checking items would be reflected in the parent-group-checkbox(es).

Any suggestion is welcome.

Best Regards
Steffen
Pavel Pavlov
Telerik team
 answered on 27 Oct 2009
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?