0
votes

I have two textboxes as a Start Date and End Date and one DevExpress GridView with no columns. When Users choose start date and end date and click "Load" I want to create separate GridView column for each date between start and end date. I tried to create columns in my Datatable and just put my Gridview's AutoGenerateColumns to True, but that didn't help. Because I want to set Caption and fieldname manually and besides these Gridview columns need to have Vertical caption. Also I don't know how to create new DataColumn for each date.

any Ideas on how to achive it?

1

1 Answers

0
votes

may be this will help you - http://www.codeproject.com/Articles/13461/how-to-create-columns-dynamically-in-a-grid-view?

DataTable dt = new DataTable();
for loop for every date b/w start and end date
dt.Column.add("date");


//for inserting values into it... use DataRow row = new Datarow;
row["date1"] = xyx;
row["date2"] = abc and so on.....
gridview1.Datasource = dt;