|
-
Mar 21st, 2005, 05:10 AM
#1
Getting DataTable, the data source, back from a datagrid?
How can I do this:
The code I am playing with is pretty simple.
I have displayed a datatable in my datagrid.
I can see the data perfectly.
I just want to know if I can do something like:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dt As DataTable = CType(MyDataGrid.DataSource, DataTable)
Response.Write(dt.Rows.Count.ToString)
End Sub
Or would I have to store the datatable in the viewstate of the page manually?
Woka
-
Mar 22nd, 2005, 11:38 AM
#2
PowerPoster
Re: Getting DataTable, the data source, back from a datagrid?
not sure about your question, havent tried it.
maybe a session variable or a temp xml file?
-
Mar 22nd, 2005, 12:04 PM
#3
Re: Getting DataTable, the data source, back from a datagrid?
 Originally Posted by Wokawidget
How can I do this:
The code I am playing with is pretty simple.
I have displayed a datatable in my datagrid.
I can see the data perfectly.
I just want to know if I can do something like:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dt As DataTable = CType(MyDataGrid.DataSource, DataTable)
Response.Write(dt.Rows.Count.ToString)
End Sub
Or would I have to store the datatable in the viewstate of the page manually?
Woka
You'd have to use a viewstate. If you're worried about bandwidth though, and the dataset is extremely large, re-bind on each page load.
What are you trying to do though, which made you ask such a wokaic question?
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
|