DateTime.Parse(ds.Tables[0].Rows[i]["启始日期"].ToString("yyyy-MM-dd")))

解决方案 »

  1.   

    Tables[0].Rows[i]["停止日期"].ToString("0:d")
      

  2.   

    因为DataSet里自动生成的列是日期类型的,你往里边赋值会自动转成yyyy-m-d hh:mm:ss格式的。只好另建一个string类型的列,把ToShortDateString()处理后的值放进去。而且,(DateTime.Parse(ds.Tables[0].Rows[i]["启始日期"].ToString())).ToShortDateString();这句话也不对吧,没有赋值。应为ds.Tables[0].Rows[i]["启始日期"]=(DateTime.Parse(ds.Tables[0].Rows[i]["启始日期"].ToString())).ToShortDateString();
      

  3.   

    我觉得应该在itembound事件中
    e.items.cell["你的列"].text=DateTime.Parse(e.items.cell["你的列"].text.ToString("yyyy-MM-dd"))