.NET

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

Alter Table Row Type with VB.NET

493 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 (484 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
Distinguished Contributor
khoa.ho
Posts: 149
Registered: ‎09-15-2011
Message 3 of 6 (482 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 (469 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 (465 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 (429 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.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community