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

[Solved] Object Visibilty

7 Answers 167 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
John S.
Top achievements
Rank 1
John S. asked on 27 Apr 2007, 07:29 PM
I have an asp panel that contains 3 grids. Only one grid is visible at a time. I currently use a Non-Prometheus RadAjax manager which updates itself allowing me to hide or unhide them.

In "Current RadAjax Limitations" it says I "Cannot ajaxify container controls." How should now handle this case.

Thanks,
John

7 Answers, 1 is accepted

Sort by
0
Leon
Top achievements
Rank 1
answered on 27 Apr 2007, 08:55 PM
John,

You mean currently your panel is set as AjaxInitiator as well as an updated control, correct? Have you tried linking the Grids instead no matter they are visible or not? Or just set each Grid to update the panel?

Regards,
Leon
0
John S.
Top achievements
Rank 1
answered on 27 Apr 2007, 09:18 PM
Q: You mean currently your panel is set as AjaxInitiator as well as an updated control, correct?

A: Yes

If I set a grid to be updated and it doesn't exist (because it is not visible) I get errors.

Thanks,
John
0
Leon
Top achievements
Rank 1
answered on 28 Apr 2007, 11:24 AM
Good. The current limitation is that you cannot ajaxify the panel itself, but you can set is as updated control. Setting each grid to update the whole panel will make it.
0
John S.
Top achievements
Rank 1
answered on 28 Apr 2007, 03:14 PM
Hello,

That doesn't work either because an error pops up if I use a non-existent control (because of its invisibility) as an AjaxInitiator.

Thanks,
John
0
Kevin
Top achievements
Rank 1
answered on 28 Apr 2007, 05:43 PM
Is it possible that this issue is related to "switchibg control visibility" issue described here

http://www.telerik.com/help/aspnet/ajax/ajaxToggleControlVisibility.html

Will placing the grid inside asp:panels resolve the problem?
0
John S.
Top achievements
Rank 1
answered on 28 Apr 2007, 05:53 PM
Hello Kevin,

It works in an asp:panel as it stands now. The problem is with Prometheus I can't update a panel with itself although I can do it now in the current RadControl AjaxManager. I am thinking of switching my application to Prometheus Ajax and am having trouble with this scenario.

Thanks,
John
0
Konstantin Petkov
Telerik team
answered on 30 Apr 2007, 11:25 AM
Hello John, Leon, Kevin,

I wan to say thanks to John, who has submitted a ticket sending a project to demonstrate the scenario with some code. I check it today but it seems it is working as it should. You can set each of the invisible control as AJAX Initiator and update what you need. Of course, if the control is not visible, you can't trigger an AJAX by it.

I'm posting the same code I've sent to John in the ticket. It works as expected on my end:

    <div> 
        <asp:Label ID="Label1" runat="server" Text="Button 1 Is Visible"></asp:Label> 
        <asp:Panel ID="Panel1" runat="server" Height="195px" Width="519px"
            <asp:Button ID="Button1" runat="server" Text="Button1"/> 
            <asp:Button ID="Button2" runat="server" Text="Button2" Visible="False" /> 
            <asp:Button ID="Button3" runat="server" Text="Button3" Visible="False" /></asp:Panel> 
     
    </div> 
        <asp:ScriptManager id="sm1" runat="server"></asp:ScriptManager> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="Button1"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="Panel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="Label1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="Button2"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="Panel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="Label1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="Button3"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="Panel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="Label1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
 

    Protected Sub Button1_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles Button1.Click 
        Button1.Visible = False 
        Button2.Visible = True 
        Label1.Text = "Button 2 Is Visible" 
    End Sub 
 
    Protected Sub Button2_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles Button2.Click 
        Button2.Visible = False 
        Button3.Visible = True 
        Label1.Text = "Button 3 Is Visible" 
    End Sub 
 
    Protected Sub Button3_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles Button3.Click 
        Button3.Visible = False 
        Button1.Visible = True 
        Label1.Text = "Button 1 Is Visible" 
    End Sub 


All the best,
Konstantin Petkov
the telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
John S.
Top achievements
Rank 1
Answers by
Leon
Top achievements
Rank 1
John S.
Top achievements
Rank 1
Kevin
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Share this question
or