找回密码
 立即注册

QQ登录

只需一步,快速开始

bpic
金牌服务用户   /  发表于:2017-7-31 17:59  /   查看:3280  /  回复:2
如何将c1FlexGrid实现整表保存
http://gcdn.gcpowertools.com.cn/forum.php?mod=viewthread&tid=10873&highlight=flexgrid%2B%B1%A3%B4%E6
下载了这个贴子的源码?

代码如下:
  void Form1_Load(object sender, System.EventArgs e)
  {
   this.oleDbDataAdapterCustomers.Fill(this.dataSet11);
   this.oleDbDataAdapterSuppliers.Fill(this.dataSet11);
  }
  void button1_Click(object sender, System.EventArgs e)
  {
   int n = this.oleDbDataAdapterCustomers.Update(this.dataSet11.Customers);
   Console.WriteLine("{0} records updated", n);
  }
  void button2_Click(object sender, System.EventArgs e)
  {
   int n = this.oleDbDataAdapterSuppliers.Update(this.dataSet11.Suppliers);
   Console.WriteLine("{0} records updated", n);
  }
  void _flex_OwnerDrawCell(object sender, C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e)
  {
   
   C1.Win.C1FlexGrid.C1FlexGrid fg = sender as C1.Win.C1FlexGrid.C1FlexGrid;
   if (e.Col >= fg.Cols.Fixed)
   {
    int index = fg.Rows[e.Row].DataIndex;
    if (index >= 0)
    {
     DataTable dt = fg.DataSource as DataTable;
     DataView  dv = dt.DefaultView;
     if (dv[index].Row.RowState == DataRowState.Modified)
      e.Style = fg.Styles["Modified"];
      //这一段是什么意思?
    }
   }

  }
        static string GetConnectionString()
        {
            string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\ComponentOne Samples\Common";
            string conn = @"provider=microsoft.jet.oledb.4.0;data source={0}\c1nwind.mdb;";
            return string.Format(conn, path);
        }

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

2 个回复

倒序浏览
bpic
金牌服务用户   /  发表于:2017-7-31 18:01:54
沙发
这个应该是绑定模式的,老师有没有非绑定模式的示例代码呀?InputPanl的数据源绑定是不是和这个类似。
回复 使用道具 举报
JeffryLI
葡萄城公司职员   /  发表于:2017-7-31 18:09:34
板凳
bpic 发表于 2017-7-31 18:01
这个应该是绑定模式的,老师有没有非绑定模式的示例代码呀?InputPanl的数据源绑定是不是和这个类似。

不好意思这边没有源码,非绑定的c1FlexGrid1.DataSource=datatable,就这一句,datatable是你从数据库中读出来的。inputpanel我需要确认下,给您回复。
请点击评分,对我5分评价,谢谢!

葡萄城控件服务团队
官方网站: https://www.grapecity.com.cn/developer
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部