DefaultCellStyle on Row in a KryptonDataGridView

Topics related to the Krypton Toolkit.

Moderators: Phil Wright, Chris Porter

DefaultCellStyle on Row in a KryptonDataGridView

Postby dg78 » Fri Jan 22, 2010 9:20 am

Hi,

I try :

Code: Select all
    With Me.DataGridView1
      .Rows(10).DefaultCellStyle.BackColor = Color.Red
      .Columns(2).DefaultCellStyle.BackColor = Color.Red
    End With


It is ok with the Column, it appears in Red but the Row don't change.

It is a bound datagridview and the row index = 10 exists when it come on this code.

I try with a standard DataGridView and it is ok with the Column and with the Row.

Is it a bug ?

Dominique
dg78
 
Posts: 28
Joined: Sat Oct 24, 2009 12:10 am
Location: France

Re: DefaultCellStyle on Row in a KryptonDataGridView

Postby dg78 » Tue Jan 26, 2010 8:58 pm

Nobody to answer ?? Thanks
dg78
 
Posts: 28
Joined: Sat Oct 24, 2009 12:10 am
Location: France

Re: DefaultCellStyle on Row in a KryptonDataGridView

Postby vesuvius » Wed Jan 27, 2010 5:00 am

I think people need more information like the event you are handling (is it the cell formating event)

Also because you have said this works in the system.windows.forms control, a code example/project, may be the best way to get help. As it is, your problem is vague.

Thanks
vesuvius
 
Posts: 582
Joined: Thu Aug 16, 2007 8:38 pm
Location: Yorkshire, England

Re: DefaultCellStyle on Row in a KryptonDataGridView

Postby SteveRW » Fri Feb 25, 2011 12:18 am

I have also found that this is not working. My code is as follows:

For Each row As DataGridViewRow In grdActions.Rows
With grdActions.Rows(MyCount).Cells(6)
Select Case .Value
Case "Closed"

Case "ClosedFull"

Dim f As Font = New Font("Arial", 10, FontStyle.Strikeout)
grdActions.Rows(4).DefaultCellStyle.Font = f

End Select
End With
MyCount += 1
Next


As you can see it is just a loop to test the value in a cell and strike through the row if it is ClosedFull.

Any help would be greatly appreciated.
User avatar
SteveRW
 
Posts: 4
Joined: Thu Feb 24, 2011 7:29 pm

Re: DefaultCellStyle on Row in a KryptonDataGridView

Postby anovgor » Tue Jan 31, 2012 10:19 pm

Nobody answers? thanks
anovgor
 
Posts: 4
Joined: Tue Jan 31, 2012 10:18 pm

Re: DefaultCellStyle on Row in a KryptonDataGridView

Postby dharry » Tue Apr 10, 2012 3:37 pm

I have the same problem... I can't seem to set strikethrough on a row...

I have tried various different things but they all return 'System.NullReferenceException' occurred in System.Drawing.dll at runtime...

Any ideas anyone?

Regards,
Dean
dharry
 
Posts: 2
Joined: Sun Apr 01, 2012 1:05 pm


Return to Krypton Toolkit

Who is online

Users browsing this forum: No registered users and 2 guests