DataGridView Grid Borders

Hi


I have a DataGridView with 8 columns, all Text Box columns, all Read Only, populated from an indexed file.  The first tow columns are frozen.  I want the right hand border on the second column to appear thicker than the others.  Here is the code I tried to achieve this:

       class-id DataGridViewColFrzCls inherits type System.Windows.Forms.DataGridViewColumn.

       method-id NEW.
       procedure division.
           set self::CellTemplate to new DataGridViewCellFrzCls.
           goback.
       end method.

       end class.



       class-id DataGridViewCellFrzCls inherits type System.Windows.Forms.DataGridViewTextBoxCell.

      *> Automatically inserted Methods from System.Windows.Forms.DataGridViewTextBoxCell

       method-id AdjustCellBorderStyle override.
       procedure division using by value
                                   dataGridViewAdvancedBorderStyle as type System.Windows.Forms.DataGridViewAdvancedBorderStyle
                                   dataGridViewAdvancedBorderSty0 as type System.Windows.Forms.DataGridViewAdvancedBorderStyle
                                   singleVerticalBorderAdded as condition-value
                                   singleHorizontalBorderAdded as condition-value
                                   isFirstDisplayedColumn as condition-value
                                   isFirstDisplayedRow as condition-value
                          returning return-item as type System.Windows.Forms.DataGridViewAdvancedBorderStyle.
                          
           set dataGridViewAdvancedBorderSty0::Top to type DataGridViewAdvancedCellBorderStyle::None.
           set dataGridViewAdvancedBorderSty0::Left to dataGridViewAdvancedBorderStyle::Left.
           set dataGridViewAdvancedBorderSty0::Bottom to dataGridViewAdvancedBorderStyle::Bottom.
           set dataGridViewAdvancedBorderSty0::Right to type DataGridViewAdvancedCellBorderStyle::OutsetDouble.
           
      *    set return-item to super::AdjustCellBorderStyle(dataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderSty0 singleVerticalBorderAdded singleHorizontalBorderAdded isFirstDisplayedColumn isFirstDisplayedRow)
           set return-item to dataGridViewAdvancedBorderSty0
            goback
       end method.
      *> End Methods from System.Windows.Forms.DataGridViewTextBoxCell
      
       end class.

I have set column 2 to be DataGridViewColFrzCls, all the other columns are DataGridViewTextBoxColumn.

The code above only has the effect of making the left hand border, not the right hand border of cells in column 2 thicker.

Can someone tell me what I am doing wrong?  It may have something to do with column 2 being forzen.

Using Visual Cobol 2.1 Visual Studio 2010.

Thank you.

  • It appears from the MSDN docs that type DataGridViewAdvancedCellBorderStyle::OutsetDouble can only be used for the right border if the dataGridView is set to RightToLeft processing. If I change the RightToLeft property to True then the border does show correctly as double.

    If I set the right style to none and RightToLeft is set to false then the border disappears so it is being set.

    Look under the Exceptions section of the docs here.