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

radgrid takes wrong class attributes

1 Answer 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ronald Kamp
Top achievements
Rank 1
Ronald Kamp asked on 05 May 2010, 10:27 AM
Hi
I'm having trouble getting the right data in my radgrid. I am working with an asp.net webapplication with C# and a WCF webservice. This webservice returns me a list of values which I have to put in class so I can show them in my radgrid. The problem is that the radgrid gets the wrong attributes. Can somebody take a look at this code and tell me what I'm doing wrong? Here's my code:

codebehind (c#):
foreach (string key in keys) { 
if (lijst.TryGetValue(key, out value)) { 
        properties.Add(new VO_ObjectPropertyHelper(key,value[0],value[1])); 
      } 
 
rgProperties.DataSource = properties; 
rgProperties.MasterTableView.DataSource = properties; 
 

VO_ObjectHelper class:
public partial class VO_ObjectPropertyHelper { 
        public string propID { getset; } 
        public string name { getset; } 
        public string value { getset; } 
 
        public VO_ObjectPropertyHelper(string _propID, string _name, string _value) { 
            this.propID = _propID; 
            this.name = _name; 
            this.value = _value; 
        } 
    } 


webpage:
<telerik:RadGrid ID="rgProperties" runat="server" AutoGenerateColumns="False" GridLines="None" AllowSorting="True" ShowHeader="false" Skin="Vista"
    <mastertableview> 
        <RowIndicatorColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
        </RowIndicatorColumn> 
        <ExpandCollapseColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
        </ExpandCollapseColumn> 
        <Columns> 
            <telerik:GridBoundColumn DataField="name" HeaderText="Meter Eigenschappen" SortExpression="name" UniqueName="name" >                
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="value" HeaderText="" SortExpression="value" UniqueName="value"
            </telerik:GridBoundColumn> 
        </Columns> 
    </mastertableview> 
</telerik:RadGrid> 
 

1 Answer, 1 is accepted

Sort by
0
Ronald Kamp
Top achievements
Rank 1
answered on 05 May 2010, 10:55 AM
found the mistake, stupid actually, switched some values Sorry /facepalm
Tags
Grid
Asked by
Ronald Kamp
Top achievements
Rank 1
Answers by
Ronald Kamp
Top achievements
Rank 1
Share this question
or