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

ShowRecordPreviewRow

Is there anyway to not show this for rows that have no data to be displayed in the preview? I am filling this in the QueryCellStyleInfo event and would like to not show it for rows that don''t have any descriptions (which is what I am displaying in it).

4 Replies

AD Administrator Syncfusion Team October 19, 2005 02:57 PM UTC

It also show up for the nested tables. How do you only show this in the base table?


AD Administrator Syncfusion Team October 19, 2005 05:28 PM UTC

To show/hide for individual records you need a custom engine where you derive GridRecord and override this method: public override bool ShouldShowRecordPreviewRows() and return true/false based on your condition. You can see an example of creating a custom engine and deriving GridRecord in this sample. \Essential Studio\3.3.0.0\Windows\Grid.Windows\Samples\Grouping\ResizableRows


AD Administrator Syncfusion Team October 19, 2005 07:21 PM UTC

I get the following error: ''XXX.GroupingRecordRow.ShouldShowRecordPreviewRows()'': no suitable method found to override This was after adding the following class to my engine class public class GroupingRecordRow : GridRecordRow { /// /// Initializes a new object in the specifed record part. /// /// The parent element. public GroupingRecordRow(RecordRowsPart parent) : base(parent) { } public override bool ShouldShowRecordPreviewRows() { return true; } }


AD Administrator Syncfusion Team October 19, 2005 11:48 PM UTC

It should be GridRecord instead of GridRecordRow. Sorry. public class GroupingEngineFactory : GridEngineFactoryBase { // Add this line in your forms ctor: // GroupingEngineFactory provides a modified GridChildTable that adds an extra section // GridEngineFactory.Factory = new GroupingEngineFactory(); public override GridEngine CreateEngine() { return new GroupingEngine(); } } public class GroupingEngine : GridEngine { public override Record CreateRecord(Table parentTable) { return new MyGridRecord(parentTable); } } public class MyGridRecord : GridRecord { public MyGridRecord(Table parent) : base(parent) { } public override bool ShouldShowRecordPreviewRows() { //return false to hide this preview record //return true to show it return false; } }

Loader.
Live Chat Icon For mobile
Up arrow icon