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

RadTimePicker- Hide on server side and show/hide on client side

3 Answers 110 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Joshy Varghese
Top achievements
Rank 1
Joshy Varghese asked on 29 Jul 2011, 09:00 PM
Hi
I'm using a RadTimePicker in an edit form of the grid. I just want to hide the control from server side and show/hide the control from client side.
client side show/ hide is working with following code.

function checkboxClick(chkBox, timePicker) {
 var chkBox1 = document.getElementById(chkBox);
 var timePicker1= $find(timePicker);
 if (chkBox1 .checked) {
  timePicker1.set_visible(true);
 }
 else {
  timePicker1.set_visible(false);
 }
}

I can hide the RadTimePicker from server side usnig the following code but I can't show/hide the control from above javascript code.
timePicker.Style.Add("visibility", "hidden");

Please help!!

Thanks!

 

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 01 Aug 2011, 05:39 AM
Hello Joshy,

Try the following code snippet to hide RadTimePicker from server side in ItemDataBound event.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
  if (e.Item is GridEditableItem && e.Item.IsInEditMode)
  {
      GridEditableItem item = (GridEditableItem)e.Item;
      RadTimePicker pkr = (RadTimePicker)item.FindControl("timePicker1");
      pkr.Visible = false;
  }
}

Thanks,
Princy.
0
Joshy Varghese
Top achievements
Rank 1
answered on 01 Aug 2011, 03:53 PM
Hi Princy,
I know we can hide the control on server side with your code. I want to hide the control from server side and show/hide from client side(javascript) as well.
I need help on this scenario.

Thanks!
0
Maria Ilieva
Telerik team
answered on 02 Aug 2011, 01:49 PM
Hi Joshy,

Unfortunately the required functionality is not supported out of the box. It is not possible to hide the control on the server using visible="false" and show it on the client. Possible approach in this case is to set display:none on the server and display:block on the client to show the control.


Regards,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Calendar
Asked by
Joshy Varghese
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Joshy Varghese
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or