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

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

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

3 Replies

AD Administrator Syncfusion Team December 13, 2006 08:24 AM UTC

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


ED Edijs December 13, 2006 01:49 PM UTC

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


AD Administrator Syncfusion Team December 14, 2006 09:12 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon