473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

paging problem in editable datagrid

Hello every one

I am using editable datagrid in my application. I set grid's allowpaging property to true. My application is not working properly. When I click on 'Edit' to modify any row, instead of making the row editable for user, PageIndexChanged event is fired and grid's current page is changed. When I click on next/previous page my current page is not chaning. Can any body help me what to do. My complete code is as under

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loa
'Put user code to initialize the page her
loadgrid(
If Not Page.IsPostBack The
dgdata.CurrentPageIndex =
End I
End Su

Sub loadgrid() 'this sub is to create the grid at runtime
Dim com As New SqlCommand(
Dim da As New SqlDataAdapter("select * from tblissue", mycon
Dim ds As New DataSet(
Dim dc As New BoundColumn(
Dim ea As New EditCommandColumn(
Dim i As Int3

da.Fill(ds, "tblissue"

dgdata.AutoGenerateColumns = Fals
dgdata.AllowPaging = Tru
dgdata.PagerStyle.Mode = PagerMode.NextPre

dgdata.PageSize =

dgdata.DataSource = ds.Tables("tblissue"
ea.ButtonType = ButtonColumnType.LinkButto
ea.EditText = "edit
ea.UpdateText = "update
ea.CancelText = "cancel

dgdata.Columns.Add(ea
For i = 0 To ds.Tables("tblissue").Columns.Count -
dc.DataField = ds.Tables("tblissue").Columns(i).ColumnNam
dc.HeaderText = ds.Tables("tblissue").Columns(i).Captio
dgdata.Columns.Add(dc
If (ds.Tables("tblissue").Columns(i).ColumnName = "solved") Or (ds.Tables("tblissue").Columns(i).ColumnName = "expecteddate") Or (ds.Tables("tblissue").Columns(i).ColumnName = "expectedtime") The
dc.Visible = False 'to hide date/time colum
End I
If ds.Tables("tblissue").Columns(i).ColumnName = "issueid" Then dc.ReadOnly = True ' to lock ID colum
dc = New BoundColumn(
Nex
dgdata.DataBind(
End Su

'following sub is called in pageindexchanged event fire
Sub newpage(ByVal sender As Object, ByVal objArgs As DataGridPageChangedEventArgs
dgdata.EditItemIndex = -1
dgdata.CurrentPageIndex = objArgs.NewPageInde
End Su

Sub editdg_EditCommand(ByVal source As Object, ByVal e As DataGridCommandEventArgs
dgdata.EditItemIndex = e.Item.ItemInde
dgdata.DataBind(
End Su

Sub canceldg_CancelCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles dgdata.CancelComman
dgdata.EditItemIndex = -
dgdata.DataBind(
End Su

Plz guide m
Shail.
Nov 22 '05 #1
0 1196

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Shail | last post by:
Hello every one I am using editable datagrid in my application. I set grid's allowpaging property to true. My application is not working properly. When I click on 'Edit' to modify any row, instead...
2
by: RelaxoRy | last post by:
sqlConnection1.Open(); myReader = sqlCommand1.ExecuteReader(); DataGrid1.DataSource = myReader; DataGrid1.DataBind(); myReader.Close(); sqlConnection1.Close(); The Datagrid populates fine. ...
2
by: enak | last post by:
I can not get my datagrid to page. I have a datagrid that I can sort 2 of the columns. This works great. I added paging and when I display the dg it shows 5 pages. (I am showing page numbers at...
2
by: RJN | last post by:
Hi Sorry for posting again. I have a datagrid which is put inside a div tag to make it scrollable. I need to page the datagrid. The page numbers appear at the bottom of the datagrid and has...
6
by: Shawn | last post by:
Hi. I already have a datagrid where I'm using paging. I have a stored procedure that fills a temp table with 200-500 rows and then sends back 10 records at the time. When I go to page 2 the SP...
2
by: asad | last post by:
Hello friends, i am designing a ASP.NET page where i want to use custom paging bcoz data is too heavy so pls tell me how can i use custom paging in ASP.NET Thanks
2
by: Axel Dahmen | last post by:
Hi, I'm using a DataGrid control to show a table's content with paging. For navigation through the pages I'm using the DataGrid's intrinsic navigation section. My problem: The DataGrid...
0
by: Pat | last post by:
I have 3 Datagrid nested. Master Details Child The master has paging (And i'm using the paging inbuilt in the Datagrid) in the Master DataGrid you select a linkbutton(using commandname) and it...
2
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a...
5
by: Donald Adams | last post by:
Hi, I will have both web and win clients and would like to page my data. I could not find out how the datagrid control does it's paging though I did find some sample code that says they do it...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.