Quantcast
Channel: Our ComponentOne » All Posts
Viewing all articles
Browse latest Browse all 14170

Reply To: Set C1Button Visibility

$
0
0

Hi,

Sorry for the delay on this.

Instead of setting the Visible property of false, please use the DisplayVisible property. To display the buttons on the Toolbar when a C1NavigationListItem is clicked, you can handle the OnClientClick event of C1NavigationListItem and set the 'display’ attribute of the buttons in javascript.

<C1NavigationList:C1NavigationList ID="C1NavigationList1" runat="server" AutoPostBack="true">
                        <Items>
                            <C1NavigationList:C1NavigationListItem Text="Item1" OnClientClick="Item1_ClientClick"></C1NavigationList:C1NavigationListItem>                            
                        </Items>
</C1NavigationList:C1NavigationList>
function Item1_ClientClick(e, args) {
                var btnApprove = document.getElementById('<%=btnApprove.ClientID%>');
                btnApprove.style.display = "inline-block";
                var btnHold = document.getElementById('<%=btnHold.ClientID%>');
                btnHold.style.display = "inline-block";
                var btnReject = document.getElementById('<%=btnReject.ClientID%>');
                btnReject.style.display = "inline-block";
}

To make them disappear again when the back button is clicked, you can handle the OnClick event of the LeftButton and set the DisplayVisible property of the buttons back to false.

<LeftButton OnClick="LeftButton_Click" />
protected void LeftButton_Click(object sender, EventArgs e)
    {
        this.btnApprove.DisplayVisible = false;
        this.btnHold.DisplayVisible = false;
        this.btnReject.DisplayVisible = false;
    }

In order for the click event handler of the btnApprove button to get fired, please set the AutoPostBack property of the button to true.

<C1Button:C1Button ID="btnApprove" runat="server" AutoPostBack="true" Text="Approve" OnClick="btnApprove_Click" DisplayVisible="false" />

I’ve attached a sample with the above implementations. Please take a look and let me know if you need any other help.

Regards
Abdias


Viewing all articles
Browse latest Browse all 14170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>