I want to bind a datasource in XtraGrid
control but I am not able to do it. The problem is that I have created columns in XtraGrid
at design time and I am binding records at run time using a user defined collection.
I created four columns in the XtraGrid
at design time. First one is a CheckBox
type, second and third one is Default
and last one is Button
type.
I created a structure in my program:
public struct Test
{
public bool IsSelect{get; set; }
public string First{get; set; }
public string Second {get; set;}
}
Then I created a List<Test>
collection which contains 10 Test type record.
For binding I wrote the following code:
grid1.DataSource = userList;
Now I want to bind this record in XtraGrid control. IsSelect
property should be bound with the CheckBox
column and the remaining two properties will bind with the second and third columns.
Is it possible in XtraGrid?
I am using Visual Studio 2010 with .NET Framework 3.5 and C# language.