|
-
Jun 7th, 2005, 12:10 AM
#1
Thread Starter
Member
datagrid with template column
Hi,
I have datagrid in my web form(code behind VB.Net).In that i have template coloumn with textbox.whenever i moved to next page and previous page,the data which entered in textbox not visible.i have written databind in form load. can any body give me solution
Thanks
satish
-
Jun 7th, 2005, 01:20 AM
#2
Re: datagrid with template column
Move to next page and previous page, do you mean Paging? If so make sure you are rebinding the DataGrid in PageIndexChanged event...
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Jun 7th, 2005, 01:30 AM
#3
Thread Starter
Member
Re: datagrid with template column
Yes im doing this on pageindex change
dg.CurrentPageIndex = e.NewPageIndex
dg.DataBind()
After writing something on textbox in page one,if go for next and previous the text in textbox not visible.I enable the viewstate also..but same problem.
-
Jun 7th, 2005, 05:05 AM
#4
Re: datagrid with template column
 Originally Posted by dgsatish
Yes im doing this on pageindex change
dg.CurrentPageIndex = e.NewPageIndex
dg.DataBind()
After writing something on textbox in page one,if go for next and previous the text in textbox not visible.I enable the viewstate also..but same problem.
How/where are you defining DataSource for dg?
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Jun 7th, 2005, 05:52 AM
#5
Thread Starter
Member
Re: datagrid with template column
this is im doing in form load
Dim ds As New DataSet
Dim da As New SqlDataAdapter(strsql, objcon)
da.Fill(ds, "user_verint")
dg.DataSource = ds.Tables("user_verint").DefaultView
If (ds.Tables("user_verint").Rows.Count <> 0) Then
If (Not IsPostBack) Then
dg.DataBind()
End If
Else
Response.Redirect("NoRecords.aspx")
End If
-
Jun 7th, 2005, 01:38 PM
#6
Re: datagrid with template column
VB Code:
'put this on PageLoad
If Not(Page.IsPostBack) then
BindGrid()
End If
'Put this in dg_PageIndexChanged
dg.CurrentPageIndex = e.NewPageIndex
BindGrid()
Private sub BindGrid()
Dim ds As New DataSet
Dim da As New SqlDataAdapter(strsql, objcon)
da.Fill(ds, "user_verint")
dg.DataSource = ds.Tables("user_verint").DefaultView
If (ds.Tables("user_verint").Rows.Count <> 0) Then
dg.DataBind()
End If
End Sub
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Jun 8th, 2005, 03:07 AM
#7
Thread Starter
Member
Re: datagrid with template column
Post back and page index change i am doing but my problem is
I have datagrid in my web form(code behind VB.Net).In that i have template coloumn with textbox.I enterd some text in textbox and moved to next records.when i come back pressing previous link,i am not finding the text which was enterd previously.
-
Jun 8th, 2005, 03:47 PM
#8
Re: datagrid with template column
You wont, whenever you navigate to a new page, all values you have entered will be lost unless you store it or save it to the database..
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|