using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
   protected void Page_Load(object sender, EventArgs e)
   {
      this.custDL1.EditRecord +=
         new CustomerDataList.EditRecordHandler(custDL1_EditRecord);
      this.custDL1.FinishedEditRecord +=
         new CustomerDataList.FinishedEditRecordHandler(
            custDL1_FinishedEditRecord);
   }

   protected void Button1_Click(object sender, EventArgs e)
   {
      Label1.Text = "Zmieniony!";
   }

   protected void btnSetProperties_OnClick(object sender, EventArgs e)
   {
      if (ddlDirection.SelectedValue == "H")
      {
         this.custDL1.WhichDirection = RepeatDirection.Horizontal;
      }
      else
      {
         this.custDL1.WhichDirection = RepeatDirection.Vertical;
      }
      if (this.txtNumberColumns.Text.Length > 0)
      {
         this.custDL1.HowManyColumns = Convert.ToInt32(this.txtNumberColumns.Text);
      }
   }

   protected void custDL1_EditRecord(object sender,
      CustomerDataList.ChangedRecordEventArgs e)
   {
      lblDisplayCompany.Text = "Edycja " + e.CompanyName;
   }

   protected void custDL1_FinishedEditRecord(object sender, EventArgs e)
   {
      lblDisplayCompany.Text = string.Empty;
   }
}
