Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about the control #1

Open
cvarelae opened this issue Oct 17, 2014 · 8 comments
Open

Questions about the control #1

cvarelae opened this issue Oct 17, 2014 · 8 comments

Comments

@cvarelae
Copy link

Hello,

first of all, congratulations for this amazing control and thanks you for sharing with us.

I have a couple of questions:

  • Could i do something like this? (fixed text at left, and scrollable text on the top with the grid):

gridsample

  • i want to know in which cell are tapping an user. Is it possible? I would like to change the values of the cells with the keyboard

Thanks a lot for you work and help!

Congrats!

@ericsink
Copy link
Owner

Yes, DataGrid can do the fixed column and header row. Yes, it can do the selection and the notification of the tapped cell. No, it cannot do in-place editing in the cell. Not yet. :-)

Note that DataGrid right now is more like "a framework building data grids" and less like "a ready-to-use data grid". Its API is pretty rough. So far. :-)

@cvarelae
Copy link
Author

Thanks! Your control is so amazing...I'm trying to understand the code.

I would need to edit a cell, and change their background color when is selected and when you introduce a value jump to the next cell.

Any idea, where can i start ?

Thanks again

@ericsink
Copy link
Owner

Sorry -- the code is rather unfriendly right now. I'm working to make it more approachable.

You might want to look in grids.cs for usages of DrawCell_FillRectIfSelected. These show some basic examples of selections, being drawn as a partially transparent layer overlay.

@cvarelae
Copy link
Author

Hello Eric!

I came back to do tests with your code. I'm trying to do a version of your trivialgrid to modify values on the grid. But... i don't know how I could paint only a known cell on the main panel when the grid is totally displayed.

Can you help me, please?

Thanks a lot again!

@ericsink
Copy link
Owner

Note that I have stopped work on this code base (in favor of a completely
different approach to the same problem) and I don't know if or when I might
return to it.

If you're asking about how to do the UI for in place editing, the answer is
that this code cannot do that.

If you're asking how to tell the grid to redraw just one cell in trivial
grid...

The cells array is hooked up using a all to valuepercell_fromdelegates. The
object that it returns contains an event called changed. You need to
trigger this event with the coords of the cell you want to redraw.

E

On Thursday, November 20, 2014, cvarelae notifications@github.com wrote:

Hello Eric!

I came back to do tests with your code. I'm trying to do a version of your
trivialgrid to modify values on the grid. But... i don't know how I could
paint only a known cell on the main panel when the grid is totally
displayed.

Can you help me, please?

Thanks a lot again!


Reply to this email directly or view it on GitHub
#1 (comment)
.

@cvarelae
Copy link
Author

First of all, Thanks you very much for answering and helping me.

I achieve to change the text of a cell in 2 steps:

  • Changing the value in the array. For example: Cells[0,0] = "150"
  • Notify the change of the cell. Example: text.notify_changed(0,0);

I don't want to disturb you more.. I want to ask you the last thing:
Could i change the backcolor and textcolor of an only cell?

Thanks you again in advance!

@ericsink
Copy link
Owner

Trivial grid was not designed to allow per-cell format changes.

In trivial grid, notice this line:

var fmt = new ValuePerCell_Steady

and this one:

var fill_white = new ValuePerCell_Steady<CrossGraphics.Color>
(CrossGraphics.Colors.White);

These use ValuePerCell_Steady, which means that they will return the same
thing for all cells.

If you want to change the backgroundcolor and textcolor for just one cell,
you'll need these to be a different instance of the ValuePerCell objects.
Like a ValuePerCell_FromDelegates, for example. And you'll have to provide
delegates which return the right thing for each cell. (This will be a
little slower, BTW.)

Some of the other example grids are probably more flexible than trivial
grid is, so you could probably find ideas there.

E

On Thu, Nov 20, 2014 at 9:35 AM, cvarelae notifications@github.com wrote:

First of all, Thanks you very much for answering and helping me.

I achieve to change the text of a cell in 2 steps:

  • Changing the value in the array. For example: Cells[0,0] = "150"
  • Notify the change of the cell. Example: text.notify_changed(0,0);

I don't want to disturb you more.. I want to ask you the last thing:
Could i change the backcolor and textcolor of an only cell?

Thanks you again in advance!


Reply to this email directly or view it on GitHub
#1 (comment)
.

@cvarelae
Copy link
Author

Thanks. I will continue searching a solution hehe ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants