How to display a Tooltip when hovering over the Header sort link of the DataGrid

Protected Sub ItemDB(sender As Object, e As System.Web.UI.WebControls.DataGridItemEventArgs) Dim i As Integer For i = 0 To e.Item.Cells.Count – 1 e.Item.Cells(i).ToolTip = ‘This is Column ‘ + i.ToString() Next End Sub ’ItemDB C# protected void ItemDB (object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { for(int i=0 ;i<= e.Item.Cells.Count -1;i++) { e.Item.Cells[i].ToolTip = ‘This is Column ‘ + i.ToString(); } }

Why do I get System.Data.DataRowView/System.Data.Common.DbDataRecord as the item in a dropdownlist

This is probably because you have not set the DataTextField/ DatavalueField property of the dropdownlist. VB.NET ’.. DropDownList1.DataSource = ds.Tables(0) DropDownList1.DataTextField = ‘CategoryName’ DropDownList1.DataValueField = ‘CategoryId’ DropDownList1.DataBind() C# //.. DropDownList1.DataSource =ds.Tables[0]; DropDownList1.DataTextField = ‘CategoryName’; DropDownList1.DataValueField = ‘CategoryId’; DropDownList1.DataBind();

How can I fix error message ‘Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount'

There are two approaches to fix this error: Set the CurrentPageIndex = 0 when you bind data in the Page_EventHandler Allow the error to occur and then catch it in a try block resetting the index to 0 and rebinding the grid VB.NET try ’Bind the Data catch ex as ArgumentOutOfRangeException DataGrid1.CurrentPageIndex = 0; ’Bind the Data end try C# try { //Bind the Data } catch(ArgumentOutOfRangeException ex ) { DataGrid1.CurrentPageIndex = 0; //Bind the Data }