In this article we will see how we can see some detail in each row in a DataGrid.
Creating Silverlight Project
Fire up Visual Studio 2008 and create a Silverlight Application. Name it as RowDetailDataGridInSL3.

Go ahead and add a DataGrid to your application.

Now add a Class to define properties for sample data.
public class Users: INotifyPropertyChanged
{
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
#endregion
#region UserName
private string _UserName;
public string UserName
{
get { return _UserName; }
set
{
if (value.Length < 4)
{
throw new ValidationException("User Name should contain atleast 4 chars");
}
_UserName = value;
RaisePropertyChanged("UserName");
}
}
#endregion
#region Age
private int _Age;
public int Age
{
get { return _Age; }
set
{
_Age = value;
}
}
#endregion
#region Gender
private string _Gender;
public string Gender
{
get { return _Gender; }
set
{
_Gender = value;
}
}
#endregion
#region Country
private string _Country;
public string Country
{
get { return _Country; }
set
{
_Country = value;
}
}
#endregion
private void RaisePropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}



shaiffy singhPosted Apr 13, 2010, 8:13 AM
sir ! i want to access the controls placed inside the row template of datagrid in silverlight ! any help will be appreciated thnx in advance !
Ninoska EspidelPosted Apr 1, 2010, 2:52 PM
Hola estoy creando una aplicacion que contiene un datagrid con detalle pero en el detalle tengo otro datagrid, el mismo tiene nombre pero no logro hacer aparecer el nombre para conectarle el itemsource. en lo que me puedas ayudar.
Sunny WeiPosted Aug 27, 2009, 12:38 PM
but how can u get a dg cell value ?