« RoomEditorApp Plurals and Free Educational Software | Main | Technical Summit Day 1 and Removing RVT References »

June 02, 2014

Comments

Hi Jeremy,
I had the issue with auto-sizing gridview columns also.
I did a little research, and found that it's easier to set it per column (hope this formats okay!):

Public Sub SetDataGridColumnWidthMode(ByVal column As Integer, ByVal mode As DataGridViewAutoSizeColumnMode)
dgData.Columns(column).AutoSizeMode = mode
End Sub

mainForm.SetDataGridColumnWidthMode(2, DataGridViewAutoSizeColumnMode.DisplayedCells)
mainForm.SetDataGridColumnWidthMode(3, DataGridViewAutoSizeColumnMode.Fill)

Dear Matt,

Thank you for the suggestion!

Did you try it out in this case?

I did, and it appears that due to my usage of the DataSource property, I have no columns in that sense.

The Count property of Columns is zero, so attempting to make calls like this throws an exception:

dg.Columns[2].AutoSizeMode
= DataGridViewAutoSizeColumnMode.DisplayedCells;

dg.Columns[3].AutoSizeMode
= DataGridViewAutoSizeColumnMode.Fill;

Cheers, Jeremy.

Hi Jeremy,

Ah, sorry that didn't help. (I didn't test it.)
The thing I used it for was printer devices, their status, and queue length etc (read-only), so a DataTable was a perfect Datasource for that.

From what I read about the column count on the datasource (list) issue, it's to do with late-binding of data - so I guess your solution works best!!

I hope you're having fun in Toronto!

Kind regards,

Matt

Dear Matt,

Thank you for the suggestion, anyway, and for your good wishes!

Cheers, Jeremy.

Hello Jeremy,

I didn't understand the above example completely.
I have questions like: which file are you talking about ? there is no namespace and the filename + extension.

I am a very layman person, just started working 2 days before on Revit 2016.

Need to ask you how to get started with creating a solution (class library / usercontrol library / wpf application) and connect with Revit, there are no proper guidelines for this.

Can you make a layman blog post for me and for the starters.
I am very desperate to learn this tech.

Dear Vipul,

You will be very happy to hear that we have already created a full set of getting started material:

http://thebuildingcoder.typepad.com/blog/about-the-author.html#2

I guarantee that it covers all your needs :-)

Cheers, Jeremy.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name and email address are required. Email address will not be displayed with the comment.)

Jeremy Tammik

AboutTopicsIndexSource