hiding radDatePicker in edit mode

Posted by Community Admin on 03-Aug-2018 13:14

hiding radDatePicker in edit mode

All Replies

Posted by Community Admin on 12-Oct-2011 00:00

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

 

 

 

 

 

Posted by Community Admin on 17-Oct-2011 00:00

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

This thread is closed