I'm trying to create a simple table with no title or header rows, only data rows.
First i tried IsTitleSuppressed & IsHeaderSuppressed, but those give me a warning message saying they "are obsolete, use Cell Functionality instead"
Ok, not entirely sure what they mean by "cell functionality" so i tried the method listed here - http://through-the-interface.typepad.com/through_the_interface/2011/11/handling-protocol-changes-to-...
"Next we have the third set of warnings, which relate to suppression of the title and header rows. These are also at the Cell level, but are also a bit tricky to get access to. You need to get the Cells for the row (passing in the row number and -1, for the column) and get/set the Style property. This string property should contain “Title” for title rows and “Header” for header rows. If you want to suppress the title – the equivalent of Table.IsTitleSuppressed = true), you can search through for the row containing “Title” in its Style property, and set it to the empty string (“”). And the equivalent operation for the header row."
That doesn't work either. If i set it to an empty string nothing changes and if i set the string to "Data" I get an error saying "eNotApplicable". I also tried setting myTable.Rows[1].Style, that didn't work either. Can i get some help here please? I've spent hours on this already and I still haven't been able to get it to work. Thank you.
eg:
CellRange range = CellRange.Create(tbl, 0, 0, 0, 2); tbl.MergeCells(range);
Where tbl is the table object and 2 is the number of columns.
Try it and let me know.
@_Tharwatwrote:eg:
CellRange range = CellRange.Create(tbl, 0, 0, 0, 2); tbl.MergeCells(range);Where tbl is the table object and 2 is the number of columns.
Try it and let me know.
I tried it but nothing seems to have changed. The first line of the table is still Title and the second line is Header. After that I tried changing range.Style and that doesn't seem to work either.
Sorry for the confusion but you need unmergecells and not mergecells.
Hi,
Please try tab.Rows[0].Style = "_DATA";
@Virupaksha_aithalwrote:Hi,
Please try tab.Rows[0].Style = "_DATA";
I'm still getting error "eNotApplicable" when I try to do this.
@fieldguywrote:Sorry - after re-reading I see in your 1st post you tried mytable.Rows[i].Style = "Data".
I also use mergecells (not unmerge) and it occurs after setting the style.
I remember finding quite a few samples in the web but I didn't save the urls. Have you seen >>this<<?
Hmm thanks for the link. I was trying to use the standard table style instead of creating a new one from scratch but I'm out of ideas at this point. I'll give that a try this weekend.
It would be really nice if there was a simple option for this like IsTitleSuppressed & IsHeaderSuppressed though, or at least some better documentation from Autodesk on how we're supposed to do this without those.
Looks like the table style needs to be set before setting the individual row or cell style.
tble.TableStyle = tblStyle.ObjectId;
I came here via Google and I suspect I'd be back here again in the future when I copy code from one project to another and neglect to copy over all of the code, hence this comment on this old post.
It looks like all of the other suggestions are correct and didn't notice the table style wasn't being set first.
When creating a table, change the first row cell and second row cell style to data, then it won't create a table with header or title. hope this helped! thanks
I think the original poster is asking about how to do this in code, not through the user interface.
BTW, going through the UI, one must also change the height of the first row.
Can't find what you're looking for? Ask the community or share your knowledge.