Author Topic: Tables and Read Only Text  (Read 2532 times)

0 Members and 1 Guest are viewing this topic.

tjr

  • Guest
Tables and Read Only Text
« on: September 22, 2008, 07:11:51 PM »
I'm using a table to draw out the BOM from an app I'm working on. My issue is I don't want people to be able to edit the table directly and think that they're editing the BOM, they need to go through my program. I had solved this problem by taking the table and converting it to a block. This worked out well but today I came across the dynamic break thing on tables and I want users to be able to use that feature on the BOM's my program outputs.

My question is how can one go about making table fields uneditable if it's even possible. Has anyone done anything like this before?

mohnston

  • Bull Frog
  • Posts: 305
  • CAD Programmer
Re: Tables and Read Only Text
« Reply #1 on: September 24, 2008, 04:16:30 PM »
Try something like:

Code: [Select]
            // LOCK EVERY CELL

            tbl.SetCellState(0, 0, CellStates.ContentReadOnly);
            for (int r = 1; r < tbl.NumRows; r++)
            {
                for (int c = 0; c < tbl.NumColumns; c++)
                {
                    tbl.SetCellState(r, c, CellStates.ContentReadOnly);
                }
            }
It's amazing what you can do when you don't know what you can't do.
CAD Programming Solutions

tjr

  • Guest
Re: Tables and Read Only Text
« Reply #2 on: September 25, 2008, 11:26:08 AM »
Try something like:

Code: [Select]
            // LOCK EVERY CELL

            tbl.SetCellState(0, 0, CellStates.ContentReadOnly);
            for (int r = 1; r < tbl.NumRows; r++)
            {
                for (int c = 0; c < tbl.NumColumns; c++)
                {
                    tbl.SetCellState(r, c, CellStates.ContentReadOnly);
                }
            }

Don't know how I missed this yesterday. Thanks for the solution. Was able to figure it out this morning while digging through the help files from the ObjectARX 2008 SDK. I am marking them read only when I programatically fill in the content.

Thanks again.