.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Alter Table Row Type with VB.NET

5 REPLIES 5
Reply
Message 1 of 6
mjsevern
1202 Views, 5 Replies

Alter Table Row Type with VB.NET

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

5 REPLIES 5
Message 2 of 6
Hallex
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
Message 3 of 6
khoa.ho
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

Message 4 of 6
mjsevern
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.

Message 5 of 6
Hallex
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
Message 6 of 6
mjsevern
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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost