Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > IE Webcontrols Multipage/Pageview and the Datagrid

Reply
Thread Tools

IE Webcontrols Multipage/Pageview and the Datagrid

 
 
Ric Houser
Guest
Posts: n/a
 
      11-05-2003
Hello All,

Simple question: Is it possible to display a datagrid in
a multipageageview? It seems that all asp controls
(asp:checkbox, asp:listbox...) will work fine on a
pageview. However the asp:datagrid or asp:repeater
controls don't seem to work. Any help would be greatly
appricated.

Ric
 
Reply With Quote
 
 
 
 
Jacob Yang [MSFT]
Guest
Posts: n/a
 
      11-06-2003
Hi Ric,

I tried the following code on my side and it worked fine. In my code, I
dynamically added to pageviews to the MultiPage web control, and on the
first pageview, I added a TextBox and on the second pageview, I added a
DataGrid.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here

Dim pv As PageView = New PageView
MultiPage1.Controls.Add(pv)

Dim txt As TextBox = New TextBox
txt.ID = "text1"
txt.Text = "Miranda"

pv.Controls.Add(txt)

Dim DataGrid1 As DataGrid = New DataGrid
DataGrid1.DataSource = CreateDataSource()
DataGrid1.DataBind()

Dim pv2 As PageView = New PageView
MultiPage1.Controls.Add(pv2)

pv2.Controls.Add(DataGrid1)

MultiPage1.SelectedIndex = 1

End Sub

Function CreateDataSource() As ICollection
Dim dt As New DataTable
Dim dr As DataRow

dt.Columns.Add(New DataColumn("IntegerValue", GetType(Int32)))
dt.Columns.Add(New DataColumn("StringValue", GetType(String)))
dt.Columns.Add(New DataColumn("CurrencyValue", GetType(Double)))

Dim i As Integer
For i = 0 To 8
dr = dt.NewRow()

dr(0) = i
dr(1) = "Item " + i.ToString()
dr(2) = 1.23 * (i + 1)

dt.Rows.Add(dr)
Next i

Dim dv As New DataView(dt)
Return dv
End Function 'CreateDataSource

If I have misunderstood you concern, please feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ĘC www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      11-07-2003
Thanks Jacob

Don't know what I was leaving out before, but everything
seems to work fine now.

Thanks
Ric
>-----Original Message-----
>Hi Ric,
>
>I tried the following code on my side and it worked

fine. In my code, I
>dynamically added to pageviews to the MultiPage web

control, and on the
>first pageview, I added a TextBox and on the second

pageview, I added a
>DataGrid.
>
>Private Sub Page_Load(ByVal sender As System.Object,

ByVal e As
>System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
>
> Dim pv As PageView = New PageView
> MultiPage1.Controls.Add(pv)
>
> Dim txt As TextBox = New TextBox
> txt.ID = "text1"
> txt.Text = "Miranda"
>
> pv.Controls.Add(txt)
>
> Dim DataGrid1 As DataGrid = New DataGrid
> DataGrid1.DataSource = CreateDataSource()
> DataGrid1.DataBind()
>
> Dim pv2 As PageView = New PageView
> MultiPage1.Controls.Add(pv2)
>
> pv2.Controls.Add(DataGrid1)
>
> MultiPage1.SelectedIndex = 1
>
> End Sub
>
>Function CreateDataSource() As ICollection
> Dim dt As New DataTable
> Dim dr As DataRow
>
> dt.Columns.Add(New DataColumn("IntegerValue",

GetType(Int32)))
> dt.Columns.Add(New DataColumn("StringValue",

GetType(String)))
> dt.Columns.Add(New DataColumn("CurrencyValue",

GetType(Double)))
>
> Dim i As Integer
> For i = 0 To 8
> dr = dt.NewRow()
>
> dr(0) = i
> dr(1) = "Item " + i.ToString()
> dr(2) = 1.23 * (i + 1)
>
> dt.Rows.Add(dr)
> Next i
>
> Dim dv As New DataView(dt)
> Return dv
> End Function 'CreateDataSource
>
>If I have misunderstood you concern, please feel free to

let me know.
>
>Best regards,
>
>Jacob Yang
>Microsoft Online Partner Support
>Get Secure! ĘC www.microsoft.com/security
>This posting is provided "as is" with no warranties and

confers no rights.
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a System.Web.UI.WebControls.Panel to a DataGrid Cell kito ASP .Net 2 09-10-2006 07:33 PM
Object reference not set to an instance of an object. System.Web.UI.WebControls.ListItemCollection.SaveViewState() System.Web.UI.WebControls.ListControl.SaveViewState() Brano ASP .Net 3 11-08-2005 12:29 PM
Using DataViewManager with a WebControls.DataGrid martyn_wynne@hotmail.com ASP .Net Building Controls 1 06-20-2005 06:36 PM
WebControls.DataGrid Martin Dew ASP .Net 1 07-24-2004 03:15 AM
webcontrols.datagrid problem... EMW ASP .Net 5 04-19-2004 09:11 PM



Advertisments