ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2014-11-05 13:55:32

Tom
Member
Registered: 2014-11-05
Posts: 3

RemoveRangeStyle does not work

Hi,

im trying to remove range styles, but nothing changes. Even if i delete rows/cols the style will be there after adding new rows/cols.
I tried with different style flags.

-Tom

Offline

#2 2014-11-06 03:59:32

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: RemoveRangeStyle does not work

Hi, Could you give some pieces of code? I've tested this that works fine.

var range = new ReoGridRange("B2:D4");

// set styles
sheet.SetRangeStyle(range, new ReoGridStyleObject
{
	Flag = PlainStyleFlag.BackColor,
	BackColor = Color.SkyBlue,
});

// remove styles
sheet.RemoveRangeStyle(range, PlainStyleFlag.BackColor);

Offline

#3 2014-11-06 07:45:46

Tom
Member
Registered: 2014-11-05
Posts: 3

Re: RemoveRangeStyle does not work

Well,

now i know my problem. I thought i can remove all the styles with one call to the whole grid, means i do not specify the same range while trying to remove the style(s).
In example

var range = new ReoGridRange("B2:D4");
var rangeAll = new ReoGridRange("A1:D4");

// set styles
sheet.SetRangeStyle(range, new ReoGridStyleObject
{
	Flag = PlainStyleFlag.BackColor,
	BackColor = Color.SkyBlue,
});


// remove styles
sheet.RemoveRangeStyle(rangeAll , PlainStyleFlag.BackColor);

Is there any possibility to remove all styles at once?

Offline

#4 2014-11-06 07:59:17

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: RemoveRangeStyle does not work

Try this:

// remove all styles from whole grid
sheet.RemoveRangeStyle(ReoGridRange.EntireRange, PlainStyleFlag.All);

Offline

#5 2014-11-07 14:37:13

Tom
Member
Registered: 2014-11-05
Posts: 3

Re: RemoveRangeStyle does not work

Well,

i tried it, but it seems there are some problems evaluating all ranges. If i set a style on a ranges via a row/column(selectionRange), the range will not loose their style. The same thing happes if i have f.i. a range with an image as part of a cell.

Offline

#6 2014-11-11 05:00:05

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: RemoveRangeStyle does not work

I hope I can help you, however if you could provide some code that shows how to reappear the issue, that will be helpful.

Offline

Board footer

Powered by FluxBB