Telerik Forums
UI for WPF Forum
3 answers
155 views
hi!

I developed a UserControl with a RadComboBox and RadMaskedTextBox, snippet code is like this:

<cl:ctlIdentificacionPersona
    xmlns:cl="clr-namespace:App_ControlLibrary"
    xmlns:tb="clr-namespace:App_EntityLibrary.Tablas;assembly=App_EntityLibrary"
    mc:Ignorable="d"
    x:Name="UserControl" Height="62" Width="368">
    <Grid x:Name="pnlBaseControl" RenderTransformOrigin="0.5,0.5" Margin="0,0,5,0" Height="59" VerticalAlignment="Top">
        <TextBlock x:Name="lblTipoDocumento" Text="{x:Static cl:resxIdentificacionPersona.lblTipoDocumento}" VerticalAlignment="Top" Height="21" Margin="5,4,170,0" Padding="68,2,0,5"/>
        <telerik:RadComboBox x:Name="cbxTipoDocumento" SelectedValuePath="CA001" DisplayMemberPath="CA002" IsEditable="False" HorizontalAlignment="Left" Margin="5,26,0,0" VerticalAlignment="Top" Height="27" Width="190" TabIndex="0"/>
        <TextBlock x:Name="lblNumeroDocumento" Text="{x:Static cl:resxIdentificacionPersona.lblNumeroDocumento}" Margin="199,4,0,0" VerticalAlignment="Top" Height="21" Padding="41,2,0,5" HorizontalAlignment="Left" Width="118"/>
        <telerik:RadMaskedTextBox x:Name="fmtNumeroDocumento" Margin="197,26,0,0" TabIndex="1" Mask="n0" MaskType="Numeric" HorizontalContentAlignment="Right" Height="27" VerticalAlignment="Top" HorizontalAlignment="Left" Width="120"/>
        <telerik:RadButton x:Name="btnBuscar" Margin="321,16,0,2" HorizontalAlignment="Left" Width="39" Background="{x:Null}" BorderBrush="{x:Null}">
            <Image Source="/App_ControlLibrary;component/Imagenes/Lupa.png" Stretch="Uniform" Height="35" Width="34" />
        </telerik:RadButton>
    </Grid>
</cl:ctlIdentificacionPersona>

into my main project I declared UserControl like this:

<Grid>
<cl:ctlIdentificacionPersona x:Name="ctrDatosPersona" Tag="TABLA_PRINCIPAL" Height="Auto" Margin="1,3.02,5,1.73" Width="Auto">
<cl:ctlIdentificacionPersona.ValorTipoDocumento>
   <Binding ElementName="grdGridConsulta" Path="SelectedItem.CA003" Mode="TwoWay" UpdateSourceTrigger="Explicit" Converter="{StaticResource ConvertidorGeneralValores}">
      <Binding.ValidationRules>
        <cl:ReglaDatoRequerido MensajeError="{lr:RecursoIdioma IDRecurso=msjErrorDatoRequeridoTipoDocumento, TipoRecursoIdioma=PADRE}" ValidationStep="ConvertedProposedValue"/>
      </Binding.ValidationRules>
   </Binding>                                      
</
cl:ctlIdentificacionPersona.ValorTipoDocumento>
<cl:ctlIdentificacionPersona.ValorNumeroDocumento>
   <Binding ElementName="grdGridConsulta" Path="SelectedItem.CA004" Mode="TwoWay" UpdateSourceTrigger="Explicit" Converter="{StaticResource ConvertidorGeneralValores}">
     <Binding.ValidationRules>
        <cl:ReglaDatoRequerido MensajeError="{lr:RecursoIdioma IDRecurso=msjErrorDatoRequeridoNumeroDocumento, TipoRecursoIdioma=PADRE}" ValidationStep="ConvertedProposedValue"/>
     </Binding.ValidationRules>
   </Binding>
</cl:ctlIdentificacionPersona.ValorNumeroDocumento>
</cl:ctlIdentificacionPersona>
</Grid>

I declared 2 dependency properties into My UserControl named ValorTipoDocumento and ValorNumeroDocumento in this way:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
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.ComponentModel;
using System.Configuration;
 
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.MaskedTextBox;
 
using Kernel.Recursos;
using App_EntityLibrary;
using App_EntityLibrary.Tablas;
using System.Event;
 
namespace App_ControlLibrary
{
    public class ctlIdentificacionPersona : UserControl
    {
        #region Variables
 
        private RadComboBox cbxTipoDocumento;
        private RadMaskedTextBox fmtNumeroDocumento;
        private RadButton btnBuscar;
 
        ....
          
        public static readonly DependencyProperty ValorNumeroDocumentoProperty = DependencyProperty.Register("ValorNumeroDocumento", typeof(object), typeof(ctlIdentificacionPersona), new FrameworkPropertyMetadata(new PropertyChangedCallback(ValorNumeroDocumentoPropertyChanged)));
 
        [Description("Valor contenido en el Número de Documento")]
        public object ValorNumeroDocumento
        {
            get { return GetValue(ValorNumeroDocumentoProperty); }
            set { SetValue(ValorNumeroDocumentoProperty, value); }
        }
 
        public static readonly DependencyProperty ValorTipoDocumentoProperty = DependencyProperty.Register("ValorTipoDocumento", typeof(object), typeof(ctlIdentificacionPersona), new FrameworkPropertyMetadata(new PropertyChangedCallback(ValorTipoDocumentoPropertyChanged)));
 
        [Description("Valor Seleccionado en la lista")]
        public object ValorTipoDocumento
        {
            get { return GetValue(ValorTipoDocumentoProperty); }
            set { SetValue(ValorTipoDocumentoProperty, value); }
        }
 
        ...
 
        public ctlIdentificacionPersona()
        {
            InitComponents();
            cbxTipoDocumento = (RadComboBox)this.FindName("cbxTipoDocumento");
            fmtNumeroDocumento = (RadMaskedTextBox)this.FindName("fmtNumeroDocumento");
            btnBuscar = (RadButton)this.FindName("btnBuscar");
        }
 
 
 
         private static void ValorNumeroDocumentoPropertyChanged(DependencyObject source, DependencyPropertyChangedEventArgs e)
        {
            (source as ctlIdentificacionPersona).ActualizarValorNumeroDocumento(e.NewValue);
        }
 
private void ActualizarValorNumeroDocumento(object value)
        {
            fmtNumeroDocumento.Value = value;
        }
 
        private static void ValorTipoDocumentoPropertyChanged(DependencyObject source, DependencyPropertyChangedEventArgs e)
        {
            (source as ctlIdentificacionPersona).ActualizarValorTipoDocumento(e.NewValue);
        }
 
private void ActualizarValorTipoDocumento(object value)
        {
            cbxTipoDocumento.SelectedValue = value;
        }
 
...
}

I hope so far It could have be understood!! I try to make clear at the most.

I bounded my UserControl to the radGridView by using the two properties I created to refelct changes in both way. 

Note: <Binding ElementName="grdGridConsulta" Path="SelectedItem.CA003" Mode="TwoWay" AND
<Binding ElementName="grdGridConsulta" Path="SelectedItem.CA004" Mode="TwoWay"

When I navigate into RadGridView (I mean, selectedItemChanged is fired), UserControl reflects the changes in right way (I mean radComboBox and radMaskedTextBox). PROBLEMS begin when I select other item into radComboBox and I change text into radMaskedTextBox, and I try to update source data in RadGridView, by using:

ctrDatosPersona.GetBindingExpression(ctlIdentificacionPersona.ValorTipoDocumentoProperty).UpdateSource();
ctrDatosPersona.GetBindingExpression(ctlIdentificacionPersona.ValorNumeroDocumentoProperty).UpdateSource();

Data are null. RadGridView shows empty data into corresponding cells. I try to do a trace and ctrDatosPersona doesn't return selected values and text changed, in fact, returns  {} for ValorTipoDocumento and nothing for ValorNumeroDocumento. The way I realized about this was by tracing ValidationRules values.

I don't know how to do to radGridView reflects changes from my UserControl.

It's urgent, any helps I appreciate



ENTERPRISE INTERNATIONAL SAS
Top achievements
Rank 1
 answered on 06 Nov 2010
2 answers
183 views
Hi!

I have a details panel that show item selected from radgridview. Main DataContext = DataTable.DefaultView named VistaDatos. GridView is like this:

<telerik:RadGridView x:Name="grdGridConsulta" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding VistaDatos}" Margin="21,15.675,18,23" ShowGroupPanel="False"
                     HorizontalAlignment="Stretch" VerticalAlignment="Stretch" AutoGenerateColumns="False" ColumnWidth="Auto" IsReadOnly="True"
                     Style="{StaticResource Estilo1GridView}"
                     SelectionChanged="grdGridConsulta_SelectionChanged">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Header="{x:Static resx:resxUsuarios.lblID}" DataMemberBinding="{Binding CA001, Mode=TwoWay}" UniqueName="CA001" HeaderCellStyle="{StaticResource GridViewHeaderCellStyle1}" HeaderTextAlignment="Center"/>
        <telerik:GridViewDataColumn Header="{x:Static resx:resxUsuarios.lblNivel}" DataMemberBinding="{Binding CA006, Mode=TwoWay}" UniqueName="CA006" HeaderCellStyle="{StaticResource GridViewHeaderCellStyle1}" HeaderTextAlignment="Center"/>
        <telerik:GridViewDataColumn Header="{x:Static resx:resxUsuarios.lblNivelDescrip}" DataMemberBinding="{Binding CA006_DESCRIPCION, Mode=TwoWay}" UniqueName="CA006_DESCRIPCION" HeaderCellStyle="{StaticResource GridViewHeaderCellStyle1}" HeaderTextAlignment="Center"/>                            </telerik:RadGridView.Columns>
</telerik:RadGridView>

In details panel I have some controls, most important this:

<TextBlock x:Name="lblNivel" Text="{x:Static resx:resxUsuarios.lblNivel}" Style="{StaticResource Estilo1Etiqueta}" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="20,119.953,0,0" Padding="3,5,0,5" Height="27" Width="109"/>
<telerik:RadComboBox x:Name="cbxNivel" Tag="TABLA_PRINCIPAL" SelectedValuePath="CA001" DisplayMemberPath="CA003" ItemsSource="{cl:ColeccionItems IdOrigenDatos={x:Static sp:Publicos.CN_SIS_ESTADOS}, TipoAcceso=StoredProcedure, Parametros={StaticResource ParametrosSpNivelesUsuario}}" EmptyText="{x:Static kernel:resxMensajes.msjSeleccione}" Validation.ErrorTemplate="{StaticResource PlantillaErrores}" IsSynchronizedWithCurrentItem="True" IsEditable="False" TabIndex="3" HorizontalAlignment="Stretch" Margin="133,119.953,119,0" VerticalAlignment="Top" Height="27">
                                <telerik:RadComboBox.SelectedValue>
                                    <Binding ElementName="grdGridConsulta" Path="SelectedItem.CA006" Mode="TwoWay" UpdateSourceTrigger="Explicit">
                                        <Binding.ValidationRules>
                                            <cl:ReglaDatoRequerido MensajeError="{lr:RecursoIdioma IDRecurso=msjErrorDatoRequerido, Parametro={Binding Text, ElementName=lblNivel}, TipoRecursoIdioma=GLOBAL}"/>
                                        </Binding.ValidationRules>
                                    </Binding>
                                </telerik:RadComboBox.SelectedValue>
</telerik:RadComboBox>

ItemsSource code is CA001, ItemsSource Description si CA003 in radComboBox,  When I Update source radgridView, binding works fine, but I don´t know how to do to udpate description or text from radComboBox to this gridViewDataColum: 

<telerik:GridViewDataColumn Header="{x:Static resx:resxUsuarios.lblNivelDescrip}" DataMemberBinding="{Binding CA006_DESCRIPCION, Mode=TwoWay}" UniqueName="CA006_DESCRIPCION" HeaderCellStyle="{StaticResource GridViewHeaderCellStyle1}" HeaderTextAlignment="Center"/>

I tried something like this:

<telerik:RadComboBox x:Name="cbxNivel" Tag="TABLA_PRINCIPAL" SelectedValuePath="CA001" DisplayMemberPath="CA003" ItemsSource="{cl:ColeccionItems IdOrigenDatos={x:Static sp:Publicos.CN_SIS_ESTADOS}, TipoAcceso=StoredProcedure, Parametros={StaticResource ParametrosSpNivelesUsuario}}" EmptyText="{x:Static kernel:resxMensajes.msjSeleccione}" Validation.ErrorTemplate="{StaticResource PlantillaErrores}" IsSynchronizedWithCurrentItem="True" IsEditable="False" TabIndex="3" HorizontalAlignment="Stretch" Margin="133,119.953,119,0" VerticalAlignment="Top" Height="27">
    <telerik:RadComboBox.SelectedValue>
        <Binding ElementName="grdGridConsulta" Path="SelectedItem.CA006" Mode="TwoWay" UpdateSourceTrigger="Explicit">
            <Binding.ValidationRules>
                <cl:ReglaDatoRequerido MensajeError="{lr:RecursoIdioma IDRecurso=msjErrorDatoRequerido, Parametro={Binding Text, ElementName=lblNivel}, TipoRecursoIdioma=GLOBAL}"/>
            </Binding.ValidationRules>
        </Binding>
    </telerik:RadComboBox.SelectedValue>
    <telerik:RadComboBox.Text>
        <Binding ElementName="grdGridConsulta" Path="SelectedItem.CA006_DESCRIPCION" Mode="TwoWay" UpdateSourceTrigger="Explicit"/>
    </telerik:RadComboBox.Text>
</telerik:RadComboBox>

but it doesn´t work.

Can you help me about this???

thanks
ENTERPRISE INTERNATIONAL SAS
Top achievements
Rank 1
 answered on 06 Nov 2010
2 answers
109 views
Hi,
I am adding 2  DataSeries into DefaultView.ChartArea, but only one of them shown in a time.
How I can show, data series together in a time in one rad chart ?
ConfigureMonthlySales(radchart.DefaultView.ChartArea, lsdata1);
ConfigureMonthlySales(radchart.DefaultView.ChartArea, lsdata2);
.....
.....
 
private void ConfigureMonthlySales(ChartArea chartArea, List<KeyValuePair<string, double>> lsData)
        {
            DataSeries doughnutSeries = new DataSeries();
 
            foreach (KeyValuePair<string, double> data in lsData)
            {
                DataPoint point = new DataPoint();
                point.YValue = data.Value;
                point.LegendLabel = data.Key;
                doughnutSeries.Add(point);
            }
 
            doughnutSeries.Definition = new DoughnutSeriesDefinition();
 
            ((DoughnutSeriesDefinition)doughnutSeries.Definition).LabelSettings.LabelOffset = 0.7d;
            doughnutSeries.Definition.ItemLabelFormat = "#%{p0}";
            doughnutSeries.Definition.ShowItemToolTips = true;
            chartArea.DataSeries.Add(doughnutSeries);
             
            chartArea.SmartLabelsEnabled = false;
        }


Thanks
A Mahdavi
Top achievements
Rank 1
 answered on 06 Nov 2010
10 answers
450 views
Hello Telerik,

I have a few problems with the chart.
Attached NO example. (!! we are unable to attach zip files)

Flickering:
When i set the 'DefaultView.ChartArea.AxisY.AutoRange' to TRUE, the chart flickers,
when set it to FALSE and specify the min/max/step value it does not have this problem,
but .... i would like to use the AutoRange function :)

Horizontal scroll/zoom:
- I cannot get this working, i think when setting the min/max values for the X axis, everything is reset?
  Is there a solution for this behavior?
- When i start the application and press ALT-F4 (to close the application), it works,
  when i first try to scroll/zoom the horizontal bar (or clicking on the slider), i cannot press ALT-F4 again, or any other common keyboard shortcuts.

With kind regards,
Rob

As we are unable to attach ZIP files, here the .cs code for the window (it only has one radchart)

Window.xaml
<Window x:Class="TelerikChart.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerikChart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting" 
    Title="Window1" Height="600" Width="800" 
    Loaded="OnLoaded" 
        > 
    <Grid> 
        <Grid.Resources> 
            <Style x:Key="ItemLabelStyle" TargetType="TextBlock"
                <Setter Property="Foreground" Value="Orange" /> 
            </Style> 
        </Grid.Resources> 
        <telerikChart:RadChart x:Name="RadChart1" /> 
    </Grid> 
</Window> 
 


Window.xaml.cs
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 Telerik.Windows.Controls.Charting; 
using System.Windows.Threading; 
 
namespace TelerikChart 
    /// <summary> 
    /// Interaction logic for Window1.xaml 
    /// </summary> 
    public partial class Window1 : Window 
    { 
        private DateTime nowTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); 
 
        private const int queueCapacity = 3600; 
        private RadHierarchicalObservableCollection<ValueLoadInfo> ChartData = new RadHierarchicalObservableCollection<ValueLoadInfo>(); 
        private Random rnd = new Random(); 
        private DispatcherTimer timer1 = null
 
        public Window1() 
        { 
            InitializeComponent(); 
 
            //Setup Chart 
            RadChart1.DefaultView.ChartTitle.Content = "Legend Title"
            RadChart1.DefaultView.ChartArea.NoDataString = "Waiting for data..."
            RadChart1.DefaultView.ChartArea.EnableAnimations = false
 
            //Setup X-As 
            RadChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "#VAL{HH:mm:ss}"
            RadChart1.DefaultView.ChartArea.AxisX.LabelRotationAngle = 90; 
            RadChart1.DefaultView.ChartArea.AxisX.LabelStep = 2; 
            RadChart1.DefaultView.ChartArea.AxisX.Title = "Time"
            RadChart1.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Normal; 
            RadChart1.DefaultView.ChartArea.AxisX.AutoRange = false
 
            //Setup Y-As 
            RadChart1.DefaultView.ChartArea.AxisY.AutoRange = false
            RadChart1.DefaultView.ChartArea.AxisY.MinValue = 38000; 
            RadChart1.DefaultView.ChartArea.AxisY.MaxValue = 38001; 
            RadChart1.DefaultView.ChartArea.AxisY.Step = 0.100; 
            RadChart1.DefaultView.ChartArea.AxisY.AxisName = "Value"
            RadChart1.DefaultView.ChartArea.AxisY.DefaultLabelFormat = "#VAL{0.000}"
            RadChart1.DefaultView.ChartArea.AxisY.Title = "Value (double)"
 
            //Setup mapping 
            SeriesMapping memoryDataMapping = new SeriesMapping(); 
            memoryDataMapping.LegendLabel = "My Label"
            memoryDataMapping.SeriesDefinition = new LineSeriesDefinition(); 
            (memoryDataMapping.SeriesDefinition as LineSeriesDefinition).ShowPointMarks = false
            (memoryDataMapping.SeriesDefinition as LineSeriesDefinition).ShowItemLabels = false
            memoryDataMapping.SeriesDefinition.AxisName = "Value"
            memoryDataMapping.ItemMappings.Add(new ItemMapping("Time", DataPointMember.XValue)); 
            memoryDataMapping.ItemMappings.Add(new ItemMapping("Value", DataPointMember.YValue)); 
            RadChart1.SeriesMappings.Add(memoryDataMapping); 
 
            //Could not find Resource 'ItemLabelStyle' 
             
            RadChart1.DefaultView.ChartArea.ZoomScrollSettingsX.ScrollMode = ScrollMode.ScrollAndZoom; 
 
            //RadChart1.DefaultView.ChartLegend.Visibility = Visibility.Collapsed;  
         
        } 
 
        private void OnLoaded(object sender, RoutedEventArgs e) 
        { 
            //Start timer 
            timer1 = new DispatcherTimer(); 
            timer1.Interval = TimeSpan.FromMilliseconds(300); 
            timer1.Tick += timer1_Tick; 
            timer1.Start(); 
        } 
 
        private void SetUpAxisXRange(DateTime now) 
        { 
            if (this.ChartData.Count() > 0) 
            { 
                RadChart1.DefaultView.ChartArea.AxisX.MinValue = ChartData[0].Time.ToOADate(); 
                RadChart1.DefaultView.ChartArea.AxisX.MaxValue = now.ToOADate(); 
 
                double Range = RadChart1.DefaultView.ChartArea.AxisX.MaxValue - RadChart1.DefaultView.ChartArea.AxisX.MinValue; 
                RadChart1.DefaultView.ChartArea.AxisX.Step = Range / 10.0; 
            } 
        } 
 
        private void timer1_Tick(object sender, EventArgs e) 
        { 
            if (this.ChartData.Count >= queueCapacity) 
                this.ChartData.RemoveAt(0); 
 
            this.nowTime = this.nowTime.AddMilliseconds(300); 
 
            ValueLoadInfo systemInfo = new ValueLoadInfo(); 
 
            systemInfo.Value = 38000 + (rnd.NextDouble()%1000); 
            systemInfo.Time = this.nowTime; 
            this.ChartData.Add(systemInfo); 
 
            this.SetUpAxisXRange(this.nowTime); 
 
            if (RadChart1.ItemsSource == null
                RadChart1.ItemsSource = this.ChartData; 
        } 
    } 
    public class ValueLoadInfo 
    { 
        private DateTime _time; 
        private double _Value; 
        public DateTime Time 
        { 
            get { return this._time; } 
            set { this._time = value; } 
        } 
        public double Value 
        { 
            get { return this._Value; } 
            set { this._Value = value; } 
        } 
    } 
 
 

Ves
Telerik team
 answered on 05 Nov 2010
2 answers
112 views
How do I change the celltype/celledittype on autogenerated columns?
I've done the following but it doesn't work.  It assigned the template, but doesn't seem to display the template.

private void fullyLoadedCostListRadGridView_AutoGeneratingColumn(object sender, GridViewAutoGeneratingColumnEventArgs e) {
    e.Column.CellTemplate = (DataTemplate)FindResource("telerikContentColumnTemplate");
}
David Brenchley
Top achievements
Rank 1
 answered on 05 Nov 2010
3 answers
299 views
I am editing a row in a RadGridView (WPF -- form application). I want to use the CellEditEnded event, when they are done editing a particular cell, I want to move the focus back to a textbox on the form. When the user hits Tab the CellEditEnded event fires and that seems to be the even to use.

I can trap for the column and when I call txtProductCode.Focus(); nothing happens. When I hit tab again the next cell in the same grid row has focus. So it is behaves like it needs to 'leave' the grid first.

Any thoughts?

private void gvCount_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
{
    //if edit editing on Quantity cell, then position focus to product code -- edit end typically comes from when tab key is clicked
    if (e.Cell.Column.UniqueName == "Quantity")
    {
        txtProductCode.Focus();
    }
}
Maya
Telerik team
 answered on 05 Nov 2010
6 answers
238 views
Hello,

We are binding a RadGridView to a property (Observable Collection of Entities) in an MVVM scenario. Within this grid we have a GridViewCheckBoxColumn that has a DataMemberBinding to a string property within our entities. Since the string is always "0" or "1" we use a ValueConverter to convert to Boolean - True/False in order to tick the checkbox. We found that the converter always calls the "Convert" method instead of the "ConvertBack" upon setting the value....

For test purposes we were binding a standard GridViewDataColumn to the same converter to ensure it is working properly which it does....

Example:
    <Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition Height="0.913*"/>  
        </Grid.RowDefinitions> 
        <Expander Grid.Row="1" 
            Header="Berthing Slots" 
            IsExpanded="True" 
            VerticalAlignment="Top" Margin="0,4.988,0,0">  
            <telerik:RadGridView x:Name="radBerthingSlots" 
                AutoGenerateColumns="False" 
                IsEnabled="True" 
                ItemsSource="{Binding BerthingSlots}" 
                SelectedItem="{Binding SelectedBerthingSlot, Mode=TwoWay}"   
                AddingNewDataItem="radBerthingSlots_AddingNewDataItem"   
                RowEditEnded="radBerthingSlots_RowEditEnded" Deleting="radBerthingSlots_Deleting">  
                  
                <telerik:RadGridView.Columns> 
                    <telerik:GridViewCheckBoxColumn Header="Available" DataMemberBinding="{Binding Path=HtDiff, Converter={StaticResource HtDiffNumberConverter}, Mode=TwoWay}" /> 
                    <telerik:GridViewDataColumn Header="HT Diff" DataMemberBinding="{Binding Path=HtDiff, Converter={StaticResource HtDiffNumberConverter}, Mode=TwoWay}" /> 
                </telerik:RadGridView.Columns> 
            </telerik:RadGridView> 
    </Grid> 
 

Now, when we change the value in the GridViewDataColumn the "ConvertBack" method is correctly (as expected) invoked....

When we do the same (ticking / unticking the checkbox on the GridViewCheckBoxColumn) it always calls the "Convert" method.....

Clearly that can't be right.... can you guys please help!

Many Thanks in advance.....

Regards

M.
Marco Barzaghi
Top achievements
Rank 1
 answered on 05 Nov 2010
3 answers
110 views
This works (default Microsoft toolbar):

        <ToolBar ItemsSource="{Binding Path=Actions}"></ToolBar>

This does not:

        <telerik:RadToolBar ItemsSource="{Binding Path=Actions}"></telerik:RadToolBar>

What i get is number of items x 2 when the toolbar is shown.

I notice that there are multiple questions revolving around this issue, but they are old. Is this still a problem in Telerik WPF controls, or am I missing something?
Viktor Tsvetkov
Telerik team
 answered on 05 Nov 2010
2 answers
151 views
I'm trying to force the row details presenter of my grid to be the full width of its parent row. This has actually has two parts to it. All my grids seem to have a column at the far left of the grid that I can't seem to remove. After that the grid in my row details seems to only take up as much room as it needs, it never expands to the space available. Its a bit difficult to explain so I've attached a screen shot of my problem. Hopefully someone can point me in the right direction!

Thanks
Rossen Hristov
Telerik team
 answered on 05 Nov 2010
1 answer
178 views
How do you set the DatePicker to show a blank / null date.

I have an intial value for datepicker but then I need to set the DatePicker to blank/null

I can set SelectedDate = null - but the display date stays the same

this

 

.calPaydate.SelectedDate = null;
this.calPayDate.displaydate =   ?????

thx

 

Kaloyan
Telerik team
 answered on 05 Nov 2010
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?