|
-
Jun 13th, 2013, 10:39 AM
#2
Thread Starter
Hyperactive Member
Re: How get the value of a HIDDEN DataGrid cell?
Okay, I got the solution, and it's incredibly simple. First, assume that the DataGrid is bound to a list of type Policy, which is a custom written class... List<Policy>. The policy class has a field called PolicyID, and that's the value I want. Given that as the ItemSource, getting the value of a hidden column, or ANY column, for that matter, becomes simple:
Code:
Policy pol = (Policy)grdData.SelectedItem;
int policyID = pol.PolicyID;
What I'm doing here is accessing the bound list instead of the DataGrid itself. But it works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|