StrataFrame Forum

How to use ChildFormParameters on version 1.7.0.7

http://forum.strataframe.net/Topic26704.aspx

By Edhy Rijo - 3/30/2010

#8 Child Form constructor parameters exposed in the OnBeforeChildFormExecuted event of a ListView



A new event argument parameter in the OnBeforeChildFormExecuted event called ChildFormParameters. By adding parms to this collection they will be passed on to the calling of the ChildFormDialog like this: ChildForm.ShowDialog(ChildFormParameters.ToArray()). This gives the developer the ultimate control in automation of a child form call through a ListView.




Hi Trent/Dustin,



Could you please provide a sample code on how to pass the parameter to the ChildFormDialog?



I checked the e.ChildFormParameters in the ListView.BeforeChildFormExecuted but this property is ReadOnly and also I don't now how I would add the parameters I need to send to the ChildFormDialog.
By Edhy Rijo - 3/30/2010



#5 StrataFrame ListView now supports cell level backcolors



Each cell of a StrataFrame ListView has a BackgroundColor property allowing the background color to be overwritten for that individual cell.



#6 StrataFrame ListView now has an AdditionalItemHeight property



A property has been added at the ListItem (not sub item) level of a StrataFrame ListView allowing any individual row to have additional height added. This can come in very handy when showing a value that may have multiple rows (i.e. an address). This adds the specified number of pixels to the ItemHeight of the row. This can also be used in situations where a larger font and text may need to be used to exagerate a row.




Also on the same update, steps 5 & 6 I understand that these changes refer to the current StrataFrame Listview not the StrataListView in beta. I could not find a way to access a cell to change its background or the AdditionalItemHeight property. Could you please provide quick sample code or more specific detail on how to start using those new features?



Thanks.



P.S.

Improvement added to the DDT are very nice specially the copy, paste, undo via the context menu. Thanks!!!!
By Edhy Rijo - 4/1/2010

Hi Trent, Dustin,



Perhaps this thread has been missed Cool
By Edhy Rijo - 4/5/2010

Hummm, I wonder if somebody is listening....? BigGrin



Hello Texas, anybody home? Hehe
By Dustin Taylor - 4/5/2010

My bad Smile.

Attached is a sample of these items. In short:

Child Form Dialog Parameters

You simply pass a comma seperated list of values in the ShowDialog method, and format the constructor of the child dialog to match the values you pass.

So, on the parent:

childFormDialog1.ShowDialog("test",1);

Which means the constructor of the child should look like:

public MyDialog(string MyFirstParameter, int MySecondParameter)
{
    InitializeComponent();
   
    //-- Do something with the parameters
    this.Text = MyFirstParameter;
    cboMyCombo.SelectedIndex = MySecondParameter;
}

StrataListView Enhancements

Both of these are simply properties of the StrataListViewSubItem and StrataListViewItem respectively.  Here is a block of code from the attached sample app that demonstrates this:

  _Item = new StrataListViewItem("Green", "");
  _Item.AdditionalItemHeight = 20; //-- Here is the additional height
  _SubItem = new StrataListViewSubItem();
  _SubItem.BackgroundColor = Color.DarkGreen;  //-- Here is the background color
  _SubItem.TextColor = Color.White;
  _SubItem.Text = "Value 3 - Additional height to show               Two rows of text.";
  _Item.SubItems.Add(_SubItem);
  slvMyListview.Items.Add(_Item);

Hope it helps!

By Edhy Rijo - 4/5/2010

Hi Dustin,



I have not check the sample file yet, will do so in a minute, but want to clarify that I am using a SF ListView with the automation and the listview will call the ChildFormDialog internally, how do I pass the parameters in my form to the Listview so it will be pass to the internal ChildFormDialog in the listview?



As I said in the original message, the e.ChildFormParameters in the ListView.BeforeChildFormExecuted is ReadOnly.



Also if possible next time, use VB code instead of C#Hehe
By Edhy Rijo - 4/5/2010

Dustin Taylor (04/05/2010)


StrataListView Enhancements



Both of these are simply properties of the StrataListViewSubItem and StrataListViewItem respectively. Here is a block of code from the attached sample app that demonstrates this:




Hi Dustin,



After looking at the sample I noticed that you said these properties are for the new StrataListView not the SF ListView as listed in the release documentations, that is why I was looking at the wrong control.



Please you have to add the automation feature in the current SF ListView to the new StrataListView so we can start replacing the old one with the new one and be able to provide test feedback. In my case I use the SF ListView in most of my forms and it would be challenge to manually update all the population settings and childform automations to the new StrataListView.



P.S.

Thanks for the sample, pretty interesting approach. Hope you can clarify my previous thread about ChildFormDialog parameters using the SF ListView automation features.
By Edhy Rijo - 4/7/2010

Hello again, anybody home???? BigGrin
By Edhy Rijo - 4/12/2010

another bump here....BigGrin
By Trent L. Taylor - 4/12/2010

Edhy,



I assume that you are just wanted to know when we are going to add the automation logic, right? If that is the case, then we will be doing this before the final release of 1.7.0.0. We have a need for this as well, but this control has grown so much that we didn't want to do add this until it was not so fluid in enhancements.
By Edhy Rijo - 4/12/2010

Hi Trent,



Glad to see you back!



No, it is not that, I cannot see how to use the new childFormDialog parameters with the current SF ListView automation.



If you don't mind, please read the thread since I explained this several times but guess was not understood.
By Trent L. Taylor - 4/12/2010

Also on the same update, steps 5 & 6 I understand that these changes refer to the current StrataFrame Listview not the StrataListView in beta. I could not find a way to access a cell to change its background or the AdditionalItemHeight property. Could you please provide quick sample code or more specific detail on how to start using those new features?




No, this is in regards to the new SF ListView, not the old one. I can provide a sample, but this is for the new list view.



As I said in the original message, the e.ChildFormParameters in the ListView.BeforeChildFormExecuted is ReadOnly.




It is supposed to be readonly, it is a collection. You don't override the collection instance, you add items to it:



CSharp



int myParm2 = 2;



e.ChildFormParameters.Add("MyParm1");

e.ChildFormParameters.Add(myParm2);




VB.NET



Dim myParm2 As Integer = 2



e.ChildFormParameters.Add("MyParm1")

e.ChildFormParameters.Add(myParm2)

By Edhy Rijo - 4/12/2010

Trent L. Taylor (04/12/2010)


No, this is in regards to the new SF ListView, not the old one. I can provide a sample, but this is for the new list view.




Thanks but Dustin already provided a sample on this one clarifying that it was referring to the new StrataListView.



Thanks for the sample code for the parameters, it is very simple now.
By Trent L. Taylor - 4/12/2010

Thanks for the sample code for the parameters, it is very simple now.





Good deal. Sorry for any confusion! Smile
By Edhy Rijo - 4/12/2010

Hi Trent,



Just to let you know that I tested the ChildFormParameters feature and it works just great.



Thanks again for the addition of this feature, it does makes my life easier. Hehe
By Trent L. Taylor - 4/12/2010

Awesome! Glad to hear it!! Smile