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-08-22 08:59:07

asparatu
Member
Registered: 2014-08-20
Posts: 196

object.BeforeCellEdit and How stop the control from scrolling

Why can i not see the beforecelledit method in vb.net?

That is the code from the c# demo and i want do something like that in vb.net but i can not see the beforecelledit method.

I have imported unvell.reogrid.actions? or is this in another dll file?

private void btnSetEditableRange_Click(object sender, EventArgs ee)
        {
            var editableRange = new ReoGridRange(3, 1, 2, 3);

            grid.SetRangeBorder(editableRange, ReoGridBorderPos.Outline, ReoGridBorderStyle.SolidBlack);

            grid[2, 1] = "Edit only be allowed in this range:";
            grid.BeforeCellEdit += (s, e) => e.IsCancelled = !editableRange.Contains(e.Cell.GetPos()); (how would rewrite that line of code in vb.net?)

            grid.FocusPos = editableRange.StartPos;
        }

and also, How can i stop the control from scrolling with only 2 rows in it?

Thank you
Shane

Last edited by asparatu (2014-08-22 09:20:50)

Offline

#2 2014-08-23 01:55:25

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

Re: object.BeforeCellEdit and How stop the control from scrolling

You could use AddHandler in VB.NET:

Dim range As New ReoGridRange("A1:D3")
AddHandler grid.BeforeCellEdit, Sub(s, eventArgs) eventArgs.IsCancelled = Not range.Contains(eventArgs.Cell.GetPos())

For prevent scrolling, you could disable the scrolling behavior and hide scroll bars:

grid.DisableSettings(ReoGridSettings.Behavior_MouseWheelToScroll Or _
	ReoGridSettings.View_ShowHorScroll Or ReoGridSettings.View_ShowVerScroll)

P.S. I noticed that Behavior_MouseWheelToScroll does not work, please wait the next version to fix this problem.

Last edited by Jingwood (2014-08-23 02:08:42)

Offline

#3 2014-08-23 08:34:40

asparatu
Member
Registered: 2014-08-20
Posts: 196

Re: object.BeforeCellEdit and How stop the control from scrolling

ok, thank you again..

For the scroll bar or mouse scroll you can limit the space on the bottom of the grid just to be very last row and have no padding..

Shane

Offline

Board footer

Powered by FluxBB