Unable to see Category field in WebGrid's Chart

2 replies. Last post: December 30, 2010 2:02 AM by Fung Inter
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
Fung InterMember

Hi,

  I am trying to build a simple Chart for some sample data, but I am not able to see the "category field" in Internet Explorer 8 (as shown in attached file).

  I have changed the the grid's height, but it doesn't work. I wonder if I had missed any step when I am building the grid programmatically, please kindly help.

Below is the code: 

ASPX Page:

<body style="overflow:scroll;">
    <form id="form1" runat="server">
    <div>
        <ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="450px" UseDefaultStyle="True"
		    Width="760px" DefaultStyleMode="Elegant" AllowPivotCharting="True">		
	        <LayoutSettings PagingMode="VirtualLoad">
	        </LayoutSettings>
	        <ChartInteractiveUI>
		        <ShowOrHideRibbon ShowFieldList="True" />
	        </ChartInteractiveUI>
        </ISWebGrid:WebGrid>
    </div>
    </form>
</body>
VB Code:

Public Class TestGrid
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Private Function GenData() As DataTable
        Dim dt As New DataTable
        With dt.Columns
            .Add("Employee")
            .Add("OrderID", GetType(Integer))
            .Add("Income", GetType(Integer))
            .Add("Date", GetType(DateTime))
        End With
        With dt.Rows
            .Add("A", 1, 200, Now.AddDays(1))
            .Add("A", 2, 500, Now.AddDays(2))
            .Add("A", 3, 200, Now.AddDays(3))
            .Add("A", 4, 500, Now.AddDays(4))
            .Add("B", 5, 300, Now.AddDays(5))
            .Add("B", 6, 400, Now.AddDays(1))
            .Add("C", 7, 500, Now.AddDays(2))
            .Add("C", 8, 600, Now.AddDays(3))
        End With

        Return dt
    End Function



    Private Sub WebGrid1_InitializeDataSource(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.DataSourceEventArgs) Handles WebGrid1.InitializeDataSource
        e.DataSource = GenData()
    End Sub

    Private Sub WebGrid1_PrepareDataBinding(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.DataSourceEventArgs) Handles WebGrid1.PrepareDataBinding
        Dim wg As ISNet.WebUI.WebGrid.WebGrid = sender
        If Not wg.IsFlyPostBack Then
            wg.RetrieveStructure()
        End If
    End Sub
End Class

 

Best Regards,

Fung

All times are GMT -5. The time now is 4:42 PM.
Previous Next