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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Reg :griddatabound Control

Thread ID:

Created:

Updated:

Platform:

Replies:

31882 Jul 18,2005 06:09 AM UTC Jul 18,2005 08:51 AM UTC WinForms 1
loading
Tags: GridControl
Anna Srinivasan
Asked On July 18, 2005 06:09 AM UTC

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..?

Administrator [Syncfusion]
Replied On 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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;