Click here to Skip to main content
15,861,168 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

This MMBABU working as .NET S/W Engineer. I got a problem in my application. In my application, from the main screen, am calling a child window. That child window having two DataGrids. First DataGrid having a CheckBox, I have checked that checkbox in child window loading. But I am not able to call Click event of that CheckBox. Please Help me. My written code is as follows...

C#
dgGrid.ItemsSource = null;
dgGrid.ItemsSource = objPatientAdvanceList;

if (this.IsFromRental == true)
{
if (objPatientAdvanceList != null && objPatientAdvanceList.Count > 0)
{
dgGrid.SelectedItem = objPatientAdvanceList[0];

foreach (clsClass item in (List<clsclass>)dgGrid.ItemsSource)
{
if (dgGrid.SelectedItem != null)
{
if (ItemNetAmount > 0 && ((clsClass)dgGrid.SelectedItem).ID == item.ID && Convert.ToDouble(TxtpaidAmt.Text) != 0)
{ 
((clsClass)dgGrid.SelectedItem).Used = Math.Round(Convert.ToDouble(txtAmt.Text), 0);
((clsClass)dgGrid.SelectedItem).checkAdvance = true;

chkAddPatientAdvance_Click(((CheckBox)dgGrid.Columns[5].GetCellContent(item)), null);

break;

}
}
else
item.checkPatientAdvance = false;
}
}
}


In the above code, I am getting
C#
((CheckBox)dgGrid.Columns[5].GetCellContent(item))
is NULL.
Posted
Updated 2-Aug-14 3:29am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900