Goodlooking Scrollable DataGrid
-
I am using a DataGrid WebServer Control to historical data to the user. Since their amount of data that the user potentially wants to look at is fairly large I need to use some kind of scrolling technique. Paging simply doesn’t look good enough. I am currently solving this problem by putting a DIV element on the outside of the DataGrid. It works, but it doesn’t look good enough. Anyone who has a better idea about how to solve this problem? Rickard
-
I am using a DataGrid WebServer Control to historical data to the user. Since their amount of data that the user potentially wants to look at is fairly large I need to use some kind of scrolling technique. Paging simply doesn’t look good enough. I am currently solving this problem by putting a DIV element on the outside of the DataGrid. It works, but it doesn’t look good enough. Anyone who has a better idea about how to solve this problem? Rickard
You are correct. Using DIV, when you scroll down, the column names also scroll. the other way is to have column header outer to the Grid..and have constant width to each of the column. Here you need to set AutoGenerate columns to false and include all columns and respective widths in the data grid. you can refer to this article : http://www.dnzone.com/showDetail.asp?TypeId=2&NewsId=564
-
You are correct. Using DIV, when you scroll down, the column names also scroll. the other way is to have column header outer to the Grid..and have constant width to each of the column. Here you need to set AutoGenerate columns to false and include all columns and respective widths in the data grid. you can refer to this article : http://www.dnzone.com/showDetail.asp?TypeId=2&NewsId=564
Thanks. I can't do this however since the the number of columns and the column headers are unknown at design time. They are generated in run-time based on user interaction. Or is there a way to add columns to the datagrid programmatically in run time? Have to look into this... Rickard
-
Thanks. I can't do this however since the the number of columns and the column headers are unknown at design time. They are generated in run-time based on user interaction. Or is there a way to add columns to the datagrid programmatically in run time? Have to look into this... Rickard
Depending on how dynamic your SQL is, one of the things you can consider is to create the crid with the maximum columns. Then at run time you dynamically make the appropriate columns visible. If your SQL is really dynamic, it just makes it a little more work set up the SQL to bring back a column like ["" as ColumnName] as a place holder for some of the invisible columns. It isn't something that should be really difficult to do, it will just be a bit tedious.
-
Depending on how dynamic your SQL is, one of the things you can consider is to create the crid with the maximum columns. Then at run time you dynamically make the appropriate columns visible. If your SQL is really dynamic, it just makes it a little more work set up the SQL to bring back a column like ["" as ColumnName] as a place holder for some of the invisible columns. It isn't something that should be really difficult to do, it will just be a bit tedious.