WebGrid: First Row Missing in GRID

1 reply. Last post: October 18, 2010 11:54 AM by Handy Surya
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

Hello Intersoft


Here is how i populated my WebGrid:


    Protected Overrides Sub OnLoadComplete(ByVal e As System.EventArgs)
        MyBase.OnLoadComplete(e) 
Dim connStr As String connStr = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=" & Server.MapPath("../../../Data/Mymdb.mdb")

Dim conn As New OleDbConnection(connStr) conn.Open() Dim sql As String sql = "SELECT * FROM MyTable" Dim cmd As New OleDbCommand(sql, conn) Dim myDataReader As OleDbDataReader myDataReader = cmd.ExecuteReader() myDataReader.Read() MyGRID.DataSource = myDataReader DataBind() myDataReader.Close() conn.Close() End Sub

And here my Grid:

<ISWebGrid:WebGrid ID="MyGRID" runat="server" Height="500px" 
                UseDefaultStyle="True" Width="100%" DefaultStyleMode="Elegant">
                <RootTable DataKeyField="lfdNr">
                    <Columns>
                        <ISWebGrid:WebGridColumn Caption="XY" DataMember="XY" 
                            Name="XY" Width="100px">
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="Nr." DataMember="lfdNr" 
                            Name="lfdNr" Width="100px">
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="XYY" DataMember="XYY" Name="XYY" 
                            Width="100px">
                        </ISWebGrid:WebGridColumn>
                        <ISWebGrid:WebGridColumn Caption="XYYY" DataMember="XYYY" 
                            Name="XYYY" Width="100px">
                        </ISWebGrid:WebGridColumn>                      
                </Columns> </RootTable> </ISWebGrid:WebGrid>



This works fine but the first row is missing, in every grid (see attachment)

e.g. 156 rows loaded but in my access database are 157 rows.


How could I solve this problem?

1 attachment
All times are GMT -5. The time now is 8:43 PM.
Previous Next