Hi All,
Check this....
[code=vbnet]
Public Sub CreateNewRow()
Dim index As Integer
index = StatusGrid.Item s.Count
Dim da As New SqlDataAdapter
conn.Open()
da = New SqlDataAdapter( "select * from Status", conn)
'New Row Creation
da.Fill(dt)
dt.Rows.Add(dt. NewRow)
'dt.Rows.Insert At(dt.NewRow(), index)
StatusGrid.Edit ItemIndex = index
dt.AcceptChange s()
StatusGrid.Data Source = dt
StatusGrid.Data Bind()
conn.Close()
End Sub[/code]
With this code, I got new row in the datagrid.
But the problem Occurs, When the pagesize exceeds.
Here I have given pagesize as 10.
Assume there is 10 rows.Now When AddNewRow button is clicked, I should get new row in next page.(Total 11 rows).10 in first page and the new row in next page.
How can I get this?
Thanks in Advance...
Check this....
[code=vbnet]
Public Sub CreateNewRow()
Dim index As Integer
index = StatusGrid.Item s.Count
Dim da As New SqlDataAdapter
conn.Open()
da = New SqlDataAdapter( "select * from Status", conn)
'New Row Creation
da.Fill(dt)
dt.Rows.Add(dt. NewRow)
'dt.Rows.Insert At(dt.NewRow(), index)
StatusGrid.Edit ItemIndex = index
dt.AcceptChange s()
StatusGrid.Data Source = dt
StatusGrid.Data Bind()
conn.Close()
End Sub[/code]
With this code, I got new row in the datagrid.
But the problem Occurs, When the pagesize exceeds.
Here I have given pagesize as 10.
Assume there is 10 rows.Now When AddNewRow button is clicked, I should get new row in next page.(Total 11 rows).10 in first page and the new row in next page.
How can I get this?
Thanks in Advance...
Comment