Spread for ASP.NET 10 Product Documentation
AutoPostBack Property (TouchStripItem)
Example 


Gets or sets a value that indicates whether an automatic postback to the server occurs when the user clicks the menu item.
Syntax
'Declaration
 
Public Overrides Property AutoPostBack As Boolean
'Usage
 
Dim instance As TouchStripItem
Dim value As Boolean
 
instance.AutoPostBack = value
 
value = instance.AutoPostBack
public override bool AutoPostBack {get; set;}

Property Value

true if an automatic postback occurs when the user clicks the menu item; otherwise, false. The default is false.
Example
This example creates custom touch strip items.
protected void Page_Load(object sender, EventArgs e)
       {
           if (this.IsPostBack) return;
           FarPoint.Web.Spread.TouchStrip ts = new FarPoint.Web.Spread.TouchStrip();
           FarPoint.Web.Spread.TouchStripItem item1 = new FarPoint.Web.Spread.TouchStripItem("Red");
           FarPoint.Web.Spread.TouchStripItem item2 = new FarPoint.Web.Spread.TouchStripItem("Green");
           FarPoint.Web.Spread.TouchStripItem item3 = new FarPoint.Web.Spread.TouchStripItem("Blue");      
           ts.Items.Add(item1);
           ts.Items.Add(item2);
           ts.Items.Add(item3);
           item1.AutoPostBack = true;
           item2.AutoPostBack = true;            
           FpSpread1.TouchStrips[FarPoint.Web.Spread.TouchStripShowingArea.Row] = ts;           
       }

       protected void FpSpread1_TouchStripItemClicked(object sender, FarPoint.Web.Spread.TouchStripItemClickEventArgs eventArgs)
       {
           FpSpread1.ActiveSheetView.Cells[0, 0].Value += eventArgs.Area.ToString();
           FpSpread1.SaveChanges();            
       }
Protected Sub Page_Load(sender As Object, e As EventArgs)
    If Me.IsPostBack Then
        Return
    End If
    Dim ts As New FarPoint.Web.Spread.TouchStrip()
    Dim item1 As New FarPoint.Web.Spread.TouchStripItem("Red")
    Dim item2 As New FarPoint.Web.Spread.TouchStripItem("Green")
    Dim item3 As New FarPoint.Web.Spread.TouchStripItem("Blue")
    ts.Items.Add(item1)
    ts.Items.Add(item2)
    ts.Items.Add(item3)
    item1.AutoPostBack = True
    item2.AutoPostBack = True
    FpSpread1.TouchStrips(FarPoint.Web.Spread.TouchStripShowingArea.Row) = ts
End Sub

Protected Sub FpSpread1_TouchStripItemClicked(sender As Object, eventArgs As FarPoint.Web.Spread.TouchStripItemClickEventArgs)
    FpSpread1.ActiveSheetView.Cells(0, 0).Value += eventArgs.Area.ToString()
    FpSpread1.SaveChanges()
End Sub
Requirements

Target Platforms: Windows 7, Windows 8, Windows 10, Windows Vista, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP Professional

See Also

Reference

TouchStripItem Class
TouchStripItem Members

 

 


Copyright © GrapeCity, inc. All rights reserved.