---
title: "How to bind List<T> data in devexpress XtraGrid control?"  
description: "How to bind List<T> data in devexpress XtraGrid control?"  
author: "Anonymous User"  
published: 2012-06-13  
updated: 2012-06-13  
canonical: https://www.mindstick.com/forum/421/how-to-bind-list-t-data-in-devexpress-xtragrid-control  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How to bind List<T> data in devexpress XtraGrid control?

Hello,

I want to [bind data](https://www.mindstick.com/forum/415/how-to-bind-data-in-windows-phone-7-using-wcf-service) in [devexpress grid](https://www.mindstick.com/forum/1436/how-to-get-single-click-event-on-image-in-column-of-devexpress-grid-control-using-wpf) [control](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control) through generic list.\
Can [anyone explain](https://www.mindstick.com/forum/34220/can-anyone-explain-me-about-off-page-activity) me how can I acheive this [task](https://www.mindstick.com/forum/161761/what-is-the-difference-between-task-and-thread)?

Thanks.

## Replies

### Reply by Chris Anderson

hi,\
\
you can achieve this task by using the code given below:\
\
Fisrt step: Create a class and add some properties:\
\
public class Sample\
{\
public string Name { get; set; }\
public int Age { get;set; }\
}\
\
Second step: Add some sample [data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) in the list\
\
using System.Collections;\
\
List<Sample> list =new List<Sample>();\
\
list.Add( new Sample\
{\
Name="Rohit",\
Age=20\
});\
\
list.Add( new Sample\
{\
Name="Rohit",\
Age=20\
});\
\
Third Step: Bind list as datasource of gridcontrol.\
\
gridControl1.DataSource = list;\
\
Note:You also have to add the two fields in [devexpress](https://www.mindstick.com/forum/34326/fill-devexpress-gridview-with-list) gridview and provide the FieldName of column as name of the property. \
\
\
\


---

Original Source: https://www.mindstick.com/forum/421/how-to-bind-list-t-data-in-devexpress-xtragrid-control

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
