- Home
- Forum
- ASP.NET MVC
- Customize cell style in grid
Customize cell style in grid
Query #1: I'd like to reduce the grid cell padding and the row height (so that more content is displayed in the same space) by setting a custom css class
We analyzed your requirement to customize the grid appearance using custom CSS. We have discussed on this topic in our below Knowledge base links.
https://www.syncfusion.com/kb/4266/how-to-modify-the-grid-row-height
https://www.syncfusion.com/kb/5172/how-to-customize-grid-appearance-using-custom-css
Please refer to the above links in order to achieve your requirement.
Query #2: Unfortunately this doesn't seem to work. Maybe, like in the button example, I have to put some other lines in my test.css file? Which lines should I add?
If you defining the custom CSS externally using a separate css file, then we suggest you to refer this css file after referring our syncfusion css files such that our classes will be overridden by your custom css. By this way, it will be convenient for you even if you make any changes to the layout or the themes to override css of our controls.
Regards,
Ragavee U S.
Attachment: wrong_parent_row_height_2890d810.zip
Hi Carlo,
The cause of the issue can be the height of expand and collapse button is overwrite on the parent Grid cells. So, overwrite the CSS of expand and collapse button of parent Grid control. Please refer to the below code example.
|
.e-grid .e-icon.e-gdiagonalnext, .e-grid .e-icon.e-gnextforward{ margin-top: 2px; } .e-grid .e-recordpluscollapse>div, .e-grid .e-detailrowcollapse>div, .e-grid .e-recordplusexpand>div, .e-grid .e-detailrowexpand>div{ height:8px; } |
Regards,
Saravanan A.
Attachment: outerBorder_20e29594.zip
To hide the outer border of the Child Grid, please refer to the following code example and screenshot. It will override the detailcell padding and border style given.
|
<style> .e-grid .e-detailcell { padding: 0px; border-top-style: none; } |
Regards,
Seeni Sakthi Kumar S.
Thanks for the update.
Please let us know if you need any further assistance. We will be happy to help you.
Regards,
Alan Sangeeth S
Hi Carlo,
Thanks for the update.
Please let us know if you need any further assistance. We will be happy to help you.
Regards,
Alan Sangeeth S
Well, there's one more requirement which I've been asked to met, regarding the grid aesthetic appeareance: I need to add some top and bottom margin in the detail grid of each row, so that the difference between master and detail rows is more explicit. I've included 2 pics so that it will be easier for you to exactly figure out my requirement. I've taken a look here (https://www.syncfusion.com/kb/5172/how-to-customize-grid-appearance-using-custom-css) but I couldn't find any css class specific for each child grid.
Attachment: top_bottom_margin_detailgrid_in_masterdetail_b95aad39.7z
Hi Carlos,
We have analyzed your screenshot and achieved your requirement by overriding the CSS of “e-detailindentcell” class and refer to the below code example.
|
.e-grid .e-detailindentcell{ border-top-width: 1px; border-top-style: solid; border-top-color: #c8c8c8 } .e-grid .e-detailindentcell{ border-right-width: 0px; } |
Regards,
Saravanan A.
Hi Carlos,
We are sorry for the inconvenience.
We have analyzed the provided CSS code and we have achieved your requirement by modifying the CSS of detailcell (.e-grid .e-detailcell) class and also include the CSS provided in our previous update which we updated on 15th December 2015. Please refer to the below code example.
|
/*Modified CSS*/ .e-grid .e-detailcell { padding: 13px; border-top: 1px; border-top-color: #c8c8c8; border-top-style: solid; } /*CSS in our previous update*/ .e-grid .e-detailindentcell{ border-top-width: 1px; border-top-style: solid; border-top-color: #c8c8c8; border-right-width: 0px; } |
Regards,
Saravanan A.
Hi Carlos,
Thanks for your update.
We are happy that the provided information helped you.
Regards,
Saravanan A.
- 13 Replies
- 5 Participants
-
CA Carlo
- Nov 11, 2015 09:20 AM UTC
- Dec 21, 2015 07:25 AM UTC