Telerik Forums
UI for WPF Forum
1 answer
131 views
Hi,

I have a problem since I upgrated from version 2010.3.1314.35 to 2011.2.712.40.
In my scenario I have a "special" TimeRulerItemTemplateSelector which displays a progressbar (status for each day).
With version 2010.3.1314.35 the value-binding (Value="{Binding DateTime, Converter={StaticResource GetDateValue}}") works fine, version 2011.2.712.40 fired the following error:

TwoWay- oder OneWayToSource-Bindungen funktionieren nicht mit der schreibgeschützten Eigenschaft "DateTime" vom Typ "Telerik.Windows.Controls.ScheduleView.TimerRulerItemProxy".

my sources:

            <telerik:TimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>
                <DataTemplate>
                    <Grid Height="60">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="20"/>
                            <RowDefinition Height="20"/>
                            <RowDefinition Height="20"/>
                        </Grid.RowDefinitions>
                        <TextBlock Grid.Row="0" Text="{Binding DateTime, Converter={StaticResource GetWeekDay}}"/>
                        <TextBlock Grid.Row="1" Text="{Binding DateTime, Converter={StaticResource GetDateShort}}"/>
                        <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="2,0,0,0">
                            <ProgressBar Width="40" Minimum="0" Maximum="100" Value="{Binding DateTime, Converter={StaticResource GetDateValue}}"/>
                            <TextBlock Text="{Binding DateTime, Converter={StaticResource GetDateValue}}"/>
                            <TextBlock Text="%"/>
                        </StackPanel>
                    </Grid>
                </DataTemplate>
            </telerik:TimeRulerItemTemplateSelector.HorizontalTimelineGroupTemplate>

and the GetDateValue Function:

Public Class GetDateValue
    Implements IValueConverter

    Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert
        If TypeOf value Is DateTime Then
            Dim dt As DateTime = DirectCast(value, DateTime)
            value = 50   'only for demo...
        End If
        Return value

    End Function

    Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack
        Throw New NotImplementedException()
    End Function

End Class

with best regards,
Stefan
Dani
Telerik team
 answered on 12 Sep 2011
1 answer
165 views
Hi Telerik,

I'm using  a RadCombobox in my application and i like to know how i can select item in code behind?
My RadCombobox is bounded thats so:
foreach (ClienteBE _cliente in this.lstCliente)
            {
                tam = _cliente.Nome.Length > tam ?
                    _cliente.Nome.Length :
                    tam;
 
                this.cmbCliente.DisplayMemberPath = "Nome";
                this.cmbCliente.Items.Add(_cliente);
            }

this.lstCliente is a list of objects.

Thanks.
Yana
Telerik team
 answered on 12 Sep 2011
0 answers
299 views

Hi,

I am working with RadGridView, in MVVM WPF application and I need to validate cell compared to other values in binding collection.

I have a object :


public class MyObject
{
    public DateTime DateBegin { get; set;}
    public int Value { get; set;}
}

And if I add a new row in my GridView with existing Date I want to show error message in cell.

I thought to use an ValidationRules in my cell, but i am not sure if i can compared to with others values in binding list. I found some solution, but isn't MVVM compliant :

public void RadGridView1_CellValidating(object sender, GridViewCellValidatingEventArgs e)       {
            bool isValid = true;
            string validationText = "Validation failed. ";
            if(cell.column.uniquename == "mydatecolumn")
           {
            GridViewCell cell = e.Cell;
                    isValid = ValidateDate((datetime) e.NewValue);
                    if (!isValid)
                    {
                        validationText += "You already used that date, mate.";
                    }
           }
}
  
private static bool ValidateDate(datetime newDate)
        {
            // Some linq to see if it's in your collection or not
        }

Thanks

rad
Top achievements
Rank 1
 asked on 12 Sep 2011
2 answers
163 views
Hi,

I need to control the "edit mode" state of the insert row. Let say i have 2 Classes A and B with a "1xN link type" between A and B.
I have in the same screen 2 grids. 1 for type A et 1 for type B. When I add a A in grid 1 I want to be abble of adding Bs in grid2 whitout loosing the "edit mode" of grid 1 insert row.

How coul I do that with the code behind ?


Infologic
Top achievements
Rank 1
 answered on 12 Sep 2011
5 answers
142 views
Hi,

I am binding the IsChecked property to a property in my ViewModel with the help of ItemContainerStyle.
When I click on the checkbox of a child "Item 2", I get the following result:

- Group A
   Item 1
x Item 2

So Group A is marked as indeterminate correctly.

When I set Item2.IsChecked  = true in my ViewModel, Item2 is marked as checked, but GroupA is marked as unchecked.

Am I doing something wrong? If not, is there a workaround for this?

Best Regards, Matthias
Petar Mladenov
Telerik team
 answered on 12 Sep 2011
0 answers
71 views
Hello,
Their if any event in raddatafilter which get fired on each time user filter the records.

I trying to implement a filter in which work like this:
If user select containg string "abc" then i want to show all record those contains "abc" as well as "cde". But i don't want to show user both option "abc" and "cde" because in my case meaning of "abc" and "cde" is same.

There is any other way to do this?

Thanks in advance.
Zaheer
Top achievements
Rank 1
 asked on 12 Sep 2011
1 answer
304 views

Hi All,

I have a datagrid with one of datacolumn contains a combobox.

DataGrid contains a RowDetails template attached to it.

When i add a row into datagrid on click of button or delete a row from datagrid, selection change event of combobox gets called.

RowDetails template also contains a combobox with a selection change event.

When i am trying to click somewhere inside the rowdetailstemplate or trying to use a template scroll bar, combobox selection change event is getting fired.

Please provide the solution how we can avoid selection change event of combobox in above cases.

Please find below piece of code:

 

 

<telerik:RadGridView ItemsSource="{Binding Path=Customers}"

 

 

IsReadOnly="{Binding IsChecked, Mode=TwoWay, ElementName=IsReadOnlyCheckBox}" RowDetailsVisibilityMode="{Binding RowDetailsTemplateVisibilityMode, Mode=TwoWay}"

 

 

SelectionMode="Multiple" AutoGenerateColumns="False" VerticalAlignment="Stretch"

 

 

ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Visible" MinHeight="100" MaxHeight="350">

 

 

 

<telerik:RadGridView.Columns>

 

 

 

<telerik:GridViewToggleRowDetailsColumn Width="30"/>

 

 

 

<telerik:GridViewSelectColumn Width="30"/>

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding SlNo}" Header="S.no" IsReadOnly="True" IsEnabled="False" Width="20" />

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Product}" Header="Product" IsReadOnly="True" IsEnabled="False" Width="250"/>

 

 

 

<telerik:GridViewDataColumn Header="Customer" Width="Auto">

 

 

 

<telerik:GridViewDataColumn.CellTemplate>

 

 

 

<DataTemplate>

 

 

 

<ComboBox ItemsSource="{Binding Path=Customer}" HorizontalAlignment="Left" DisplayMemberPath="RunDesc" SelectedItem="{Binding RunsSelected}" IsEnabled="{Binding IsEnabledRun}" Style="{StaticResource SmallComboBox}">

 

 

 

<i:Interaction.Triggers>

 

 

 

<i:EventTrigger EventName="SelectionChanged">

 

 

 

<cmd:EventToCommand Command="{Binding Path=LoadCustomersCommand}" PassEventArgsToCommand="False" CommandParameter="{Binding Path=DataContext,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ComboBox}}"/>

 

 

 

</i:EventTrigger>

 

 

 

</i:Interaction.Triggers>

 

 

 

</ComboBox>

 

 

 

</DataTemplate>

 

 

 

</telerik:GridViewDataColumn.CellTemplate>

 

 

 

</telerik:GridViewDataColumn>

 

 

 

</telerik:RadGridView.Columns>

 

 

 

<telerik:RadGridView.RowDetailsTemplate >

 

 

 

<DataTemplate>

 

 

 

<Grid Background="{StaticResource MainBackgroundColor}" >

 

 

 

<ComboBox ItemsSource="{Binding Path=Customer}" HorizontalAlignment="Left" DisplayMemberPath="RunDesc" SelectedItem="{Binding RunsSelected}" IsEnabled="{Binding IsEnabledRun}" Style="{StaticResource SmallComboBox}">

 

 

 

<i:Interaction.Triggers>

 

 

 

<i:EventTrigger EventName="SelectionChanged">

 

 

 

<cmd:EventToCommand Command="{Binding Path=LoadCustomersCommand}" PassEventArgsToCommand="False" CommandParameter="{Binding Path=DataContext,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ComboBox}}"/>

 

 

 

</i:EventTrigger>

 

 

 

</i:Interaction.Triggers>

 

 

 

</ComboBox>

 

 

 

</Grid>

 

 

 

</DataTemplate>

 

 

 

</telerik:RadGridView.RowDetailsTemplate>

 

 

 

</telerik:RadGridView>

Maya
Telerik team
 answered on 12 Sep 2011
1 answer
116 views

Hello

I need to replace the insert input key in the grid to execute my command.

How can I do this?

Best regards

Ehud

  

Maya
Telerik team
 answered on 12 Sep 2011
1 answer
112 views
I have version 2011.1.419.35 and it seems sorting and filtering does not work when my ItemsSource is a List<dynamic> Is this expected? Is there a workaround or a plan to support this?

Thanks,
LauraH
Vlad
Telerik team
 answered on 12 Sep 2011
0 answers
129 views
hi all
I have multiple pane in a rad group. in one of then i have enabled drag and drop functionality. i have also set
 RadDragAndDropManager.EnableNativeDrag = true;
now in another pane i have a numericupdown. if i select the text in it and try to drag it, it is drag able and it gives the following error.

   at Telerik.Windows.Controls.DragDrop.DesktopDragDropProvider.OnElementDragLeave(Object sender, DragEventArgs e) in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Core\Controls\DragDrop\DragProviders\DesktopDragDropProvider.cs:line 704
   at System.Windows.DragEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.OleDropTarget.RaiseDragEvent(RoutedEvent dragEvent, Int32 dragDropKeyStates, Int32& effects, DependencyObject target, Point targetPoint)
   at System.Windows.OleDropTarget.MS.Win32.UnsafeNativeMethods.IOleDropTarget.OleDragOver(Int32 dragDropKeyStates, Int64 point, Int32& effects)

Thanks
Deepak
deepak
Top achievements
Rank 1
 asked on 12 Sep 2011
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?