Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Create a table with no title/header rows??

Anonymous

Create a table with no title/header rows??

Anonymous
Not applicable

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. 

0 Likes
Reply
3,493 Views
15 Replies
Replies (15)

_Tharwat
Advisor
Advisor

Hi,

Did you try the method mergecells before?

0 Likes

Anonymous
Not applicable
No, I didn't think that merging would be relevant. How would one go about this? Merge the entire row and then set the style after merging?
0 Likes

_Tharwat
Advisor
Advisor

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.

fieldguy
Advisor
Advisor

This might also work.

mytable.Rows[i].Style = "Data";

0 Likes

Anonymous
Not applicable

@_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.

0 Likes

_Tharwat
Advisor
Advisor

Sorry for the confusion but you need unmergecells and not mergecells. 

Anonymous
Not applicable

@fieldguywrote:

This might also work.

mytable.Rows[i].Style = "Data";


Error "eNotApplicable" Smiley Sad

0 Likes

Anonymous
Not applicable

@_Tharwatwrote:

Sorry for the confusion but you need unmergecells and not mergecells. 


Still doesn't seem to be doing anything. Am i supposed to set Style after unmerging?

0 Likes

fieldguy
Advisor
Advisor

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<<?  

0 Likes

Virupaksha_aithal
Autodesk Support
Autodesk Support

Hi,

 

Please try tab.Rows[0].Style = "_DATA";

 



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

0 Likes

Anonymous
Not applicable

@Virupaksha_aithalwrote:

Hi,

 

Please try tab.Rows[0].Style = "_DATA";

 


I'm still getting error "eNotApplicable" when I try to do this. 

0 Likes

Anonymous
Not applicable

@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.

0 Likes

Civil3DReminders_com
Mentor
Mentor

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.

 

 

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
0 Likes

sophia_lee
Autodesk
Autodesk

sophia_lee_0-1721006496671.png

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


Sophia Lee
Global Product Support Specialist
0 Likes

ActivistInvestor
Advisor
Advisor

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.

0 Likes