You cannot automatically do this asp.net. You need to convert / collapse your data into the form you need. This is also called a crosstab message.
There are several options:
DIY - Scroll through the lines in the source data and manually convert them.
Make a core in SQL Server. Here is a simple example for SO.
, . Devexpress asp.net pivottable contro . . , .