This is a migrated thread and some comments may be shown as answers.

AutoEdit not working

3 Answers 76 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
David Ocasio
Top achievements
Rank 2
Veteran
David Ocasio asked on 17 Mar 2011, 11:49 AM

AutoEdit does not seem to be working for me

<telerik:RadWindow 
    x:Class="agControls.DateRangeSelector" 
    xmlns:dataFormToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
  
   xmlns:local="clr-namespace:agControls"
  
    Header="Report Range"
      
    mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400">
      
    <telerik:RadWindow.Resources>
        <local:DataRangeSelectorInput x:Key="DesignData" />
    </telerik:RadWindow.Resources>
  
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition />
        </Grid.RowDefinitions>
  
        <telerik:RadDataForm CommitButtonContent="Report"   x:Name="dfRangeSelector" CommandButtonsVisibility="Commit,Edit" CurrentItem="{StaticResource DesignData}" AutoEdit="True" >
        </telerik:RadDataForm>
          
    </Grid>

Imports System.Windows.Data
Imports Telerik.Windows.Controls
Imports System.ComponentModel
Imports System.ComponentModel.DataAnnotations
Imports System.Collections.ObjectModel
Imports agClassLibrary
Imports System.Linq
Imports System.Runtime.CompilerServices
  
Public Class DataRangeSelectorInput
    Inherits agDataClassBase
  
    <Display(Name:="Start Date", Description:="Report Starting Date", Prompt:="Start Date")> _
    Public Property StartDate() As Nullable(Of Date)
        Get
            Return _StartDate
        End Get
        Set(ByVal value As Nullable(Of Date))
            _StartDate = value
            FirePropertyChanged("StartDate")
        End Set
    End Property
    Protected _StartDate As Nullable(Of Date) = Nothing
  
    <Display(Name:="End Date", Description:="EndDate")> _
    Public Property EndDate() As Nullable(Of Date)
        Get
            Return _EndDate
        End Get
        Set(ByVal value As Nullable(Of Date))
            _EndDate = value
            FirePropertyChanged("EndDate")
        End Set
    End Property
    Protected _EndDate As Nullable(Of Date) = Nothing
  
End Class

thanks
dco

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 22 Mar 2011, 02:25 PM
Hello David ,

Can you share a bit more details , what exactly is the expected behavior of such setup ?  And what is going wrong  ?

Kind regards,
Pavel Pavlov
the Telerik team
0
David Ocasio
Top achievements
Rank 2
Veteran
answered on 22 Mar 2011, 03:25 PM
what i expect to happen is that when autoedit is set to true
the dataform is set to edit mode as soon as a current item is available

i had hacked this by using a "beginedit" to force the dataform into edit mode

heres the stange thing ... i removed the beginedit and it is working now as i expected
it to

i  just did remove all of my old telerik installations because of strange behavior i was having 
so i guess
that is why it was acting strange or possibly i was asleep at the wheel

bottom line ... it is working ... sorry for bothering you pavel 

on another note (related)
if autoedit is set to true the edit button does not show
is there anyway to change that ... i like the button to show to indicate to the people they are expected to input something.
i do have a workaround (autoedit=false .... beginedit when current item is changed)
so no big deal if not

thanks pavel
dco
0
Accepted
Pavel Pavlov
Telerik team
answered on 25 Mar 2011, 10:39 AM
Hello David Ocasio,

Good to hear it works. Actually I believe I know what has happened - indeed we had such issue with the beta version and after some feedback form clients , we have fixed it.

Regarding your second question  - the default behavior would be to hide the edit button when AutoEdit is set to true. Your solution is good  ( calling BeginEdit) . An alternative would be to tamper with the template of RadDataForm and remove the visibility binding from the edit button.

All the best,
Pavel Pavlov
the Telerik team
Tags
DataForm
Asked by
David Ocasio
Top achievements
Rank 2
Veteran
Answers by
Pavel Pavlov
Telerik team
David Ocasio
Top achievements
Rank 2
Veteran
Share this question
or