Scrolling DataGrid

W

Wasco

Hi All,
somebody knows how can I implement a scrollable datagrid?
I made one used DIV tag and the tricks of a datagrid for title and
another for contents but I'm not satisfied.

Thanks!!
 
G

Guest

Hi,

Insert a div tag inside DataGrid Tag with the following name "div-datagrid"

Declare a Sytle Tag something like this,

<style>
DIV#div-datagrid { OVERFLOW: auto; WIDTH: 420px; HEIGHT: 200px }
.lockrow
{
TOP: expression(document.getElementById("div-datagrid").scrollTop-2);
POSITION: relative;
}
</style>


In ItemDataBound Event of the datagrid,

If e.Item.ItemType = ListItemType.Header Then
For Each MyCell As System.Web.UI.WebControls.TableCell In
e.Item.Cells
MyCell.CssClass = "lockrow"
Next
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top