Пример #1
0
        protected override void InitControls()
        {
            if (_lookupList != null)
            {
                //add dynamic additional value rows
                if (_lookupList.Count > 0)
                {
                    ILookupObject firstLookupObject = _lookupList[0];
                    if (firstLookupObject.LookupAdditionalValues != null)
                    {
                        DynamicGridHelper.AddDynamicColumns(gvLookup, firstLookupObject.LookupAdditionalValues);
                    }
                }
            }

            if (_allowNullSelection)
            {
                btnNullSelection.Visible = true;
            }
            else
            {
                btnNullSelection.Visible = false;
            }

            if (_bestFitColumns)
            {
                gvLookup.BestFitMaxRowCount = 100;
                gvLookup.BestFitColumns();
            }

            if (_lookupByKey && !_lookupByName)
            {
                LookupByKey();
            }
            else if (!_lookupByKey && _lookupByName)
            {
                LookupByName();
            }
            else if (_lookupByKey && _lookupByName)
            {
                LookupByKeyAndName();
            }

            if (_allowMultiSelection)
            {
                colSelected.Visible      = true;
                colSelected.VisibleIndex = 0;
            }
        }
Пример #2
0
        private void gvLookup_CustomUnboundColumnData(object sender, CustomColumnDataEventArgs e)
        {
            ILookupObject lookupObject = _lookupList[e.ListSourceRowIndex];

            DynamicGridHelper.GetUnboundColumnData(e, lookupObject.LookupAdditionalValues);
        }