
davood ramezani
Top achievements
Rank 1
davood ramezani
asked on 08 Nov 2010, 08:53 AM
hi
how can i Get Value of Cell from Selected Item in RadGridView .
how can i Get Value of Cell from Selected Item in RadGridView .
6 Answers, 1 is accepted
0
Hi davood ramezani,
All the best,
Maya
the Telerik team
Once you get the SelectedItem, you may work with its corresponding properties. For example, if the items are of type Player that has properties - Name, Country, Number, you may do the following:
var player = this.playersGrid.SelectedItem as Player;
player.Country = "newCountry";
player.Name = "newName";
player.Number = 1;
All the best,
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

davood ramezani
Top achievements
Rank 1
answered on 09 Nov 2010, 07:37 AM
hi
radGridview Selected Item is
{ PersonelCode = 780099, FName = Ali, LName = Ahmadi, NationalNo = 491528841, Id = d7e6373d-0765-45dd-a59a-f71bca10babf }
And My Class Is:
and Code for UnBox is:
radGridview Selected Item is
{ PersonelCode = 780099, FName = Ali, LName = Ahmadi, NationalNo = 491528841, Id = d7e6373d-0765-45dd-a59a-f71bca10babf }
And My Class Is:
public class SelectedStaff
{
public Guid Id { get; set; }
public string FName { get; set; }
public string LName { get; set; }
public string PersonelCode { get; set; }
public string NationalNo { get; set; }
}
SelectedStaff selectedStaff = searchStaff_grid.SelectedItem as SelectedStaff;
but out of service
result is null
0
Hi davood ramezani,
Maya
the Telerik team
In order to provide an appropriate solution, I would need a bit more details. Do you select any item before executing the code SelectedStaff selectedStaff = grid.SelectedItem as SelectedStaff ? When do you try to invoke the selected item ?
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

davood ramezani
Top achievements
Rank 1
answered on 10 Nov 2010, 06:22 AM
hi
tank you for answer.
Yes, I select item before executing the code SelectedStaff selectedStaff = grid.SelectedItem as SelectedStaff
GridView Bind to a class higher than the number of its field .
tank you for answer.
Yes, I select item before executing the code SelectedStaff selectedStaff = grid.SelectedItem as SelectedStaff
GridView Bind to a class higher than the number of its field .
0
Hello davood ramezani,
Maya
the Telerik team
I am sending you a sample demonstrating how to work with the values of the selected item. Let me know in case your scenario is not corresponding to the one in the application. Feel free to change it in the way you need and share more details in case of any differences.
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

davood ramezani
Top achievements
Rank 1
answered on 11 Nov 2010, 05:50 AM
Tnank you For Example I Do it.