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.
Unfortunately, activation email could not send to your email. Please try again.

GridControl''s and GridDataBoundControl''s GridModel property differences

Thread ID:

Created:

Updated:

Platform:

Replies:

53326 Dec 12,2006 05:43 AM Dec 14,2006 04:12 AM Windows Forms 3
loading
Tags: GridControl
Edijs
Asked On December 12, 2006 05:43 AM

Hi!

For example, if mentioned two controls contain 10 rows (including header row), GridControl.Model.RowCount returns 10, but GridDataBoundControl.Model.RowCount returns 9.

Please advice!

Thanks,
Edijs

Administrator [Syncfusion]
Replied On December 13, 2006 03:24 AM

Hi Edijs,
Could you please show me the difference in this sample?
GC_GDBG_GridModel.zip
Thanks,
Jeba.

Edijs
Replied On December 13, 2006 08:49 AM

Hi Jeba,

Problem is that Model.RowCount returns number of rows excluding Header column.
BUT when you want to get last record of GridDataBoundControl like X.Model[X.Model.RowCount - 1] you will not get the last, but last - 1 record.

In other words problem is that Model indexer is taking into account Header row. In that case shouldn't it return Actual record count + Header row as Mmodel.RowCount ?

Thanks,
Edijs

Administrator [Syncfusion]
Replied On December 14, 2006 04:12 AM

Hi Edijs ,

The gridDataBound.Model.RowCount will include the AddNew row if you have one so it might be 1 more than the number of rows in the DataTable. The AddNew row does not have a record associated with it until it is actually added.

Please refer to the following forum thread for more details.
RowCount : http://www.syncfusion.com/support/forums/message.aspx?&MessageID=15489
Grid Last Row: http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=28914

Best Regards,
Haneef

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.

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.

;