This project is read-only.

How to set different intent for each row?

Sep 11, 2013 at 6:43 PM
Edited Sep 11, 2013 at 6:43 PM
I have a column need to be displayed with different intents like this:
My question is how to set the intent and when should i do it (Is where any events like DataGridView's CellFormatting event)?

PS. I've tried using SourceGrid.Cells.Views.Cell.Padding to get it, but when i set a cell's padding, all cells padding changed, here is my code:
((SourceGrid.Cells.Views.Cell)dataGrid1.GetCellsAtRow(1)[1].View).Padding = new DevAge.Drawing.Padding(15, 2, 2, 2);

How can i get through it?
Sep 11, 2013 at 7:03 PM
And i've tried another way: Define a new Cell View
    public class MyCellView : SourceGrid.Cells.Views.Cell
        public MyCellView()
            : base()
            Padding = new DevAge.Drawing.Padding(15, 2, 2, 2);
Then set the cell's view to the MyCellView
dataGrid1.GetCell(1, 0).View = new MyCellView();
But the result is all cells in the same column have the new Cell View.
Oct 4, 2013 at 8:07 AM

You'll need to clone the Cell instance at first.
dataGrid1.GetCell(1, 0) = dataGrid1.GetCell(1, 0).Clone();
dataGrid1.GetCell(1, 0).View = new MyCellView();
I'm sorry if it doesn't work. I don't test the code yet.