Angela
2/23/2004 3:01:00 PM
Thanks for your reply..
Your code sample got me further than I was able to get thus far, but it still didn't solve my problem. I got scrollbars but they weren't around my DataGrid. They were below my DataGrid. I tried to add my DataGrid control to the HtmlGenericControl, but that makes just the scrollbars appear on the screen and no DataGrid at all
I'll include some of my code in this post so you can see what I'm doing
Create controls
this.dgMyGrid = new DataGrid()
this.divControl = new HtmlGenericControl("div")
this.tblMain = new Table()
this.divControl.Style.Add("width", "550")
this.divControl.Style.Add("height", "400")
this.divControl.Style.Add("overflow", "scroll")
Set up the table
this.tblMain.CellPadding = 2
this.tblMain.CellSpacing = 0
this.tblMain.ID = "tblMain"
this.tblMain.Width = Unit.Pixel(600)
First I tried this: //This makes the scrollbars appear under the DataGri
this.tblMain.Rows[0].Cells[0].Text = " "
this.tblMain.Rows[1].Cells[0].Controls.Add(this.tblHeader)
this.tblMain.Rows[1].Cells[0].Controls.Add(this.dgMyGrid)
this.tblMain.Rows[1].Cells[0].Controls.Add(this.divControl)
this.tblMain.Rows[2].Cells[0].Text = " "
this.Controls.Add(this.tblMain)
Then I tried this: //This makes the scrollbars appear above the DataGri
this.tblMain.Rows[0].Cells[0].Text = " "
this.tblMain.Rows[1].Cells[0].Controls.Add(this.tblHeader)
this.tblMain.Rows[1].Cells[0].Controls.Add(this.divControl)
this.tblMain.Rows[1].Cells[0].Controls.Add(this.dgMyGrid)
this.tblMain.Rows[2].Cells[0].Text = " "
this.Controls.Add(this.tblMain)
Then I tried: //This makes the scrollbars appear but no DataGri
this.divControl.Controls.Add(this.dgMyGrid)
this.tblMain.Rows[0].Cells[0].Text = " "
this.tblMain.Rows[1].Cells[0].Controls.Add(this.tblHeader)
this.tblMain.Rows[1].Cells[0].Controls.Add(this.divControl)
this.tblMain.Rows[2].Cells[0].Text = " "
this.Controls.Add(this.tblMain)