.NET

Reply
Member
mjsevern
Posts: 3
Registered: ‎08-14-2012
Message 1 of 6 (531 Views)

Alter Table Row Type with VB.NET

531 Views, 5 Replies
08-14-2012 06:47 AM

Hi there,

 

I am new to developing for AutoCAD. I am using VB.NET to create a table, as standard the first row of the table is a Title row, I want to change this to a data row.

 

Please can someone tell me how to do this?

 

Many thanks,

 

Michael

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 2 of 6 (522 Views)

Re: Alter Table Row Type with VB.NET

08-14-2012 07:37 AM in reply to: mjsevern

Try to create table with number of rows on 2 rows more, then

delete first two rows (make sure that it was the title and header rows)

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Mentor
khoa.ho
Posts: 219
Registered: ‎09-15-2011
Message 3 of 6 (520 Views)

Re: Alter Table Row Type with VB.NET

08-14-2012 07:43 AM in reply to: mjsevern

In my code practice, I also have to remove the first title row after inserting the second data row below (the header and data rows have the same number of columns). The following code snippet will help:

 

table.InsertRows(1, table.RowHeight(0), 1)
table.DeleteRows(0, 1)

 

-Khoa

Member
mjsevern
Posts: 3
Registered: ‎08-14-2012
Message 4 of 6 (507 Views)

Re: Alter Table Row Type with VB.NET

08-14-2012 08:30 AM in reply to: khoa.ho

Thanks for getting back to me guys, I have done what is suggested and the row is being inserted then the top one being deleted, however the top row is still a title row.

 

I have checked and when it is inserted it is a data row, but once the top one is deleted it becomes a title row.

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 5 of 6 (503 Views)

Re: Alter Table Row Type with VB.NET

08-14-2012 08:41 AM in reply to: mjsevern

Another way to set style for every rows:

 

for (int n=0 to tbl.Rows.Count-1)

{

tbl.Rows[n].Style = "Data";

}

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Member
mjsevern
Posts: 3
Registered: ‎08-14-2012
Message 6 of 6 (467 Views)

Re: Alter Table Row Type with VB.NET

08-17-2012 01:49 AM in reply to: mjsevern

Thanks again for the help, in the end the probelm was solved when I inserted the data in to the table, the header row sorted itself out and became a data row. Not sure why but ultimately got the result I wanted.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.