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

Making Rad child PanelItem visible from client side.

3 Answers 108 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Anagha Kulkarni
Top achievements
Rank 1
Anagha Kulkarni asked on 23 Apr 2010, 04:40 PM

Following is one of the radpanelitems on a panelbar. It has a button on this button’s click (client Side) I want to make  radpanel CheckingAddbucAdd visible. How do I do this?

 

<telerik:RadPanelItem value="CheckingAdd" runat="server" Text="" Expanded="true" style="display:none;">

                                                <Items>

                                                      <telerik:RadPanelItem value="CheckingAddbtn" runat="server" Text="" Expanded="true">

                                                            <ItemTemplate>

                                                                  <br />

                                                                  <asp:ImageButton ID="btnAddAccountChecking" runat="server"  />

                                                            </ItemTemplate> 

                                                      </telerik:RadPanelItem>

                                                      <telerik:RadPanelItem value="CheckingAddbucAdd" Text="AddCheckingAccount" runat="server"   Visible="false">

                                                            <ItemTemplate>

                                                                  <UC1:CheckingAcct ID="CheckingAcct1" runat="server"   AcctID="0" />

                                                            </ItemTemplate> 

                                                      </telerik:RadPanelItem>

                                                </Items>

                                          </telerik:RadPanelItem>

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 26 Apr 2010, 09:24 AM
Hello Anagha,

You could get reference to corresponding panelItem and set the visibility using set_visible() method which accepts Boolean value.

JavaScript:
 
function setVisibility() 
{   
   var panelBar = $find("<%= RadPanelBar1.ClientID %>"); 
   var item = panelBar.findItemByValue("CheckingAddbucAdd"); 
   item.set_visible(false);     

Regards,
Princy.
0
A K
Top achievements
Rank 1
answered on 26 Apr 2010, 01:09 PM
I am trying to do opposite, design time it's vibible ="false". And At run time on button click I want to set it's visibility="true". If visible is false at design time. it it not rendered and on client side since it doesn't find that panelItem I get object null error.
0
T. Tsonev
Telerik team
answered on 27 Apr 2010, 10:56 AM
Hello,

As you've noticed, the item is not rendered at all when you set Visible to "false" and as a consequence it can't be shown on the client - it doesn't exist there. You can create it entirely on the client-side, please see this example:

http://demos.telerik.com/aspnet-ajax/panelbar/examples/clientside/clientsideapi/defaultcs.aspx

I hope this helps.

Greetings,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
PanelBar
Asked by
Anagha Kulkarni
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
A K
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or