示例#1
0
        internal object GetCheckedValue(RadCheckedListDataItem item)
        {
            if (string.IsNullOrEmpty(this.checkedMember))
            {
                return((object)false);
            }
            object component;

            try
            {
                component = this.checkedMember.Split('.').Length <= 1 ? this.listSource.GetBoundValue(item.DataBoundItem, this.checkedMember) : this.GetSubPropertyValue(this.checkedMember, item.DataBoundItem);
            }
            catch (ArgumentException ex)
            {
                component          = item.DataBoundItem;
                this.DisplayMember = "";
                this.ValueMember   = "";
                this.CheckedMember = "";
            }
            if (component == null)
            {
                component = (object)"";
            }
            return((object)this.GetFormattedValue(component, TypeDescriptor.GetConverter(component)));
        }
示例#2
0
 internal void ProcessItem(RadCheckedListDataItem radCheckedListDataItem)
 {
     this.checkedItems.ProcessCheckedItem(radCheckedListDataItem);
     if (this.IsUpdating())
     {
         return;
     }
     this.SyncEditorElementWithSelectedItem();
 }
        private void checkBox_ToggleStateChanging(object sender, StateChangingEventArgs args)
        {
            RadCheckedListDataItem data = (RadCheckedListDataItem)this.Data;
            bool flag = args.NewValue == Telerik.WinControls.Enumerations.ToggleState.On;

            if (data.Checked == flag)
            {
                return;
            }
            data.Checked = flag;
            args.Cancel  = data.Checked != flag;
        }
 protected virtual RadCheckedListDataItem CreateCheckedListDataItem(
   RadListDataItem item)
 {
   RadCheckedListDataItem checkedListDataItem = new RadCheckedListDataItem(item.Text, false);
   checkedListDataItem.Value = item.Value;
   checkedListDataItem.Tag = item.Tag;
   checkedListDataItem.Height = item.Height;
   checkedListDataItem.Image = item.Image;
   checkedListDataItem.ImageAlignment = item.ImageAlignment;
   checkedListDataItem.TextAlignment = item.TextAlignment;
   checkedListDataItem.TextImageRelation = item.TextImageRelation;
   checkedListDataItem.TextWrap = item.TextWrap;
   checkedListDataItem.TextOrientation = item.TextOrientation;
   return checkedListDataItem;
 }
示例#5
0
 private void UpdateCheckedDataItems()
 {
     foreach (RadListDataItem radListDataItem in this.Items)
     {
         radListDataItem.CachedText = this.GetUnformattedValue(radListDataItem);
         RadCheckedListDataItem checkedListDataItem = radListDataItem as RadCheckedListDataItem;
         if (checkedListDataItem != null)
         {
             string str = this.GetCheckedValue(checkedListDataItem).ToString();
             if (string.IsNullOrEmpty(str))
             {
                 str = "False";
             }
             checkedListDataItem.Checked = Convert.ToBoolean(str);
         }
     }
 }
        protected override void SynchronizeProperties()
        {
            base.SynchronizeProperties();
            if (!(this.Data is RadCheckedListDataItem))
            {
                return;
            }
            RadCheckedListDataItem data = (RadCheckedListDataItem)this.Data;

            this.checkBox.ReadOnly = data.Owner.ReadOnly;
            if (this.checkBox.IsChecked != data.Checked)
            {
                this.checkBox.ToggleStateChanging -= new StateChangingEventHandler(this.checkBox_ToggleStateChanging);
                this.checkBox.IsChecked            = data.Checked;
                this.checkBox.ToggleStateChanging += new StateChangingEventHandler(this.checkBox_ToggleStateChanging);
            }
            this.label.Text = data.Text;
        }
 public void Add(RadCheckedListDataItem item)
 {
   base.Add((RadListDataItem) item);
 }
示例#8
0
 public RadCheckedListDataItemEventArgs(RadCheckedListDataItem item)
 {
     this.item = item;
 }
 public RadCheckedListDataItemCancelEventArgs(RadCheckedListDataItem item, bool cancel)
     : base(cancel)
 {
     this.item = item;
 }