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 2016-05-17 15:08:47

brian.shankland
Member
Registered: 2016-05-11
Posts: 15

GetRangeBorders reporting incorrect values

I have an excel sheet that when loaded into the control reports inconsistent range border styles.

for instance:

Range D27:D27 the value of RangeBorderInfoSet.Right.Style returns BoldSolid
Range E27:E27 the value of RangeBorderInfoSet.Right.Style returns None

I would have expected the same value to be returned as these are adjacent cells sharing the same border line.

I can email you the sheet if you need it.

Offline

#2 2016-05-18 01:33:58

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

Re: GetRangeBorders reporting incorrect values

Maybe you should to get Left Border from Range E27:E27, if they use shared border line.

Or you can try use the Border property from cell.

worksheet.Cells["D27"].Border.Right
worksheet.Cells["E27"].Border.Left

If you can't solve it please mail me: jing at reogrid.net.

Last edited by Jingwood (2016-05-18 01:34:56)

Offline

#3 2016-05-18 08:47:09

brian.shankland
Member
Registered: 2016-05-11
Posts: 15

Re: GetRangeBorders reporting incorrect values

RangeBorderStyle a = CurrentSheet.Cells["D27"].Border.Right;   returns BoldSolid
RangeBorderStyle b = CurrentSheet.Cells["E27"].Border.Left;     returns None

I'll email you the spreadsheet.

Offline

#4 2016-05-18 12:55:04

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

Re: GetRangeBorders reporting incorrect values

Thanks for your mail.

I forgot tell you that you can use the third parameter to force get a border that doesn't belong to a cell.

var borderInfo = sheet.GetRangeBorders("E27", BorderPositions.All, false);
MessageBox.Show(Convert.ToString(borderInfo.Left));

Result:

RangeBorderStyle[Color=Color(255, 0, 0, 0),Style=BoldSolid]

Excel saves border information that attached to every cells. In your file, the BoldSolid border belongs to D27 cell. E27 cell only have the right border in Excel file.

But D27 and E27 actually use shared border, so ReoGrid provides the third parameter that indicates whether or not to get a shared border that doesn't belong to a cell.

Offline

#5 2016-08-23 19:54:05

adamcrowe
Member
Registered: 2016-08-21
Posts: 21

Re: GetRangeBorders reporting incorrect values

Hi everybody,

I'm experiencing the same problem on merged cells - only on the right border. The border is drawn correctly on the reoGrid control but the information from both the Cell.Border.Right and sheet.GetRangeBorders is incorrect. BUT this only happens of the merged cell is either to left of a ReadOnly cell or if it's merged with the last column cell in the sheet.

I've debugged this to the nth degree today. I just don't understand how the control draws it correctly but returns different information. It must store the right thing somewhere?

Thank you for your time!!!

Adam

Offline

#6 2016-08-25 11:33:52

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

Re: GetRangeBorders reporting incorrect values

Hi Adam, you can try to get the border information by using the code like below:

var borderInfo = sheet.GetRangeBorders("E27", BorderPositions.All, false);

The important is the last argument that should be false. This argument indicates that ReoGrid ignores the border owner information, borders usually belong to a cell when you set them from a cell.

Last edited by Jingwood (2016-08-25 11:34:34)

Offline

#7 2016-08-25 20:52:34

adamcrowe
Member
Registered: 2016-08-21
Posts: 21

Re: GetRangeBorders reporting incorrect values

Just wanted to say a massive thank you for looking into this. GetRangeBorders works perfect. The reason it didn't work for me before was because after checking the border style with GetRangeBorders, I was actually using the Border properties of the Cell itself rather than the GetRangeBorders result.

Apologies and again, thank you!

Offline

#8 2016-08-28 09:29:03

adamcrowe
Member
Registered: 2016-08-21
Posts: 21

Re: GetRangeBorders reporting incorrect values

I'm sorry to bring this up again but I think there might be a related issue with the grid with loading from RGF. The borders adjacent to read-only cells don't get restored properly as shows in these screenshots:

Parallels-Picture-1.png?fit=308%2C166

Parallels-Picture.png?fit=353%2C166

The cells in Column 24 are read-only while cells in columns 25-32 have an Outside border.

The RGF file contains the following for these cells:

    <v-border row="0" col="24" color="#c0c0c0" pos="all" rows="5" />
    <v-border row="0" col="25" pos="all" rows="2" />
    <v-border row="2" col="25" color="#c0c0c0" pos="all" rows="3" />
    <v-border row="1" col="26" color="#c0c0c0" pos="all" rows="4" />
    <v-border row="1" col="27" color="#c0c0c0" pos="all" rows="4" />
    <v-border row="1" col="28" color="#c0c0c0" pos="all" rows="4" />
    <v-border row="1" col="29" color="#c0c0c0" pos="all" rows="4" />
    <v-border row="1" col="30" color="#c0c0c0" pos="all" rows="4" />
    <v-border row="1" col="31" color="#c0c0c0" pos="all" rows="4" />
    <v-border row="1" col="32" color="#c0c0c0" pos="all" rows="4" />
    <v-border row="0" col="33" pos="all" rows="2" />

    <cell row="0" col="24" format="text" readonly="true" />
    <cell row="0" col="25" colspan="8" format="text">Digidesign 192 A Outputs<style bgcolor="#f2dcdb" bold="true" /></cell>

Any help would be most appreciated!!!

Adam

Offline

Board footer

Powered by FluxBB