 |
| ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

March 30th, 2006, 01:47 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
ds will be blank every time the page is posted back.
|
|

March 30th, 2006, 02:19 AM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
it is empty because it is declared as page class member? may i know where should it be declared then?
|
|

March 30th, 2006, 02:22 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
it would have to be rebuilt each time in the page load. Just add the ds and or dt to the session variable in the button click before you bind the grid.
|
|

March 30th, 2006, 02:27 AM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
ok. got it working. Thanks. :)
|
|

March 30th, 2006, 12:27 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
|
|
How did you get it working?
Thank you,
Richard
|
|

April 2nd, 2006, 10:19 PM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by rstelma
How did you get it working?
Thank you,
Richard
|
Hi Richard,
added the session save statemetn after the add button:
Private Sub bAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim tRow As DataRow
Dim itmArr() As Object = {tText1.Text, tText2.Text, tText3.Text}
tRow = dt.NewRow()
tRow.ItemArray = itmArr
dt.Rows.Add(tRow)
ds.Tables.Add(dt)
Bindgrd()
Session(SesDs) = ds
End Sub
|
|

April 3rd, 2006, 01:13 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hii Annsary!!
Congrates for you got the solution
Session -specific to the user wise,accessible by specific user wise in the application domain
Cookies -specific to the user wise,accessible by specific user wise in the application domain
Cache- object specific to the application,accessible by any user or page in the application domain
Application- object specific to the application,accessible by any user or page in the application domain
So if the datagrid's contents is related with all the user ,its better to use with Cache Object.
Hope this will help you.
Cheers :)
vinod
|
|

April 3rd, 2006, 08:44 PM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
HiVinod,
Thanks.
Now i am facing another new challenge. i am using .net VS2003 with v1.1 framework
instead of using dataset, i used the dataview as the datasource.
gdataGrid.DataSource = ds.Tables(0).defaultview
so that i can do sorting easily. Now i wish to hide one of the column in the datagrid. the data grid has edit and delete column followed by the view's column which consist of No, Item, Desc, etc.
I wish to hide the 'No' column. when i specifiy,
gdataGrid.DataSource = ds.Tables(0).defaultview
gdataGrid.DataBind()
gdataGrid.Columns("No").Visible = False
the above statement gives error and when i checked, the gdataGrid.columns().count gives only 2 (the Edit and the Delete columns). somehow, the columns in the dataviews are not be recognised. how to make the datagrid recognize the columns from the dataview?
I tried using the datagridtablestyle, but the datagridtablestyle is also not recognised by the editor.
pls help....
Thanks.
|
|
 |