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

get calculated cell value

1 Answer 122 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Matthieu
Top achievements
Rank 1
Matthieu asked on 16 Oct 2020, 10:10 AM

Hi community,

 

I am using the current trial version of Telerik UI for Wpf.

I can not find getters to get a cell value of a calculated column, programmatically. Is there a way to find a simple cell value.

- Documentation of the RadGridView :

 

if ((decimal)radGridView1.Rows[0].Cells["UnitPrice"].Value > 10)

     radGridView1.Rows[0].Cells["UnitPrice"].Value = 10;

 

But when I try radGridView1.Rows... I have the message "No definition for Rows..."

So i can not use the documentation code

 

Thank you

 

Matthieu Meunier

 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 20 Oct 2020, 09:12 AM

Hello Matthieu,

You are right that the RadGridView for WPF does not expose such Rows collection property. Basically, you can use the approach suggested in this forum thread by my colleague Milan to get a visible row's values. The approach here will work only for visible rows. My guess is that you will need to get the value of an item that is not visible. In this case, you can use the Items collection property of the RadGridView, which represents all business items loaded in the grid.

var myItem = this.gridView.Items[20] as MyObject;

Can you give this approach a try and let me know if it is suitable for you?

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products, quickly just got a fresh new look + new and improved content, including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GridView
Asked by
Matthieu
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or