Wrox Programmer Forums
|
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
 
Old March 30th, 2006, 01:47 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

ds will be blank every time the page is posted back.

 
Old March 30th, 2006, 02:19 AM
Authorized User
 
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it is empty because it is declared as page class member? may i know where should it be declared then?
 
Old March 30th, 2006, 02:22 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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.

 
Old March 30th, 2006, 02:27 AM
Authorized User
 
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
ok. got it working. Thanks. :)
 
Old March 30th, 2006, 12:27 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

How did you get it working?

Thank you,
Richard

 
Old April 2nd, 2006, 10:19 PM
Authorized User
 
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old April 3rd, 2006, 01:13 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

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
 
Old April 3rd, 2006, 08:44 PM
Authorized User
 
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.







Similar Threads
Thread Thread Starter Forum Replies Last Post
how to add color picker in datagrid? param99 ASP.NET 1.0 and 1.1 Professional 1 November 9th, 2006 03:57 AM
Add a Column to a DataGrid infernokodiak C# 7 January 18th, 2006 04:06 PM
How to add rows in DataGrid ? vivekian ASP.NET 1.0 and 1.1 Professional 0 March 13th, 2005 04:30 AM
How to add rows in DataGrid ? vivekian ASP.NET 1.0 and 1.1 Basics 0 March 13th, 2005 04:28 AM
Add records from a Datagrid dkomo VB.NET 0 May 6th, 2004 01:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.