More in this section
Forums / General Discussions / hiding radDatePicker in edit mode

hiding radDatePicker in edit mode

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Aret
    Aret avatar
    8 posts
    Registered:
    10 Oct 2011
    12 Oct 2011
    Link to this post

    I want to programmatically hide my raddatepicker when in edit mode.  This is what I have so far and I think I am close, but I get an error.  Any suggestions....?

     

     

    Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles RadGrid1.ItemCommand

     

     

     

     

     

    If e.CommandName = "Edit" Then

     

     


    For
    Each item As GridDataItem In RadGrid1.MasterTableView.Items

     

     

     

     

    Dim txtBox As RadDatePicker = DirectCast(item("Metricmonth").FindControl("txtEdit2"), RadDatePicker)

     

    txtBox.Visible =

    False

     

     

     

     

     

     

    Next

     

     End If

     

     

     

     

     

  2. Iana Tsolova
    Iana Tsolova avatar
    3 posts
    Registered:
    01 Apr 2016
    17 Oct 2011
    Link to this post
    Hi Aret,

    When the edit command is fired the edit form is not created yet, so it is too early to look for its controls there. You would better handle the ItemCreated or ItemDataBound event for that purpose. Check the below article:
    http://www.telerik.com/help/aspnet-ajax/grid-distinguish-edit-insert-mode-on-itemcreated-itemdatabound.html

    Regards,
    Iana Tsolova
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
2 posts, 0 answered