FORUMS

c360 Forums
 Home        Members    Calendar    Who's On

Welcome Guest ( Login | Register )
      



No data in gridExpand / Collapse
Message
Posted 4/25/2007 10:42:35 AMPost #1402
 

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie
Hi All,

I'ver followed the exercise 4.3b - building a page dervied from AreaPage and getting the data from the GridData.

If I use the same fetchxml in the grid objgrid.fetchxml then I get data.  If I use this in a fetchdata page I get no griddata, however, the selected tells me 0 of 11 selected.

Any points?

code snippets:

Public Overrides Sub BuildContentArea()

MyBase.BuildContentArea()

' Create an instance of the Grid

Dim objGrid As IGrid = ControlFactory.CreateGrid()

' Name the ID

objGrid.ID = "TestGrid"

objGrid.ReturnedTypeCode = 1

objGrid.SortCol = "fullname"

objGrid.SearchingStyle = SearchingStyles.None

objGrid.ViewsSelectorStyle = ViewsSelectorStyles.None

' objGrid.ShowJumpBar = True

objGrid.FetchDataPage = "AccountsandContacts_DataPage.aspx"

'specify which columns you'd like to show for this search

objGrid.ColumnHeaders.Add(ControlFactory.CreateColumnHeader("Name", "fullname", 200))

'objGrid.ColumnHeaders.Add(ControlFactory.CreateColumnHeader("Phone Number", "telephone1", 200))

'objGrid.ColumnHeaders.Add(ControlFactory.CreateColumnHeader("Notes", "description", 500))

Instance.ContentArea.Controls.Add(objGrid.Control)

End Sub

Public Overrides Sub FetchData()

MyBase.FetchData()

Dim filtervalue = CleanFilterValue(Instance.JumpValue)

' Retrieve all accounts starting with the letter "A"

Dim fetch As String

fetch = "<fetch mapping='logical'><entity name='account'><all-attributes/></entity></fetch>"

Dim strResultSet As String = CrmService.ExecuteFetchXml(fetch)

'map the account field "name" to "fullname" so that all

'(both accounts and contacts) fall under the same column.

strResultSet = strResultSet.Replace("<name>", "<fullname>")

strResultSet = strResultSet.Replace("<name/>", "<fullname/>")

strResultSet = strResultSet.Replace("<name ", "<fullname")

strResultSet = strResultSet.Replace("</name>", "</fullname>")

' Retrieve all contacts having the lastname that starts

Dim fetch2 As String

fetch2 = "<fetch mapping='logical'><entity name='contact'><all-attributes/></entity></fetch>"

Dim strResultSet2 As String = CrmService.ExecuteFetchXml(fetch2)

Me.SortCol = "fullname"

'GridDataPage method to add the results from the fetchXML

AddResultSetToReturn(strResultSet, 1, "accountid")

AddResultSetToReturn(strResultSet2, 2, "contactid")

End Sub

 

Posted 4/25/2007 11:38:34 AMPost #1403
 

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie
OK, its started working;-)

Downloaded 3.0.9.9,

tested the new excercises - ok

..and my code now works

Posted 4/25/2007 11:50:00 AMPost #1404
 

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie
Ignore my previous post,

VB.NET inserts a line calling the base method that is being overridden

i.e

mybase.FetchData()

This appears to be the root of my troubles.  I commented out this line and its OK.

« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: kanika.jackson, Ken Champion

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 7:57am

Powered by InstantForum.NET v4.1.4 © 2009
Execution: 0.203. 11 queries. Compression Enabled.