We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Reg :griddatabound Control

Hi, This is the code i am using in my application. [sgbDetailedHistory =griddataboundcontrol] this.sgbDetailedHistory.DataSource = dvLatestHistory; Nothing much i am adding new row. This is my btn click event. private void btnInsertRow_Click(object sender, System.EventArgs e) { DataTable dt = dvLatestHistory.Table.Copy(); DataRow dr = dt.NewRow(); dr["ASSET_ID"] = dvLatestHistory[0]["ASSET_ID"]; dr[historyDateColumn] = Convert.ToDateTime(dvLatestHistory[0][historyDateColumn]).AddDays(1); dt.Rows.Add(dr); dvLatestHistory = new DataView(dt); dvLatestHistory.Sort = "HISTORY_DATE DESC"; this.sgbDetailedHistory.Model.RowCount = 11; this.FillDetailedHistory(dvLatestHistory); } Q1 : i am not able to set row count...as 11..Why..?

1 Reply

AD Administrator Syncfusion Team July 18, 2005 08:51 AM UTC

You cannot set a RowCount in a GridDataBoundGrid. The number of rows in the grid is determined by the number of rows in the datasource. So, if you add a row to your datasource, it should just show up in the grid. In a GridDataBoundGrid, the grid just displays what is in the datasource. You can add unboundColumns in a straight-forward manner by adding GridBoundColumns with a MappingName that is not in the datasource, but adding unbound rows is harder. Now if you want to add an unbound row, you can. But you do have to use grid.Model.QueryRowCount to provide the rowcount, and you do have to use grid.Model.QueryCellInfo to provide the values.

Live Chat Icon For mobile
Up arrow icon