This is a migrated thread and some comments may be shown as answers.

Getting value of each cell in RadGridView

4 Answers 611 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sean Wright
Top achievements
Rank 1
Sean Wright asked on 07 Apr 2011, 05:19 PM
Hi,

I am using a RadGridView in a WPF C# application. The grid is created in the xaml thusly:

<Controls:RadGridView x:Name="theBOMEntryGrid">

The grid has several columns:
--Mark
--Quantity
--Designation

Each of those columns has a UniqueName set; for example:
 <Controls:GridViewDataColumn Header="Mark"
                                         TextAlignment="Left"
                                         UniqueName="Mark"                                       
                                         >
In the code-behind of this screen I need to simply populate some C# properties with the values that are input in each of those cells but I am having trouble finding or figuring out how to do this.

Thank you in advance.

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 07 Apr 2011, 05:24 PM
Hi Sean Wright,

The recommended approach would be to work with the underlaying data item and get its corresponding properties.

Regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Sean Wright
Top achievements
Rank 1
answered on 07 Apr 2011, 05:30 PM
Hi Maya,

Thanks for responding so quickly. I hate to be thick about this but I was wondering if there was an example you could provide.

Basically I need to be able to write in C# something along the lines of:

public string Mark { get; set; }

public void GetCellValues(){
     Mark = theBOMEntryGrid.(cell name here, followed by cell value)

Something along those lines, anyway.
0
Maya
Telerik team
answered on 07 Apr 2011, 05:42 PM
Hello Sean Wright,

I am sending you a sample project illustrating how you may get the values for the properties of a particular item, I hope that helps.
 

Regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Sean Wright
Top achievements
Rank 1
answered on 07 Apr 2011, 06:43 PM
Thanks again...

Now suppose that the grid is not actually bound to any data source. In fact, this grid I have is meant merely to be a dummy entry screen. The user will input the values into the grid cells and then when a button is clicked those values are meant to be passed to another class which will do some analysis with the values. So I need to grab those values to place into variables that will be passed to that analysis class.
Tags
GridView
Asked by
Sean Wright
Top achievements
Rank 1
Answers by
Maya
Telerik team
Sean Wright
Top achievements
Rank 1
Share this question
or