Looking for help with DataGrid
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- jimbobukii
- Posts: 52
- Last visit: Mon Dec 04, 2017 9:59 am
Looking for help with DataGrid
Could anyone point me in the right direction of when I should use DataGrid and how? I have a few lookups which I think could work but need to understand DataGrid
- jimbobukii
- Posts: 52
- Last visit: Mon Dec 04, 2017 9:59 am
Re: Looking for help with DataGrid
I don't understand?jvierra wrote:Here is a good resource. Scroll forward for datagrid
Re: Looking for help with DataGrid
Sorry - the link I posted seems to have disappeared.
Try this: http://www.sapien.com/blog/topics/spotl ... -controls/
Try this: http://www.sapien.com/blog/topics/spotl ... -controls/
- jimbobukii
- Posts: 52
- Last visit: Mon Dec 04, 2017 9:59 am
Re: Looking for help with DataGrid
I don't seem to see any information regarding GridViewjvierra wrote:Sorry - the link I posted seems to have disappeared.
Try this: http://www.sapien.com/blog/topics/spotl ... -controls/
I did check the SpotLights first or am I missing something?
Re: Looking for help with DataGrid
I don't have an article on the DataGridView yet, but it’s on my to-do list.
I recommend referencing the MSDN for help on the control:
DataGridView:
http://msdn.microsoft.com/en-us/library ... dView.aspx
DataGrid:
http://msdn.microsoft.com/en-us/library ... dView.aspx
I also recommend searching the forums, for we have answered variously questions about the control.
David
I recommend referencing the MSDN for help on the control:
DataGridView:
http://msdn.microsoft.com/en-us/library ... dView.aspx
DataGrid:
http://msdn.microsoft.com/en-us/library ... dView.aspx
I also recommend searching the forums, for we have answered variously questions about the control.
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Looking for help with DataGrid
Here is a simple demo that loists processes in a DataGrid:
PowerShell Code
Double-click the code block to select all.$FormEvent_Load={ #TODO: Initialize Form Controls here $arraylist=New-Object System.Collections.ArrayList $skuInfo=get-process $arraylist.AddRange($skuInfo) $datagrid1.DataSource=$arraylist }Most PowerShell objects can just be wrapped in an ArrayList and they will display.
Re: Looking for help with DataGrid
You can use the exact same technique with the DataGridView control.
PowerShell Code
Double-click the code block to select all.$FormEvent_Load={ #TODO: Initialize Form Controls here $arraylist=New-Object System.Collections.ArrayList $skuInfo=get-process $arraylist.AddRange($skuInfo) $datagridview1.DataSource=$arraylist }
- jimbobukii
- Posts: 52
- Last visit: Mon Dec 04, 2017 9:59 am
Re: Looking for help with DataGrid
Thanks for the replies I am now making ground. I do however would like to know if this is possible
I am using the following to get my data:
1. How do I get the datagrid to set colum width to the largest data (not a fixed width)
2. How do I get the datagrid to have an auto width rather than a specified one?
Thank you for your help
I am using the following to get my data:
PowerShell Code
Double-click the code block to select all.$skuInfo= Get-command | Get-subcommand| select one, two, three, four, five, Status | sort -Property four -Descendingso all my columns are generated automaitaclly. I would like to know:
1. How do I get the datagrid to set colum width to the largest data (not a fixed width)
2. How do I get the datagrid to have an auto width rather than a specified one?
Thank you for your help