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

[Solved] Data in radgridviewcolumn is not appearing...

2 Answers 82 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
mark
Top achievements
Rank 1
mark asked on 12 May 2009, 11:01 PM
I have defined a few columns in a radgrid, then in the code behind, called a wcf service which returns data.  I take that data, put it into a collection of objects(ObservableCollection), then set the radgrid.itemsource property.  The Rows appear in the grid, but there is no data in them.  I'm not sure what is going on.  Here are my column definitions:

<telerikGridView:GridViewColumn HeaderText="Language" UniqueName="Language"></telerikGridView:GridViewColumn>
<telerikGridView:GridViewColumn HeaderText="Source Item Id" UniqueName="SourceItemId"></telerikGridView:GridViewColumn>
<telerikGridView:GridViewColumn HeaderText="Track Id" UniqueName="TrackId"></telerikGridView:GridViewColumn>
<telerikGridView:GridViewColumn HeaderText="Track Type" UniqueName="Track Type" ></telerikGridView:GridViewColumn>

Here is my code to load the radgrid:

ObservableCollection

 

<SoundTrackDetail> obSoundDetails = new ObservableCollection<SoundTrackDetail>();

 

 

//---------------------------------------------------------------------------------
//soundDetails is a List of SoundTrackDetail from a Linq query...
//---------------------------------------------------------------------------------
foreach
(SoundTrackDetail std in soundDetails)

 

{

    //Taking std from Linq results and putting them into an ObservableCollection for binding...
    obSoundDetails.Add(std);

}

radGridSoundDetails.ItemsSource = obSoundDetails;

Again, the rows appear, but there is no data in them.
Class Definition:

 

public

 

class SoundTrackDetail

 

 

 

 

 

{

 

private string _language = string.Empty;

 

 

private int _sourceItemId = 0;

 

 

private int _trackNumber = 0;

 

 

private string _trackType = string.Empty;

 

 

public string Language

 

{

 

get { return _language; }

 

 

set { _language = value; }

 

}

 

public int SourceItemId

 

{

 

get { return _sourceItemId; }

 

 

set { _sourceItemId = value; }

 

}

 

public int TrackNumber

 

{

 

get { return _trackNumber; }

 

 

set { _trackNumber = value; }

 

}

 

public string TrackType

 

{

 

get { return _trackType; }

 

 

set { _trackType = value; }

 

}

}

 



Help???

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 13 May 2009, 05:44 AM
Hi mark,

You need to use GridViewDataColumn instead GridViewColumn. Here is an example:

<telerikGridView:GridViewDataColumn HeaderText="Language" DataMemberBinding="{Binding Language}" />

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
mark
Top achievements
Rank 1
answered on 13 May 2009, 03:30 PM
perfect, thanks.
Tags
GridView
Asked by
mark
Top achievements
Rank 1
Answers by
Vlad
Telerik team
mark
Top achievements
Rank 1
Share this question
or