The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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..?
ADAdministrator 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.