明明是编辑列的时候就排在前面的列,绑定DataSource就跑到最后面去了

解决方案 »

  1.   


    select yfdh,case ifrk when '0' then '' when '1' then '已入库' end RKZT,
    case bdrq when '' then '' else '已报到' end BDZT,dj,djmc,jg,je,bzjs,bzzl,fbzjs,fbzzl,djhgl,jsy,ch,xl,keyno 
    from T_01_ZDYFD where crq>='2009-05-08' and crq<='2009-07-08' 
      

  2.   

    BDZT的列跑到最后去了,按照设计器,本应该在第三的
      

  3.   

    如果你没有指定DataGridView的列
    绑定的时候,列的顺序是和你的数据源的顺序一样的
      

  4.   

    this.DGV_YFDJ.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
                this.BD,
                this.YFDH,
                this.BDZT,
                this.RKZT,
                this.DJ,
                this.DJMC,
                this.JG,
                this.JE,
                this.BZJS,
                this.BZZL,
                this.FBZJS,
                this.FBZZL,
                this.DJHGL,
                this.Column1,
                this.Column2,
                this.Column3,
                this.keyno,
                this.IFRK});string strSql = 
    "select yfdh,
    case ifrk when '0' then '' when '1' then '已入库' end RKZT, 
    case bdrq when '' then '' else '已报到' end BDZT,dj,djmc,jg,je,bzjs,bzzl,fbzjs,fbzzl,djhgl,jsy,ch,xl,keyno 
    from T_01_ZDYFD where crq>='2009-05-08' and crq <='2009-07-08' ";DGV_YFDJ.DataSource = PEAS.Query(strSql);
      

  5.   

    我试出来了,原来是因为this.IFRK和this.RKZT都绑定了数据源的同一列
    谢谢楼上各位朋友的热心帮忙啦~~~