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.
Loading
anitha rPosted Apr 18, 2011, 2:15 AM
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;
Am using this in Cancelbuttonclick event query =
private void btnCancel_Click(object sender, RoutedEventArgs e)
{
int empid = Int32.Parse(WebContext.Current.User.Name);
EntityQuery
objectcontext.GetCancelLeaveApplyQuery(); loadop = objectcontext.Load(query);
LoadOperation
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.dgCancellatio
n.SelectedItem);
tblist;
List
tblist =
((System.ServiceModel.DomainServices.Client.LoadOperation
AVEAPP>)(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");
}
}
LinqQuery is
public IQueryable GetCancelLeaveApply()
{
var qry = from tblleaveapp in this.ObjectContext.LEAVEAPP select
tblleaveapp;
return qry;
}
Suthish NairPosted Apr 14, 2011, 3:34 PM
Might article helps..
Using CheckBox control in Blend and Silverlight
Select all CheckBox in DataGrid and delete rows in Silverlight 3
CheckBox in Silverlight
anitha rPosted Apr 14, 2011, 8:15 AM
my Question is How To Write Checkbox Checked bool Condition in silverlight
Suthish NairPosted Apr 14, 2011, 7:03 AM