protected void InitiatorReorderList_ItemDataBound(object sender, AjaxControlToolkit.ReorderListItemEventArgs e)
 {
     if ((!string.IsNullOrEmpty(this.Mode)) && (this.Mode.Equals(ModeEnum.Readonly)))
     {
         ((ImageButton)e.Item.FindControl("ImageDeleteButton")).Visible    = false;
         ((RadioButtonList)e.Item.FindControl("RadioButtonList1")).Enabled = false;
     }
     else
     {
         ((ImageButton)e.Item.FindControl("ImageDeleteButton")).Visible    = true;
         ((RadioButtonList)e.Item.FindControl("RadioButtonList1")).Enabled = true;
     }
 }
Beispiel #2
0
        protected void reorderList_contentItemCreated(object sender, AjaxControlToolkit.ReorderListItemEventArgs e)
        {
            //NOT WORKING
            //IT DON'T FIND THE CONTROL "ddlPrivacy"

            /*
             * AjaxControlToolkit.ReorderList reorderList = (AjaxControlToolkit.ReorderList)sender;
             *
             * DropDownList ddlPrivacy = (DropDownList)reorderList.FindControl("ddlPrivacy");
             *
             * if ((ddlPrivacy != null) && (ddlPrivacy.Items.Count <= 0))
             * {
             *  //Add USERS to RECIPIENT DROPDOWNBOX
             *
             *  ddlPrivacy.Items.Clear();
             *
             *  int topicId = Convert.ToInt32(Session["topicId"]);
             *  List<TUser> listTUser = new List<TUser>();
             *  ListItem listItem;
             *  TUser tUserAux;
             *
             *  //Add EVERYBODY
             *  listItem = new ListItem("Everybody", "Everybody");
             *  ddlPrivacy.Items.Add(listItem);
             *
             *  //Add MySelf (Annotation)
             *  listItem = new ListItem("Myself (Annotation)", Session["userId"].ToString());
             *  ddlPrivacy.Items.Add(listItem);
             *
             *
             *  //Add Users of my CURRENT CLASSES
             *  List<TCourse> listTCourse = (List<TCourse>)Session["currentCourses"];
             *  TCourse tCourseAux;
             *  Boolean userExistInList = false;
             *  for (int count = 0; count < listTCourse.Count; count++)
             *  {
             *      tCourseAux = listTCourse[count];
             *      listTUser = DbControl.getInstance().getUsersCourse(tCourseAux.id, true);
             *      for (int count2 = 0; count2 < listTUser.Count; count2++)
             *      {
             *          tUserAux = listTUser[count2];
             *          userExistInList = false;
             *          //Verify if the USER is already in the List (including me)
             *          for (int count3 = 0; count3 < ddlPrivacy.Items.Count; count3++)
             *          {
             *              if (tUserAux.id == ddlPrivacy.Items[count3].Value)
             *              {
             *                  userExistInList = true;
             *                  break;
             *              }
             *          }
             *          if (!userExistInList)
             *          {
             *              listItem = new ListItem(tUserAux.ToString(), tUserAux.id);
             *              ddlPrivacy.Items.Add(listItem);
             *          }
             *      }
             *  }
             *  //----------------------------------
             * }
             */
        }