G Web Development Software

cancel
Showing results for 
Search instead for 
Did you mean: 

Tree Control column widths

Solved!
Go to solution

Is there a way, other than html or CSS or whatever, to programmatically control the width of the columns in a tree control?

Or, at the very least, make them stay the way they were when the gviweb was last saved?

Message 1 of 4
(1,606 Views)

Hello Mihai, I ran into the same issue.  There is no property that allows a user to control the column width.  I created a simple project that only contained a tree control with 5 columns and a while loop. When the app runs the columns all seem to resize to some default value.  I found a work around by modifying a section of "index.gviweb".  There is a section called <TreeControl> in my example that started out as

<TreeControl AllowSelection="[bool]False" BaseName="[string]Tree" ColumnHeaderVisibility="[SMVisibility]Visible" DataSource="{DataItemBinding Id=aa169a27c19542869751fefd38f35cf7}" DataSourceType="[Type]@8bfd7e5a29ba4234a66c12b3982cdcf3" Height="[float]408" Id="4423087e78a84b03b30d41c02d8c3956" Label="[UIModel]55475799827f44639a60c47736385c85" LabelLinked="[bool]True" Left="[float]132" SelectionMode="[SMTreeSelectionMode]One" TabIndex="[int]0" Top="[float]148" Width="[float]280" xmlns="http://www.ni.com/Controls.LabVIEW.Design">
<TabularControlColumn Id="48f4cc0802e04b998b929b66c8a0c7f3" Width="[double]NaN" />
<TabularControlColumn Id="f4b4fce13a7244bc9b5eb0573c8b0863" />
<TabularControlColumn Id="1546b828b06f4ca8908206ea2bd9ddfa" />
<TabularControlColumn Id="93751ed4c96b409fa01e767e8e74436b" />
<TabularControlColumn Id="7c44f8eb2ccb4453bb42d8227b689c5e" />
<FontSetting FontFamily="Segoe UI" FontSize="9" Id="8797b0637f9b48f8b8347b170e9a93a8" xmlns="http://www.ni.com/PlatformFramework" />
</TreeControl>

 

I modified all of the <TabularControlColumn Id.......> sections to <TabularControlColumn Id...... "Width=[double]50"/> to set my column to 50 px wide. Saved and reloaded the project and now all of the columns are the size I want.

0 Kudos
Message 2 of 4
(1,530 Views)
Solution
Accepted by Mihai

I suppose I should have posted here the solution I found, sorry to be so slack.

 

I found on GitHub Milan's web vi's experiments https://github.com/rajsite/webvi-experiments

I picked up from there a JavaScript which I incorporated in my application and now I can set my tree control's columns programmatically. It should work for everyone else.

Message 3 of 4
(1,506 Views)

@Mihai wrote:

I suppose I should have posted here the solution I found, sorry to be so slack.

 

I found on GitHub Milan's web vi's experiments https://github.com/rajsite/webvi-experiments


I see, thank you for the link,
I also learn a lot from the following link A curated list of awesome WebVIs | LaptrinhX also belongs to Raj Milan.

0 Kudos
Message 4 of 4
(1,475 Views)