AutoEdit not working

4 posts, 1 answers
  1. David Ocasio
    David Ocasio avatar
    147 posts
    Member since:
    Nov 2009

    Posted 17 Mar 2011 Link to this post

    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
  2. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 22 Mar 2011 Link to this post

    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
  3. DevCraft banner
  4. David Ocasio
    David Ocasio avatar
    147 posts
    Member since:
    Nov 2009

    Posted 22 Mar 2011 Link to this post

    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
  5. Answer
    Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 25 Mar 2011 Link to this post

    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
Back to Top