Paging
-
I am using Visual Studio.NET 2003. i am using datagrid. i want paging to be done in datagrid. i was able to display the 2 records per page.But was not able to go to the second page.How to read the second page.
Mohinder Singh
-
I am using Visual Studio.NET 2003. i am using datagrid. i want paging to be done in datagrid. i was able to display the 2 records per page.But was not able to go to the second page.How to read the second page.
Mohinder Singh
Properties: or Add in Html code AllowPaging : True. PageSize="3" then Use this code in codebehind: --------------------------------- you have to write code in this Event. DataGrid1_PageIndexChanged(): DataGrid1.CurrentPageIndex = e.NewPageIndex DataGrid1.DataSource = dsObj.Tables("Login") DataGrid1.DataBind() if u have any doubts then ask again
-
Properties: or Add in Html code AllowPaging : True. PageSize="3" then Use this code in codebehind: --------------------------------- you have to write code in this Event. DataGrid1_PageIndexChanged(): DataGrid1.CurrentPageIndex = e.NewPageIndex DataGrid1.DataSource = dsObj.Tables("Login") DataGrid1.DataBind() if u have any doubts then ask again
what is dsobj This is what i am doing to pop the records in the grid. Now tell me what to do now. Dim AddDetComm As New SqlCommand("Address_Book_Details", ABCon.Siteconnection) AddDetComm.CommandType = CommandType.StoredProcedure Dim AddDetada As New SqlDataAdapter(AddDetComm) AddDetada.Fill(AddDetDataset) AddressGrid.DataSource = AddDetDataset AddressGrid.DataBind()
Mohinder Singh
-
what is dsobj This is what i am doing to pop the records in the grid. Now tell me what to do now. Dim AddDetComm As New SqlCommand("Address_Book_Details", ABCon.Siteconnection) AddDetComm.CommandType = CommandType.StoredProcedure Dim AddDetada As New SqlDataAdapter(AddDetComm) AddDetada.Fill(AddDetDataset) AddressGrid.DataSource = AddDetDataset AddressGrid.DataBind()
Mohinder Singh
-
hey dear friends please help me out it is not working. i am working on asp.net 2003.
Mohinder Singh
"dsObj" means Dataset object.Pls find the code below follow these steps then u willn't get any problem. 1.Modify connectionString 2.Place u r storedprocedure or Query in place of my Query 3.Fire DataGri1_PageIndexed Change Event and paste my code if u still get any prob then ask me again.This code is working here. .VB(CodeBehind) -------------- Dim conObj As New SqlConnection Dim adpObj As New SqlDataAdapter Dim dsObj As New DataSet Page_Load() ----------- Try conObj = New SqlConnection("Data Source=B4B-2F-323-CK26;user id=sa;password=sa;Database=TEST") conObj.Open() adpObj = New SqlDataAdapter("SELECT * FROM Login", conObj) adpObj.Fill(dsObj, "Login") DataGrid1.DataSource = dsObj.Tables("Login") DataGrid1.DataBind() Catch ex As Exception Response.Write(ex.ToString()) End Try DataGrid1_PageIndexChanged() ---------------------------- DataGrid1.CurrentPageIndex = e.NewPageIndex DataGrid1.DataSource = dsObj.Tables("Login") DataGrid1.DataBind() This will definitly helpful for u Bye :laugh:
-
"dsObj" means Dataset object.Pls find the code below follow these steps then u willn't get any problem. 1.Modify connectionString 2.Place u r storedprocedure or Query in place of my Query 3.Fire DataGri1_PageIndexed Change Event and paste my code if u still get any prob then ask me again.This code is working here. .VB(CodeBehind) -------------- Dim conObj As New SqlConnection Dim adpObj As New SqlDataAdapter Dim dsObj As New DataSet Page_Load() ----------- Try conObj = New SqlConnection("Data Source=B4B-2F-323-CK26;user id=sa;password=sa;Database=TEST") conObj.Open() adpObj = New SqlDataAdapter("SELECT * FROM Login", conObj) adpObj.Fill(dsObj, "Login") DataGrid1.DataSource = dsObj.Tables("Login") DataGrid1.DataBind() Catch ex As Exception Response.Write(ex.ToString()) End Try DataGrid1_PageIndexChanged() ---------------------------- DataGrid1.CurrentPageIndex = e.NewPageIndex DataGrid1.DataSource = dsObj.Tables("Login") DataGrid1.DataBind() This will definitly helpful for u Bye :laugh: