Ejemplo n.º 1
0
    /// <summary>
    /// On item command
    /// </summary>
    protected void OnItemCommand(object sender, ListViewCommandEventArgs e)
    {
        // get rowindex
        ListViewDataItem dataItem = e.Item as ListViewDataItem;

        if (dataItem == null)
        {
            return;                   //safe check
        }
        string source = e.CommandSource.ToString();
        string arg    = e.CommandArgument.ToString();

        int rowindex = dataItem.DataItemIndex;

        if (rowindex >= 0 && rowindex < this._lvCountryResult.Items.Count)
        {
            ucWasteTransferRecieverSheet control = (ucWasteTransferRecieverSheet)this._lvCountryResult.Items[rowindex].FindControl("_ucWasteTransferHazRecieverSheet");

            if (arg.Equals("togglesheet"))
            {
                closeAllSheets(); // only allow one sheet open

                control.Visible = !control.Visible;
                Control div = this._lvCountryResult.Items[rowindex].FindControl("_subsheet");
                div.Visible = !div.Visible;

                if (control.Visible)
                {
                    string countryCode = e.CommandName; //name holds the coutry code
                    control.Populate(SearchFilter, countryCode);
                }
            }
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Close sheets
 /// </summary>
 private void closeAllSheets()
 {
     for (int i = 0; i < this._lvCountryResult.Items.Count; i++)
     {
         ucWasteTransferRecieverSheet control = (ucWasteTransferRecieverSheet)this._lvCountryResult.Items[i].FindControl("_ucWasteTransferHazRecieverSheet");
         if (control != null)
         {
             control.Visible = false;
         }
     }
 }