private void superGridControl1_GetCellFormattedValue(object sender, GridGetCellFormattedValueEventArgs e)
        {
            if (e.GridCell.ColumnIndex == -1 || e.GridCell.GridRow.Index == -1)
            {
                return;
            }

            SuperGridControl sgc   = (SuperGridControl)sender;
            String           newid = sgc.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, 13).Value.ToString();

            switch (sgc.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, e.GridCell.ColumnIndex).NullString)
            {
            case "抓拍":
                if (Dbers.GetInstance().SelfDber.Entities <CmcsTrainWatch>(String.Format(" where TrainWeightRecordId='{0}'", newid)).Count == 0)
                {
                    sgc.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, e.GridCell.ColumnIndex).Value = "";
                }
                break;

            case "装车线":
                if (Dbers.GetInstance().SelfDber.Entities <CmcsTrainLine>(String.Format(" where TrainWeightRecordId='{0}'", newid)).Count == 0)
                {
                    sgc.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, e.GridCell.ColumnIndex).Value = "";
                }
                break;
            }
        }
示例#2
0
        private void superGridControl1_GetCellFormattedValue(object sender, GridGetCellFormattedValueEventArgs e)
        {
            if (e.GridCell.ColumnIndex == -1 || e.GridCell.GridRow.Index == -1)
            {
                return;
            }

            switch (superGridControl1.PrimaryGrid.Columns[e.GridCell.ColumnIndex].Name)
            {
            case "抓拍":
                //抓拍图片
                break;
            }
        }
        /// <summary>
        /// This routine is called to get the formatted value
        /// of the cell.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void SuperGridControl2GetCellFormattedValue(
            object sender, GridGetCellFormattedValueEventArgs e)
        {
            // If the grid is asking for the formatted value of a cell
            // in the "Size" column, then format an appropriate display.

            if (e.GridCell.ColumnIndex == _SizeIndex)
            {
                long size = (long)e.GridCell.Value;

                e.FormattedValue = (size >= 1024)
                    ? Math.Ceiling((double)size / 1024) + " KB"
                    : size.ToString();
            }
        }
        private void superGridControl1_GetCellFormattedValue(object sender, GridGetCellFormattedValueEventArgs e)
        {
            if (e.GridCell.ColumnIndex == -1 || e.GridCell.GridRow.Index == -1)
            {
                return;
            }

            SuperGridControl sgc = (SuperGridControl)sender;
            //String newid = sgc.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, 12).Value.ToString();
            //switch (sgc.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, e.GridCell.ColumnIndex).NullString)
            //{
            //    case "抓拍":

            //        break;
            //    case "装车线":

            //        break;
            //}
        }