Iron Speed Technical Forums
Register Latest Topics
 
 
 


Reply
  Author   Comment  
brandonfred

Registered:
Posts: 18
Reply with quote  #1 
Does anyone ask this before as I cannot find from the forum?

In my Add page, I have a dropdownlist and I would like to default it to a value.  I have added the value into the "inserting record" from ISD Databases screen.  But it does not default it and it only function when I save the record.

Here is an example in my Add page.

Priority dropdownlist value:
** Please Specify **
High
Medium
Low 

When I access the Add page, "** Please Specify **" is the default value.  How can I set to default it to Medium?  Do I need to code for this case?

Thanks.
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,954
Reply with quote  #2 
You can override the SetColumn() by simply adding this at the end of the Else block:

YourColumnName.SelectedValue = "YourDefaultValue";


Cheers,
Jimi J

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

brandonfred

Registered:
Posts: 18
Reply with quote  #3 
I am using v9.1 and not able to find the SetColumn() in both the aspx.vb and controls.vb files.  Not even in the dropdownlist Code tab area.  I can only see the following functions.

Set()
Populate()
CreateWhereClause()
Validate()
Get()
SelectedIndexChanged()

brandonfred

Registered:
Posts: 18
Reply with quote  #4 
Is there anyone done this before?
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,954
Reply with quote  #5 
You can click on Set() and see that you are actually overriding the SetColumn(). The ColumnName is your control or field name.

I hope that makes clearer.

Cheers,
Jimi J

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

brandonfred

Registered:
Posts: 18
Reply with quote  #6 
Working now. Thanks.
kp6bs

Registered:
Posts: 7
Reply with quote  #7 
Hello JimiJ,

Thank you for your good information.
Your information is very useful for me too.

What do you think about following ways?
I also attached sample data and image files.

1.
Formulas -> Initialize when Adding record

2.
Application Explorer -> Database -> TargetTable
  -> PriorityID -> Display properties -> Default Value
 

 
Attached Files
zip Sample.zip (84.97 KB, 47 views)

JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,954
Reply with quote  #8 
Hi!

Item 1 will work, but it is too static. Unlike doing it through the code, you can add conditions that make it dynamic.

Item 2 will not work because it will be overwritten by a Set() method.


Cheers,
Jimi J

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

kp6bs

Registered:
Posts: 7
Reply with quote  #9 
Hello JimiJ,

Thank you for your good advice.

Thanks,
kp6bs
mackie

Registered:
Posts: 4
Reply with quote  #10 
hi there,

I am new to iron speed.  Can you tell me exactly where you are setting the default value?  I don't know where to go.

thank you

__________________
Lorna
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,954
Reply with quote  #11 
Hi Lorna,

Look at the Set{ColumnName}()  method.  Your default is the selectedValue as in:

  // Populate the item(s) to the control      
            this.PopulateCodeDropDownList(selectedValue, 100); 


Cheers,
Jimi J

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement