We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

IRange - writes to cells outside my range

Thread ID:

Created:

Updated:

Platform:

Replies:

78401 Dec 11,2008 02:58 PM UTC Dec 16,2008 01:22 PM UTC Windows Forms 3
loading
Tags: XlsIO
Administrator [Syncfusion]
Asked On December 11, 2008 02:58 PM UTC

I have created a range from a sheet like this

IRange myRange = m_sheet.Range[2, 2, 42, 12]

to me this is row col 2,2 to row col 44,12

I pass this range to a method and the method goes

private void writeToRange(IRange writeHere)
{
curRow = 1
curCol = 1
writeHere[curRow, curCol].Text = value
}

Even tho my the address of my range is Sheet1'!B2:L43
the value is written to A1

Is this expected behavior. I expected it to write the value to B2


Geetha M [Syncfusion]
Replied On December 12, 2008 05:29 AM UTC

Hi Kelley,

Thank you for your interest in Syncfusion products.

I see that you are using writeHere[curRow, curCol] which means writeHere[1, 1] (as curRow=1 and curCol=1). So the value is written in A1. If you need to write in B2, please use the below code snippets:

writeHere[2, 2].Text = value;

Please let me know if you have any questions.

Regards,
Geetha


Administrator [Syncfusion]
Replied On December 12, 2008 12:03 PM UTC

Yes I agree that is what I need to do. What I don't understand is why.

What is the point of getting a range on the sheet if when you right to the range you are actually writing to absolute address of the sheet?

This implies to me that I should not be using IRange, I should just talk directly to the sheet.





>Hi Kelley,

Thank you for your interest in Syncfusion products.

I see that you are using writeHere[curRow, curCol] which means writeHere[1, 1] (as curRow=1 and curCol=1). So the value is written in A1. If you need to write in B2, please use the below code snippets:

writeHere[2, 2].Text = value;

Please let me know if you have any questions.

Regards,
Geetha




Bhuvaneswari P [Syncfusion]
Replied On December 16, 2008 01:22 PM UTC

Hi Kelley,

Actually it should work as you expected but currently this is the behavior of XlsIO and already we have logged feature request (When selecting a cell inside a range of cells, it doesn’t consider that range. It consider as a whole sheet rather than a given range.) regarding this and will update the timeline within two days.

Please let me know if you have any concerns.

Best Regards,
Bhuvana



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;