View Full Version : [CLOSED] CycleButton item count

Jan 20, 2015, 2:00 AM
How can I find the number of items in a cyclebutton in behind code?

Jan 20, 2015, 4:43 AM
Hi Chris,

Does that make sense in your scenario?


<%@ Page Language="C#" %>

<script runat="server">
protected void GetCount(object sender, DirectEventArgs e)
X.Msg.Alert("GetCount", this.CycleButton1.Menu[0].Items.Count).Show();

<!DOCTYPE html>

<head runat="server">
<title>Ext.NET v2 Example</title>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:CycleButton ID="CycleButton1" runat="server">
<ext:Menu runat="server">
<ext:MenuItem runat="server" Text="Item 1" Icon="Accept" />
<ext:MenuItem runat="server" Text="Item 2" Icon="Add" />

<ext:Button runat="server" Text="Count of CycleButton's items" OnDirectClick="GetCount" />

If it doesn't and you, for example, populate Items dynamically during DirectEvents or something, then Items.Count doesn't reflect a client side state. In this case you should go with an extra parameter for a request: