Hi all
iam using a xamgrid ..if i set any field in group by area and tick the checkbox and click the remove button .i want to get the value of tat group by area record..how to do tat?
how to do code when the user selected group by area and clcik the remove button..
can anyone help me
without giving group by area i get the field values using this code
foreach (DataRecord dgRec in grdActiveUser.Records) { if (dgRec.Cells["IsSelected"].Value.Equals("True")) { string StrCheckID = Convert.ToString(dgRec.Cells["ActiveClientGuid"].Value.ToString()); } }
Hello,
I was not able to understand what you are trying to achieve. Can you please give us more detailed information on your requirement?
Thanks.
Hi,
When i enable group by area in my grid and tick my checkboxes of the some records andclcik the remove button iam getting error
Unable to cast object of type 'Infragistics.Windows.DataPresenter.GroupByRecord' to type 'Infragistics.Windows.DataPresenter.DataRecord'.
my code in remove button is:
deleting all the records in database when isselected-checkbox name is set as true:: foreach (DataRecord dgRec in grdActiveUser.Records) { if (dgRec.Cells["IsSelected"].Value.Equals("True")) { string StrCheckID = Convert.ToString(dgRec.Cells["ActiveClientGuid"].Value.ToString()); } }
As the exceptions says, you are trying to case a Record to a DataRecord, while it is a GroupByRecord. The GroupByRecord does not expose the Cells collection and this is why the exception is thrown.
When the XamDataGrid is grouped, the Records collection exposes GroupBy record. You should check if the Record is GroupBy or DataRecord in order for this code to work.
foreach (GroupByRecord gr in xamDataGrid1.Records)
{
foreach (Record r in gr.ChildRecords)
}
Thank u for ur reply..how to take the values of each cell of group by record ?can u helpme..
grdActiveUser.Records )
{ }