具有复选框列的Siverlight DataGrid [英] Siverlight DataGrid With Checkbox Column

查看:56
本文介绍了具有复选框列的Siverlight DataGrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的SilverlightDataGrid中,当员工选择
时,我具有复选框列 复选框和他的请假状态应等于待定,然后单击
取消"按钮的"LeaveStatus"应存储为已取消",并且
LeaveStatus邮件应发送给员工的公司ID.


当我选中复选框"并单击取消"按钮时,应更新已检查的数据(即,当我单击取消"按钮时,状态为"P"的我已经拥有LeaveStatus数据字段,状态将被更新为"C")

In My SilverlightDataGrid I have Checkbox Column When Employee Select
The CheckBox & His Leave Status Should Be Equal To Pending Then Click
the Cancel Buttton Their LeaveStatus Should Stored as Cancelled and The
LeaveStatus Mail Should Be Send To the Employee''s Company id.


When i Check The CheckBox and Click the Cancel Button The Checked Data Should Be Updated (i.e.,I Have LeaveStatus DataField In That Already Status As Stored As "P" When i Click The Cancel Button THe Status Will Be Updated as "C")

Table Name=LEAVEAPP;
Query=GetCancelLeaveApply;
DatGridName=dgCancellation;
ButtonName=btnCancel;


正在在Cancelbuttonclick事件中使用它


Am using this in Cancelbuttonclick event

 private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            int empid = Int32.Parse(WebContext.Current.User.Name);
            EntityQuery<leaveapp> query = objectcontext.GetCancelLeaveApplyQuery();
            LoadOperation<leaveapp> loadop = objectcontext.Load(query);
            objectcontext.Load(objectcontext.GetCancelLeaveApplyQuery()).Completed += new EventHandler(Cancellation_Completed);
 
            objectcontext.SubmitChanges();
 
        }
void Cancellation_Completed(object sender, EventArgs e)
        {
            CheckBox chkbox = (CheckBox)this.dgCancellation.Columns[0].GetCellContent(this.dgCancellation.SelectedItem);
 
            List<leaveapp> tblist;
           tblist = ((System.ServiceModel.DomainServices.Client.LoadOperation<spider.web.leaveapp>)(sender)).Entities.ToList();
           foreach (LEAVEAPP lvapp in tblist)
           {
                     if (lvapp.EMPLOYEEID == Int32.Parse(WebContext.Current.User.Name))
                         objleaveapp = lvapp;
                }
 
           if (objleaveapp != null)
           {
 
               if ((bool)chkbox.IsChecked)
               {
                   objleaveapp.LV_STATUS = "C ";
 
               }
               objectcontext.SubmitChanges();
               MessageBox.Show("Done");
 
           }
        }
</spider.web.leaveapp></leaveapp></leaveapp></leaveapp>



LinqQuery是



LinqQuery is

 public IQueryable<leaveapp> GetCancelLeaveApply()
        {
            var qry = from tblleaveapp in this.ObjectContext.LEAVEAPP select tblleaveapp;
            return qry;
        }

</leaveapp>

推荐答案


您是否尝试使用checkbox.IsChecked选项

因为我认为checkbox.Checked不起作用.选项checkbox.IsChecked起作用.因此,您可以尝试让我知道是否可行.

-
AJ
Hi
Did you try using checkbox.IsChecked option

Because I think that checkbox.Checked does not work. The option checkbox.IsChecked does work. So you can try and let me know if that works.

--
AJ


这篇关于具有复选框列的Siverlight DataGrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆