Documentation / Tutorials

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
This topic is 12 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
wallen
Posts: 18
Last visit: Fri Mar 15, 2013 9:36 am

Documentation / Tutorials

Post by wallen »

I can't seem to find any documentation or Tutorials for Primalforms (Trial), other than the Quick Guide for the Community version... which isn't very helpful. Is there any manuals or anything? The Sapien Document Explorer doesn't seem to show the "Product Documentation Help" as the front page says it should. And the Primal Forms folders with "samples" doesn't do me much good without knowing how to use the product. Any info is appreciated. Thanks.
User avatar
wallen
Posts: 18
Last visit: Fri Mar 15, 2013 9:36 am

Documentation / Tutorials

Post by wallen »

Whoops. I just found a similar thread a few posts down.I'll try the suggestion of downloading the 2009 product's help files.
User avatar
wallen
Posts: 18
Last visit: Fri Mar 15, 2013 9:36 am

Documentation / Tutorials

Post by wallen »

I seem to have run into a snag with the data grid example.

The following code loads a list of computers (Computer, Description) into a data grid... Everything works except the "Connect Button"

I have determined it is the line

$Row = $datagridviewResults.CurrentRowIndex
Trying to obtain the "CurrentRowIndex" results in a NULL value.
If I manually put in an integer for $Row... the computer in that row is chosen and works.

By looking at a few examples... I'm not sure what I'm doing wrong.

--------------------------------------------------------
Code:
--------------------------------------------------------

function OnApplicationLoad {
#Note: This function is not called in Projects
#Note: This function runs before the form is created
#Note: To get the script directory in the Packager use: Split-Path $hostinvocation.MyCommand.path
#Note: To get the console output in the Packager (Windows Mode) use: $ConsoleOutput (Type: System.Collections.ArrayList)
#Important: Form controls cannot be accessed in this function
#TODO: Add snapins and custom code to validate the application load

return $true #return true for success or false for failure
}
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Documentation / Tutorials

Post by davidc »

Ok I see the problem. Please use:$datagridviewResults.CurrentRow.Index
instead of $datagridviewResults.CurrentRowIndex Writing a Spotlight Article on Controls on the DataGridView is on my Todo List. I also recommend reading our blog for PrimalForms articles and examples. David
David
SAPIEN Technologies, Inc.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Documentation / Tutorials

Post by davidc »

For Control Help you can Right Click on the control in the designer and use the context menu: Help -> MSDN HelporHelp -> View Spotlight Article (if the article exists) David
David
SAPIEN Technologies, Inc.
User avatar
wallen
Posts: 18
Last visit: Fri Mar 15, 2013 9:36 am

Documentation / Tutorials

Post by wallen »

Wow! it was a syntax error afterall???

I got the Data Grid example from a March 22 2010 Article, from Microsoft's "Hey, Scripting Guy!"... and I'm looking at the print out right now... and it says .CurrentRowIndex, not .CurrentRow.Index (which did fix the problem)

Also
http://msdn.microsoft.com/en-us/library ... ex.aspx#Y0

shows it as "CurrentRowIndex"... so I hope you can see why I thought my syntax was correct.

As my link shows, I did try MSDN... however they only have C++, C#, and VB examples. No Powershell. Also, there doesn't seem to be a way for me to test / look-up syntax as there is within the Powershell console by piping a command to "Get-Member".

So I'm not sure how I was supposed to know it was "CurrentRow.Index", nor how to translate any future MSDN lookup into Powershell syntax.

Any tips on that would be appreciated.

For your Data Grid Blog, given the simple code above... how would I add a double click event on a cell? A right-click event with a menu? Execute action on multiple selected? Turn on sorting? Pop Up an Error message or Dialog box?

If you could include those things in your up coming Data Grid blog, it would be most helpful.

Thanks.wallen2012-02-13 16:10:22
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Documentation / Tutorials

Post by davidc »

There are two grid controls in WinForms: DataGrid and DataGridView. In this case you are viewing the help for the DataGrid control, but are using the DataGridView, which doesn't have the CurrentRowIndex property. It is an easy mistake to make when you are not familiar with the form controls.Note the DataGridView is the newer control of the two. MSDN doesn't have any PowerShell code, but the C# code is fairly easy to convert to PowerShell since the syntax is pretty close. To add a double click event to the cell do either of the following:1. Select the control in the designer2. Go to the property Pane and click on the Events button (Lighting blot icon). 3. Scroll down till you find the CellDoubleClick event and double click it. Alternative: 1. Select the Grid in the designer2. Press Ctrl +E or use context menu->Add Events3. Check the CellDoubleClick event and press the Create button. Note the alternate method allows you to create multiple events at once. David
David
SAPIEN Technologies, Inc.
User avatar
wallen
Posts: 18
Last visit: Fri Mar 15, 2013 9:36 am

Documentation / Tutorials

Post by wallen »

Thanks for spotting my error and confusion.

Obviously, I will have to learn the difference between the two controls.

After looking at the MSDN help for Datagridview and CurrentRow... may I ask why it's .CurrentRow.Index, and not just .CurrentRow? Now I'm not sure where the "Index" part is coming from.

Thanks for the double click tip... that worked good. :)
wallen2012-02-13 18:14:48
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Documentation / Tutorials

Post by davidc »



The
CurrentRow property returns the Row object [DataGridRow], which contains the all
the cells in the row. In your case, you only need the row number, so that you
match it to your data. Therefore you need to use the CurrentRow.Index,
which returns a numeric value. Index is a property of the DataGridRow object. David

David
SAPIEN Technologies, Inc.
User avatar
wallen
Posts: 18
Last visit: Fri Mar 15, 2013 9:36 am

Documentation / Tutorials

Post by wallen »

Well, I understand that there are more properties and perhaps methods of the Property "CurrentRow" of the Class "DataGridView"... But I don't understand how you find them. Since MSDN seems to be the resource that I need to rely on for PrimalForms... looking at this page: http://msdn.microsoft.com/en-us/library ... ntrow.aspx Says nothing about further properties or methods. So, not trying to be a pain... but without something like piping to get-member, how am I supposed to find these deeper properties? Thanks Again. You are most helpful.
wallen2012-02-14 09:57:54
This topic is 12 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.