IE Webcontrols Multipage/Pageview and the Datagrid

R

Ric Houser

Hello All,

Simple question: Is it possible to display a datagrid in
a multipage:pageview? 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
 
J

Jacob Yang [MSFT]

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.
 
G

Guest

Thanks Jacob

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

Thanks
Ric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top