Monday, August 16, 2010

Help - Dynamic Datagrid ASP.NET C#?

Hi,





I'm new to ASP.NET. I want to create a dynamic datagrid based from MS SQL select statement.





The thing is i want those data to produce like below grid.





Date..............Jim...Bond...Kelly


01/01/2005...2.2....1.9......2.2


02/01/2005...2.1....1.8......2.1





The word ';Jim, Bond, Kelly and many more'; are dynamically from SQL statement. So it's like the header is dynamic word.





All are dynamic data except the word ';Date';. Another thing, i want the grid table to be separate when they reach 4 column and proceed next column at bottom of the grid or can say another grid. Example:





Date..............Jim...Bond...Kelly


01/01/2005...2.2....1.9......2.2


02/01/2005...2.1....1.8......2.1





Date..............James...Charley...Wh鈥?br>

01/01/2005.....2.2..........1.9.......鈥?br>

02/01/2005.....2.1..........1.8.......鈥?br>




PLEASE HELP ME.





I have no idea on how to do this.





*** The datagrid i specify above is not showing correctly after post the question. Not sure y***Help - Dynamic Datagrid ASP.NET C#?
In order to get the dynamic column headers, you just set your DataGrid to auto-generate columns. Your SQL will return the column headers and the DataGrid will populate them.





With regard to splitting the grid after 4 columns, you aren't going to be able to do this with one grid. You would need to break up the data and feed each set to its own DataGrid.





Good luck!

No comments:

Post a Comment