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

Get row data bound

1 Answer 169 Views
GridView
This is a migrated thread and some comments may be shown as answers.
rizk
Top achievements
Rank 1
rizk asked on 24 Nov 2009, 02:29 PM
 Hi,
I am trying to bind a list of the following complex type to a RadGridView
public interface IEntity

    string FullClassName { get; set; } 

    .     
    . 
    . 
    . 

    List<Property> Properties { get; set; }
}
 
public class Property

    public string Name { get; set; } 
    . 
    . 
    . 
}
As you can see here that the IEntity interface contains a list of Property type, so for now I need to bind a list of IEntity to a radGrid and bind the inner list(Properties list) to a combo box cell.
Actually I did all the required steps to let the grid bind to the list, but the combo box is always displaying the type of the properties list (namespace.Peoperties…).
So I replaced the radGrid with a dataGrid and did the following

for (int i = 0; i < this.radGridEntities.Rows.Count; i++)

    DataGridViewComboBoxCell dgcb = (DataGridViewComboBoxCell)this.radGridEntities [this.radGridEntities.Columns["Title"].Index,i]; 
    dgcb.DataSource = ((IEntity)this.radGridEntities.Rows[i].DataBoundItem).Properties; 
    dgcb.DisplayMember = "Name";
}
As I show here, I loop over each row and set its data source, now, I need to retreive each cell to set it is data source while using RadGridView(as I am showing here while using windows dataGridView. 
any idea would be appreciated 

Thank you in advance

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 27 Nov 2009, 03:07 PM
Hi rizk,

Currently, RadGridView does not support setting a DataSource at a cell level. Therefore, your scenario requires some custom implementation. The approach is demonstrated in this forum post.

Should you have additional questions, feel free to contact me.

Sincerely yours,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
rizk
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or