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

Gridview button

5 Answers 108 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brady
Top achievements
Rank 1
Brady asked on 22 Jul 2010, 06:04 AM
How do you code a button in a Gridview to change the value of a cell?

5 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 22 Jul 2010, 08:17 AM
Hi Brady,

You can use this forum thread as a reference where you will find examples for getting a cell depending on its value or its row/column indices. In the two available projects the cell is just set to current, but you can also change its value on a button click like:

if (cell != null)
{
    cell.Value = "newValue";
}

However, in case this does not meet your exact requirements, please give us more details about your expectations and specifics about the cell whose value you want to change.

Greetings,
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
Brady
Top achievements
Rank 1
answered on 22 Jul 2010, 01:20 PM
cell.Value = "newValue"; is not changing the cell value?

any ideas why?
0
Maya
Telerik team
answered on 23 Jul 2010, 04:34 PM
Hi Brady,

Indeed, when testing the case with our latest version of RadControls, the value of the cell is not updated. We would investigate the issue and we will get back to you as soon as we are able to provide you with an accurate solution.
Please, excuse us for the inconvenience caused.

Greetings,
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
Brady
Top achievements
Rank 1
answered on 23 Jul 2010, 08:54 PM

Is there any way I can use the previous version?
thanks for all your help

0
Maya
Telerik team
answered on 28 Jul 2010, 04:08 PM
Hi Brady,

I may suggest you as a workaround (applicable also with our latest version) to change the value of the cell in the following way:

cell.ParentRow.Item.GetType().GetProperty(cell.DataColumn.DataMemberBinding.Path.Path).SetValue(cell.ParentRow.Item, newCellValue, null);

However, in order that to work and accomplish the desired result, you need to implement the INotifyPropertyChanged Interface.
Furthermore, as we are now in the process of developing the right method for changing the cell's value, we would greatly appreciate your feedback about the purpose and the scenario of your application.
Thank you in advance.

Best wishes,
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
Tags
GridView
Asked by
Brady
Top achievements
Rank 1
Answers by
Maya
Telerik team
Brady
Top achievements
Rank 1
Share this question
or