CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2021
    Posts
    2

    Using datagridview AdjustCellBorderStyle function to change border color

    Hello everyone.

    I'm having a hard time trying to do anything with the dataGridView border. Id like to chang its color and shape of a two different cells using Visual c++ and making a Windows form application.

    Code:
    	DataGridViewAdvancedBorderStyle^ dgv1ph;
    	DataGridViewAdvancedBorderStyle^ dgv1i;
    	dgv1ph->Right = DataGridViewAdvancedCellBorderStyle::OutsetDouble;
    
    	this->dataGridView1->Rows[1]->Cells[1]->AdjustCellBorderStyle(dgv1ph, dgv1ph,true, true,true, true);
            this->dataGridView1->Rows[3]->Cells[3]->AdjustCellBorderStyle(dgv1ph, dgv1ph,true, true,true, true);
    This code above in principle should hange the right border of the cells 1,1 and 3,3 but as it do compile, a i try to run that part of the code the application breaks with system null reference exception.

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,099

    Re: Using datagridview AdjustCellBorderStyle function to change border color

    The code you have posted has nothing to do with the native C++.
    It looks like the managed code.

    So I move this thread to the most appropriate Forum.
    Victor Nijegorodov

  3. #3
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,099

    Re: Using datagridview AdjustCellBorderStyle function to change border color

    [moved from Visual C++ Programming Forum]
    Victor Nijegorodov

  4. #4
    Join Date
    Jan 2021
    Posts
    2

    Re: Using datagridview AdjustCellBorderStyle function to change border color

    Sorry, there were almost no posts here so i assumed its not the propper place

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured