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

Trouble diplaying Entityvalues in Radgrid

4 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Guenni
Top achievements
Rank 1
Guenni asked on 08 Aug 2008, 09:33 PM
Hello peepz,

 I'm using IdeaBlade DevForce as my middle-tier. But I'm founding troubles displaying the values of the records in the Radgrid. It's displaying to correct number of records, but "System.Data.DataRowView" as value for each column. Using a normal ASP.NET gridview I don't encounter any problems.
I also don't have any problems displaying the same EntityList in a RadTreeView.

Do you know what is causing this strange behaviour?
Thanks in advance

Guenni

4 Answers, 1 is accepted

Sort by
0
Sean
Top achievements
Rank 2
answered on 08 Aug 2008, 09:52 PM
Without seeing your code, I would say that you are not binding the column to a field. Forexample:

<telerik:GridBoundColumn UniqueName="DataColumn" 
DataField="BoundFieldName" HeaderText="Some Column Name">
</telerik:GridBoundColumn> 

The DataField property tells the grid what dataset value to display in that column.

Thanks for listening!

Sean
Electroninc Arts, Orlando FL
0
Guenni
Top achievements
Rank 1
answered on 11 Aug 2008, 02:13 PM

Thanks for the reply,

When I drag and drop the Radgrid on my RadPane I can choose the datasourceID by selecting it from the smart tag.
This code is then generated:

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="MyContacts" 
                                    GridLines="None" AutoGenerateColumns="False">  
                                    <MasterTableView DataSourceID="MyContacts">  
                                        <RowIndicatorColumn Visible="False">  
                                            <HeaderStyle Width="20px" /> 
                                        </RowIndicatorColumn> 
                                        <ExpandCollapseColumn Resizable="False" Visible="False">  
                                            <HeaderStyle Width="20px" /> 
                                        </ExpandCollapseColumn> 
                                        <Columns> 
                                            <telerik:GridBoundColumn DataField="Gid" DataType="System.Guid" HeaderText="Gid" 
                                                SortExpression="Gid" UniqueName="Gid" Visible="False">  
                                            </telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn DataField="NameOfContact" HeaderText="NameOfContact" ReadOnly="True" 
                                                SortExpression="NameOfContact" UniqueName="NameOfContact">  
                                            </telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn DataField="Address" HeaderText="Address" ReadOnly="True" 
                                                SortExpression="Address" UniqueName="Address">  
                                            </telerik:GridBoundColumn> 
                                             <telerik:GridBoundColumn DataField="City" HeaderText="City" ReadOnly="True" SortExpression="City" 
                                                UniqueName="City">  
                                            </telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn DataField="PhoneNumber" HeaderText="PhoneNumber" ReadOnly="True" 
                                                SortExpression="PhoneNumber" UniqueName="PhoneNumber">  
                                            </telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn DataField="Email" HeaderText="Email" ReadOnly="True" SortExpression="Email" 
                                                UniqueName="Email">  
                                            </telerik:GridBoundColumn> 
                                           </Columns> 
                                        <EditFormSettings> 
                                            <PopUpSettings ScrollBars="None" /> 
                                        </EditFormSettings> 
                                    </MasterTableView> 
                                </telerik:RadGrid></td>  
 

This is my DataSourceID:

 <cc1:AspDataSource ID="MyContacts" runat="server" 
                        AdapterManagerAssemblyName="Contacts.Web.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" 
                        AdapterManagerTypeName="Guen.Contacts.Web.Model.MyContactsSelectorAdapterManager">  
                    </cc1:AspDataSource> 

I have a ASP.NET GridView in the same RadPane. Via the Smart Tag I selected the same DataSourceID And it displays the correct data.

I don't understand the error since I am binding the columns to their fields.

I'll appreciate your response.

~Guenni~

0
Nikolay Rusev
Telerik team
answered on 12 Aug 2008, 12:29 PM
Hi Guenni,

Unfortunately I cannot tell why this is not working only with the code snippet you have posted.

I suggest you to open a support ticket and create small working project with only the RadGrid using IdeaBlade DevForce as middle-tier. Thus I’ll be able to debug it locally and advice you how to proceed.

Regards,
Nikolay
the Telerik team


Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Guenni
Top achievements
Rank 1
answered on 13 Aug 2008, 10:16 PM
Hello guyz,

After some code changes I solved the problem.The problem was in the returned collection type.
In my Ideablade classlibrary I changed the return syntax.
So instead of
return this.PersistenceManager.GetEntities<MyContacts>(qry); 

I added  .ToArray()  to return a simpler form of collection.

return this.PersistenceManager.GetEntities<MyContacts>(qry).ToArray(); 


Thanks for your feedbacks anywayz.

~Guenni~
Tags
Grid
Asked by
Guenni
Top achievements
Rank 1
Answers by
Sean
Top achievements
Rank 2
Guenni
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Share this question
or