Silverlight Datagrid获取单元格值

时间:2012-03-29 09:02:19

标签: silverlight silverlight-4.0 datagrid

我无法读取datagrid中的单元格文本。我怎样才能做到这一点?代码并在图像上打印screan

非常感谢

http://e1203.hizliresim.com/v/x/3x3dg.jpg代码

http://e1203.hizliresim.com/v/x/3x3dw.jpg printscrean

这是我创建网格的地方;我认为问题是;我有两个表hr_Employee和hr_Scoring。当我从表hr_Scoring绑定“dayscore”时出现了问题。

DomainServiceDB db = new DomainServiceDB();
        //LoadOperation<hr_Employee> employeeLoadOp;
        readonly Error err = new Error("Kaydederken hata oluştu. Lütfen tekrar deneyiniz.");

        public PersonelUserControl()
        {
            InitializeComponent();

            dgPersonelTakip.ItemsSource = db.hr_Employees; 

            db.Load(db.GetHr_EmployeeQuery());

            int year = DateTime.Now.Year;
            int month = DateTime.Now.Month;

            int day = DateTime.DaysInMonth(year, month);

            DataGridTextColumn adi = new DataGridTextColumn() { Header = "Adı ", Binding = new Binding("Name"), IsReadOnly = true };
            DataGridTextColumn soyadi = new DataGridTextColumn() { Header = "Soyadı ", Binding = new Binding("Surname"), IsReadOnly = true };

            dgPersonelTakip.Columns.Add(adi);
            dgPersonelTakip.Columns.Add(soyadi);

            for (int i = 1; i <= day; i++)
            {                
                DataGridTextColumn c = new DataGridTextColumn()
                {
                    IsReadOnly = false,
                    Header = i.ToString(),
                   // Binding = new Binding(path: "hr_Scorings.DayScore")
                    Binding = new Binding("hr_Scorings.DayScore")
                };
                dgPersonelTakip.Columns.Add(c);
            }
        }

0 个答案:

没有答案