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
close icon

To make rows invisible in grid

Hi,

I have a scenario where I have to bind grid based on 3 radio buttons - on click of first radion button, I bind the whole datatable to the grid.
On click of other 2 radion buttons, i filter the dataset and bind the set of datarows to grid.

I have editable columns in the grid, on selecting a value from the dropdown column, i have to populate another column in the grid for which i use this event - TableControlCurrentCellCloseDropDown.

In this event, i get selected record :
DataRowView gridDataRowView = gridRecord.GetData() as DataRowView;

gridDataRowView has correct values in case of clicking 1st radion button where i am binding the whole datatable.
However gridDataRowView does not have any value in case of the other 2 radion buttons as I am binding the DAtaRows in this case.

On click of other 2 radion buttons i have to hide certain rows, so I am doing Select on dataset and binding the resulting datarows.

How do I handle this situation where I have to hide certain rows on grid. I have attached the screen shot along with this message.

Thanks,
Deepa



Images_627f47d6.zip

3 Replies

SR SubhaSheela R Syncfusion Team August 28, 2008 12:41 PM UTC


Hi Deepa,

Thank you for posting query to us and the details.

Instead of doing a select on your dataset and binding the resulting datarows you may bind the whole datatable and hide the rows/records you dont want based on some condition.

By default, the GridGroupingControl does not support rows with individualized rowheights. To get this support, you need to add a custom GridEngine as in the Syncfusion Browser sample ResizableRows.

\\Syncfusion\EssentialStudio\6.2.0.40\Windows\Grid.Grouping.Windows\Samples\2.0\FeaturedSamples\ResizableRows

After having this you can hide rows in grid. For your case the best way to do this would be to have an extra column in your DataTable say ‘HideStatus’(hide this column) to keep track of the hidden rows. You can initially set the value to be false and apply filter from Grid to show the records that satisfy the false criteria.

So whenever you need to hide a row, you just need to set the bool value of that Row field to true.

Please refer this sample for the implementation.

http://www.syncfusion.com/Support/user/uploads/GGCHide_4c50dba8.zip

Kindly let us know if you need any further assistance.

Thank you for using Syncfusion Products.

Regards,
Subhasheela R



AD Administrator Syncfusion Team September 1, 2008 10:20 AM UTC

Hi,

I trid Addding Record filters as suggested.

grid.TableDescriptor.RecordFilters.Add(new RecordFilterDescriptor "isVisibleRow", "[isVisibleRow] like 'true'"));

This works. Now I can bind the datatable and yet filter the rows based on the conditions.

Many Thanks,
Deepa

>
Hi Deepa,

Thank you for posting query to us and the details.

Instead of doing a select on your dataset and binding the resulting datarows you may bind the whole datatable and hide the rows/records you dont want based on some condition.

By default, the GridGroupingControl does not support rows with individualized rowheights. To get this support, you need to add a custom GridEngine as in the Syncfusion Browser sample ResizableRows.

\\Syncfusion\EssentialStudio\6.2.0.40\Windows\Grid.Grouping.Windows\Samples\2.0\FeaturedSamples\ResizableRows

After having this you can hide rows in grid. For your case the best way to do this would be to have an extra column in your DataTable say ‘HideStatus’(hide this column) to keep track of the hidden rows. You can initially set the value to be false and apply filter from Grid to show the records that satisfy the false criteria.

So whenever you need to hide a row, you just need to set the bool value of that Row field to true.

Please refer this sample for the implementation.

http://www.syncfusion.com/Support/user/uploads/GGCHide_4c50dba8.zip

Kindly let us know if you need any further assistance.

Thank you for using Syncfusion Products.

Regards,
Subhasheela R





SR SubhaSheela R Syncfusion Team September 2, 2008 04:13 AM UTC

Hi Deepa,

Thanks for your update.

Please feel free to open an new one if you have any further technical queries.

Thanks for using Syncfusion products.

Regards,
Subhasheela R


Loader.
Live Chat Icon For mobile
Up arrow icon