C#基础Winform表格Spread1_Sheet1遍历按行、列赋值

 private void SetPatientBalanceInfo(List<Neusoft.HISFC.Models.Registration.Register> patientObjList)

        {

            this.neuSpread1_Sheet1.RowCount = 0;

            foreach (Neusoft.HISFC.Models.Registration.Register patientInfo in patientObjList)

            {

                this.neuSpread1_Sheet1.Rows.Add(this.neuSpread1_Sheet1.RowCount, 1);

                int row = this.neuSpread1_Sheet1.RowCount - 1;

                FarPoint.Win.Spread.CellType.CheckBoxCellType t = new FarPoint.Win.Spread.CellType.CheckBoxCellType();

                FarPoint.Win.Spread.CellType.TextCellType a = new FarPoint.Win.Spread.CellType.TextCellType();

                this.neuSpread1.ActiveSheet.Cells[row, 0].CellType = t;

                this.neuSpread1.ActiveSheet.Cells[row, 6].CellType = a;

                this.neuSpread1_Sheet1.Rows[row].Tag = patientInfo;

                this.neuSpread1_Sheet1.Cells[row, 1].Text = patientInfo.ID;

                this.neuSpread1_Sheet1.Cells[row, 2].Text = patientInfo.IDCard.ToString();

                this.neuSpread1_Sheet1.Cells[row, 3].Text = patientInfo.Name;

                this.neuSpread1_Sheet1.Cells[row, 4].Text = patientInfo.SIMainInfo.BalanceDate.ToString("yyyy-MM-dd HH:mm:ss");//姓名

                this.neuSpread1_Sheet1.Cells[row, 5].Text = patientInfo.SIMainInfo.FeeTimes.ToString();

                this.neuSpread1_Sheet1.Cells[row, 6].Text = patientInfo.PayCost.ToString();

                this.neuSpread1_Sheet1.Cells[row, 7].Text = patientInfo.SIMainInfo.TotCost.ToString();//in_date

                this.neuSpread1_Sheet1.Cells[row, 8].Text = patientInfo.SIMainInfo.Memo;//dept_name

                this.neuSpread1_Sheet1.Cells[row, 9].Text = patientInfo.SIMainInfo.TypeCode;//out_date

                this.neuSpread1_Sheet1.Cells[row, 10].Text = patientInfo.Mark1;

                this.neuSpread1_Sheet1.Cells[row, 11].Text = patientInfo.SeeDoct.ID;

                this.neuSpread1_Sheet1.Cells[row, 12].Text = patientInfo.SeeDoct.OperTime.ToString();

            }

        }

1.2 Spread1_Sheet1按neuSpread1_Sheet1.DataSource赋值

        private void Refresh(List<DownsScreening> downsScreening)

        {

            this.neuSpread1_Sheet1.DataSource=null;

            this.neuSpread1_Sheet1.DataSource = downsScreening;

            this.neuSpread1.Refresh();

        }

  • 8
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值