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 2015-09-03 20:07:00

cloud168
Member
Registered: 2015-09-03
Posts: 13

Urgent question about referencing

I've seen a post about referencing other sheets, is it possible in the latest version?

Example:

Dim sheet1, sheet2 As Worksheet
       
        sheet1 = Me.ReoGrid1.Worksheets(0)
        sheet2 = Me.ReoGrid1.Worksheets(1)
        sheet1("A1") = 5
        sheet2("B2") = "=Sheet1!A1"

(As I've seen in older post, but same to what I'm asking)

EDIT: sorry if my questions are quite noob, I'm new to this sorry.

grid.SetSettings(WorksheetSettings.Edit_AutoFormatCell, false);

why is it getting me 2 errors "Error    1    The best overloaded method match for 'unvell.ReoGrid.ReoGridControl.SetSettings(unvell.ReoGrid.WorkbookSettings, bool)' has some invalid arguments, and Argument 1: cannot convert from 'unvell.ReoGrid.WorksheetSettings' to 'unvell.ReoGrid.WorkbookSettings'

thanks sorry again if my questions are noobish

Last edited by cloud168 (2015-09-03 22:19:35)

Offline

#2 2015-09-04 11:41:55

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

Re: Urgent question about referencing

Hi welcome! Multiple worksheet references now under development and will be available soon, within 2-3 days.

grid.SetSettings(WorksheetSettings.Edit_AutoFormatCell, false);

Is this code copied from somewhere? It may be a document mistake.
Please try this code:

var sheet = grid.CurrentWorksheet;
sheet.SetSettings(WorksheetSettings.Edit_AutoFormatCell, false);

Last edited by Jingwood (2015-09-04 11:42:24)

Offline

#3 2015-09-04 13:37:33

cloud168
Member
Registered: 2015-09-03
Posts: 13

Re: Urgent question about referencing

thanks for the reply sir Jing! Finally got the settings working, which brings me to another question,
1. how can I make a cell accept a user-typed value, and when I click save, it will save to the file? used worksheet.Save and worksheet.SaveRGF didn't worked, it just saved a blank rgf document, thank you for understanding my noob questions
(I used it on a button, to save the file)
2. the borders are basically gone, and it doesn't look like a spreadsheet when I opened the 'saved rgf file' from c#, what setting did I miss sir?
again sorry for these noob questions smile

edit:

3. and lastly, how to make my spreadsheet not docked? I mean, if I don't have Dock = DockStyle.Fill, code inside var grid = new unvell.ReoGrid.ReoGridControl() I can't see the spreadsheet, sorry for these noob questions sir

Last edited by cloud168 (2015-09-04 23:14:31)

Offline

#4 2015-09-06 21:01:59

cloud168
Member
Registered: 2015-09-03
Posts: 13

Re: Urgent question about referencing

bump

Offline

#5 2015-09-07 02:04:41

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

Re: Urgent question about referencing

What's the meaning of 'worksheet.Save and worksheet.SaveRGF didn't worked'? Did you get any error messages? Post your code will be helpful.

Last edited by Jingwood (2015-09-07 02:05:24)

Offline

#6 2015-09-07 05:07:41

cloud168
Member
Registered: 2015-09-03
Posts: 13

Re: Urgent question about referencing

when I use it, it just saves a blank rgf file, like when I view it on reogrid editor, it is blank, it doesn't accept the user-typed data on the cell on runtime, how can it accept a user-typed data on a cell when ran sir?
(edit: btw this code is used on a button sir)

var grid = new unvell.ReoGrid.ReoGridControl();
var worksheet = grid.CurrentWorksheet;
worksheet.Save("C:\\Users\\Dave\\Desktop\\test6.rgf");
MessageBox.Show("Saved!", "Alert");

path is good, double checked, so what seems to be the problem sir?

borders basically gone >>
gsdfgdfgdfgdfg.jpg

and lastly, how to make the spreadsheet not docked sir? when I remove the

Dock = DockStyle.Fill,

the spreadsheet doesn't show up on the form, sorry for these questions sir and for troubling you,
I hope you can answer these questions sir!

Last edited by cloud168 (2015-09-07 05:08:27)

Offline

#7 2015-09-07 05:39:27

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

Re: Urgent question about referencing

I tested your code and everything works as expected. Why there is only columns A-G on your picture, it must be A-CV, more columns exist by default, there must be others code that changes the column count?

For dock, you should give a size property for the control if it was not docked.

var f = new Form()
{
  Bounds = new Rectangle(100, 100, 640, 480),
};

var grid = new unvell.ReoGrid.ReoGridControl()
{
  Bounds = new Rectangle(10, 10, 400, 300),
};

f.Controls.Add(grid);
f.Show();

Or, follow on this article to add a toolbox shortcut, that allows you create the control on form by dragging mouse, it is more like a normal windows control.
https://reogrid.net/document/installation/

Offline

#8 2015-09-07 11:10:30

cloud168
Member
Registered: 2015-09-03
Posts: 13

Re: Urgent question about referencing

I set the rows and columns sir, that's why it's only A-G, so umm, why is mine not accepting user-typed entries when I run the program sad even when worksheet.Save is used.. can I see
what codes you used sir? are there any codes to accept user-typed entries per cell on runtime? sad I hope you can help me, that's my only problem sir, I'm sorry for troubling you sad

(edit: thank you for testing the codes, the code you gave for undocking the spreadsheet works, only problem now is how the cell will accept user-typed entries on runtime sir sad)

Last edited by cloud168 (2015-09-07 11:12:44)

Offline

#9 2015-09-08 02:17:30

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

Re: Urgent question about referencing

Please send me your whole project and let me check your problem. Mail: jing at reogrid.net. Thanks.

Offline

#10 2015-09-08 05:14:15

cloud168
Member
Registered: 2015-09-03
Posts: 13

Re: Urgent question about referencing

I sent it sir, sorry for troubling you

Offline

#11 2015-09-08 10:08:57

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

Re: Urgent question about referencing

OK thanks for the mail.

Every time you saved the worksheet you created actually a new instance of control, that's why you couldn't save any changes from end-user.

The instance displayed on the form is not the instance of you saved. You should keep an instance as form member.

public partial class Form1 : Form
{
  public Form1()
  {
    InitializeComponent();
  }

  private ReoGridControl grid;
 
  private void Form1_Load(object sender, EventArgs e)
  {
    grid = new unvell.ReoGrid.ReoGridControl()
    {
      // put to fill the parent control
      Dock = DockStyle.Fill,
    };
    this.Controls.Add(grid);
  }

  private void button2_Click(object sender, EventArgs e)
  {
    // save
    var worksheet = grid.CurrentWorksheet;
    worksheet.Save("C:\\Users\\Dave\\Desktop\\test6.rgf");
  }
}

Good Luck smile

Offline

#12 2015-09-08 13:51:36

cloud168
Member
Registered: 2015-09-03
Posts: 13

Re: Urgent question about referencing

umm, sorry for troubling you again, I did put the code in the //save part, but when I click the button, here's what happening sir, what seems to be the problem sad sorry I can't troubleshoot that good

report1.jpg

edit: thanks for helping me sir!
edit2: and if you can see the grid part, it has a green line sad

Last edited by cloud168 (2015-09-08 13:53:02)

Offline

#13 2015-09-08 16:44:11

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

Re: Urgent question about referencing

Please change your code at line 32, from:

var grid = new unvell.ReoGrid.ReoGridControl();

to

grid = new unvell.ReoGrid.ReoGridControl();

See my code above. Green line is normal, it comes from your Windows theme color.

Offline

#14 2015-09-09 17:43:51

cloud168
Member
Registered: 2015-09-03
Posts: 13

Re: Urgent question about referencing

Sir I'm sorry for troubling again, but I did the code you gave me, and when I save it on runtime, it still doesn't show when I open it via reogrideditor.exe I don't know why sad

I sent again my project for you to see, I typed "test" in one of the cells in runtime but still, it doesn't show the word "test" when I view it on reogrideditor, please help me sir sad

sigh.jpg

I hope you're not getting tired with me sir sad

edit: and sir, this is the file that was saved, no default lines sad so many things going on, so sorry for troubling you sir, I hope you can help me

sigh2.jpg

Last edited by cloud168 (2015-09-09 17:55:53)

Offline

#15 2015-09-11 07:28:02

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

Re: Urgent question about referencing

I don't see any problems from your picture, please send me your whole project.

Last edited by Jingwood (2015-09-11 07:29:02)

Offline

#16 2015-09-11 15:31:21

cloud168
Member
Registered: 2015-09-03
Posts: 13

Re: Urgent question about referencing

sent sir, please help sad

edit: here's what I was doing to check if it was saving the work, basically, when I run it, on visual studio, I type on the cell then click save, then I check that file on reogrideditor if the typed word
will show, unfortunately sir, it doesn't show sad

Last edited by cloud168 (2015-09-11 15:33:01)

Offline

#17 2015-09-12 03:45:01

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

Re: Urgent question about referencing

Please comment out the code at line 40 and retry.

//worksheet.Load("C:\\Users\\Dave\\Desktop\\test7.rgf");

Since I haven't this file, I commented out it and everything works fine.
ReoGrid works without problems and you should check your code firstly, rather than post in here.
It is hard to help you without your environment.

In addition,

var worksheet = grid.CurrentWorksheet;
var sheet = grid.CurrentWorksheet;

These code does work but should just one.

Offline

#18 2015-09-17 14:57:28

cloud168
Member
Registered: 2015-09-03
Posts: 13

Re: Urgent question about referencing

hello sir, sorry just got online now to do some things in the past few days, umm, the way it works is, if you create a file via reogrideditor, write something in it, then load it in runtime via worksheet.Load,
then the data you typed in reogrideditor will show up right? then I type on runtime in a cell, then click the button with worksheet.Save function, it will save it into the rgf file yes? then if you open in reogrideditor again, it should
load all data typed in before loading it on runtime, and during runtime, right? that's how I check if it saves, but sadly it doesn't sir. Please explain sir, is that how it works? or I'm mistaken? sad
sorry If I'm troubling you again sir, this is my only hope in finishing this project sad sad I hope you can help me again

Offline

#19 2015-09-26 00:12:07

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

Re: Urgent question about referencing

If you only say 'it doesn't work', I couldn't help you. Please debug your code step by step, let me know where and what code doesn't work, and how it doesn't work.

In previous posts I could see that you have created your template file (rgf file), if you send me your whole solution, please send this template file together.

Last edited by Jingwood (2015-09-26 00:18:41)

Offline

#20 2015-10-06 07:42:38

cloud168
Member
Registered: 2015-09-03
Posts: 13

Re: Urgent question about referencing

sir sorry for the very late reply, here's what I was doing in order to check if it was saving

1. I'm creating a file in reogrideditor and placing a data/letter in a cell (example, in cell A1 I put the word "test")
2. I'm loading it in runtime via worksheet.Load
3. When I load it, the word "test" that I wrote on reogrideditor is seen on cell A1, I write another word for checking if it was saving, I write "test2" on cell A2.
4. I save the worksheet by clickin a button with worksheet.Save
5. I open the rgf file via reogrideditor, and sadly, the whole sheet was clean like the picture I've shown in my post I've posted above. Edit: The word "test" and "test2" I've written in reogrideditor and via runtime was gone.

My question is, is there a special code for it to work like that sir? sorry for troubling you, or can you create a code that can answer my problem in my step by step problem in this post?
I hope you can help me sir thanks

Last edited by cloud168 (2015-10-06 07:44:08)

Offline

#21 2015-10-09 11:52:15

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

Re: Urgent question about referencing

There is no special code needed for the case you mentioned. Just using worksheet.Load and worksheet.Save should be fine. Please make sure that you're using same version between ReoGridEditor and ReoGrid component, and the latest version is recommended.

Offline

#22 2015-10-14 05:53:38

cloud168
Member
Registered: 2015-09-03
Posts: 13

Re: Urgent question about referencing

OMG. does it have to be same version? where can I download the 0.9.0.0. reogrideditor? I was using the one with the 0.8.5. I think OMG OMG, I think that has to be the problem?

Offline

#23 2015-10-14 06:53:43

alexeyrlx
Moderator
From: CIS
Registered: 2015-07-14
Posts: 36
Website

Re: Urgent question about referencing

cloud168,
1. Go to https://reogrid.net/download/
2. Download ReoGrid-0.9.0.0-Beta-Build.zip
3. In the package find  "ReoGrid-0.9.0.0-Beta-Editor-Source.zip"
4. Unpack it and build into Visual Studio 2013
5. And you have Reogrid Editor 0.9.0.0
;-)


My English is perfect! (My version of the English language ;-) )

Offline

Board footer

Powered by FluxBB