Can I and how do I control the initial row value of a UocDropDownList RCDC control?

I am populating a DropDownListBox via a lookup of FIM objects.

My createUser rcdc has near the top the line

<my:ObjectDataSource my:TypeName="UocSearchDataSource" my:Name="search"/>

I created a reference attribute departmentRef and bound it to User type objects.

I have a custom Resource called CostCenters.

I am populating my dropdownlist control with this code:

      <my:Control my:Name="departmentRef" my:TypeName="UocDropDownList" my:Caption="Tulosyksikk" my:Description="{Binding Source=schema, Path=departmentRef.Description}" my:RightsLevel="{Binding Source=rights, Path=departmentRef}">
        <my:Properties>
            <my:Property my:Name="Required" my:Value="True"/>
            <my:Property my:Name="Columns" my:Value="40"/>
            <my:Property my:Name="ItemSource" my:Value="{Binding Source=search, Path=CostCenters}"/>
            <my:Property my:Name="SelectedValue" my:Value="{Binding Source=object, Path=departmentRef, Mode=TwoWay}"/>
        </my:Properties>
      </my:Control>

I am very surprised to see the initial row of my List of Options being set to "<Please select an item>"

When I expand the list I see all my CostCenters beneath this "<Please select an item.>" row.

BUT, How do I get rid of this "<Please select an item>"?

I would like either a NULL initial row or the first real CostCenter.

What am I doing wrong?

Should the create rcdc not have the selectedvalue property? I am baffled where this <Please select an item> string comes from!

*HH

January 13th, 2015 2:28pm

This works for me.  It defaults to the first item on the list.

<my:Control my:Name="departmentRef" my:TypeName="UocDropDownList"
my:Caption="Tulosyksikk" my:Description="{Binding Source=schema, Path=departmentRef.Description}"  my:RightsLevel="{Binding Source=rights, Path=departmentRef}">
       
 <my:Properties>
         
  <my:Property my:Name="Required" my:Value="true"/>
         
  <my:Property my:Name="ValuePath" my:Value="Value"/>
         
  <my:Property my:Name="CaptionPath" my:Value="Caption"/>
         
  <my:Property my:Name="HintPath" my:Value="Hint"/>
         
  <my:Property my:Name="ItemSource" my:Value="{Binding Source=schema, Path=departmentRef.LocalizedAllowedValues}"/>
         
  <my:Property my:Name="SelectedValue" my:Value="{Binding Source=object, Path=departmentRef, Mode=TwoWay}"/>
       
 </my:Properties>
     
</my:Control>

Best,

Nosh

Free Windows Admin Tool Kit Click here and download it now
January 22nd, 2015 2:13am

I would hope that in your case it would since you are hand feeding a static list of values to be used into the Dropdownbox control.

What I am surprised by is when we load the values from resource objects e.g. TimeZones, CustomResources like cost centers and so on. Note the source of the bound items! mine is search yours is schema.

I use the same logic as the TimeZone drop down box. The TimeZone drop down returns "Default TimeZone" as the first option when expanded. Please check if there is in fact a 'Default TimeZone' in the loaded TimeZone resource objects!

WhereTF do these default strings come from???????

How can I change them to what *I* want them to be????????????

January 27th, 2015 10:16am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics