开发者论坛

 找回密码
 注册 (请使用非IE浏览器)
查看: 3934|回复: 0

[求助] XtraGrid从表刷新问题

[复制链接]

0

精华

0

贡献

0

赞扬

帖子
1
软币
62
在线时间
1 小时
注册时间
2016-3-14
发表于 2016-3-14 11:34:25 | 显示全部楼层 |阅读模式
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            List<Test> tests = new List<Test>() { new Test() { ID = 1, test = new List<Test1>() { new Test1() { Value = 2 } } } };
            gridControl1.DataSource = tests;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            Test test = gridView1.GetFocusedRow() as Test;
            if (test != null)
            {
                test.ID += 11;
                test.test.First().Value += 1;
            }
            gridView1.RefreshData();

        }
    }
    public class Test
    {
        [DisplayName("标识")]
        public int ID { get; set; }

        //[DisplayName("集合")]
        public List<Test1> test { get; set; }
    }
    public class Test1
    {
        [DisplayName("值")]
        public int Value { get; set; }
    }
}

//主表的数据界面会刷新,但是子表数据改了但是界面不自动刷新,各种刷新都试了,刷新不了,求解决。。。。。。。。。。。。。。。。急
回复

使用道具 举报

Archiver|手机版|小黑屋|开发者网 ( 苏ICP备08004430号-2 )
版权所有:南京韵文教育信息咨询有限公司

GMT+8, 2024-6-1 07:41

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表