When we were developing, we must encounter with DataGrid because they don't want to page (there are not so many), but also display is not in a page. At this time, there will be a scroll bar in DataGrid, you can scroll down the data inside DataGrid without Up and down scrolling page, since the purpose of writing this article is to illustrate how it is implemented, the reader can think about the completion of the detailed problem reader (such as:: To scroll, etc.). In order to scroll to DataGrid, we need a Table scrolling JS script that allows the client (the JS code. I downloaded from the CodeProject), but I can't scroll the topic of Table (that is, the first line). We all know that DataGrid will generate a table after explaining the client, but this table is composed of
To do this we need to rewrite the method of pre-rendering: protected override void OnPreRender (System.EventArgs e) {base.OnPreRender (e); ResourceManager manager = new ResourceManager (this.GetType ()); ResourceSet resources = manager.GetResourceSet (System.Globalization.CultureInfo.CurrentCulture, true, true); if (Page.IsClientScriptBlockRegistered ( "SkySword.WebControl.PowerDataGrid Library")!) {String script = resources.GetString ( "ScrollTable"); this.Page.RegisterClientScriptBlock ( "SkySword.WebControl.PowerDataGrid Library", script); this.Page.RegisterStartupScript ( "SkySword.WebControls.PowerDataGrid Init", "