|118745||Apr 6,2015 08:53 PM||Apr 7,2015 09:01 AM||Windows Forms||1|
row 1, 2 , 3 has 3 columns and data is placed in them either left or right justified. I want to remove the top and bottom border and have the 3 grid rows to have a Yellow back ground color. I have not been able to remove the horizontal borders to make it look like a big header grid.The other rows have 3 columns and i want to remove the top/bottom border on certain rows.
Thank you for using Syncfusion product.
We can set the background color using style.BackgroundBrush property and text can be justified in cell using PdfStringFormat.Alignment .
Please refer the below code snippet:
PdfStringFormat format=new PdfStringFormat();
//Alignment the text to right
//Apply the background to the first 3 rows
pdfGrid.Rows[i].Style.BackgroundBrush = PdfBrushes.Yellow;
//Assign the format to particular cells
pdfGrid.Rows[i].Cells[j].StringFormat = format;
//Remove the bottom border for previous row
pdfGrid.Rows[i - 1].Cells[j].Style.Borders.Bottom = PdfPens.Transparent;
//Remove the top border from row
pdfGrid.Rows[i].Cells[j].Style.Borders.Top = PdfPens.Transparent;
We have attached the sample for removing the grid row top/bottom borders in below link:
Please try this and let us know if you have any further assistance .
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.