×

Notice

The forum is in read only mode.
×
Getting new Releases

To get notified on new releases you may follow us on twitter @expandframework or subscribe in our main RSS feed.

Topic-icon SpinStep for Model Member using any numeric PropertyEditor

  • Sheldmandu
  • Sheldmandu's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
More
2 years 3 months ago #10500 by Sheldmandu
Hi Tolis,

May I suggest adding a "Spin Increment" to Members that use any numeric PropertyEditor (e.g. DecimalPropertyEditor). At present the only way to achieve this is with code and something many people seem to want to set judging by tickets on this topic.

Also, may I suggest setting the default Increment to 0.01 for any members that use an edit mask beginning with lowercase "p" as at present the default behaviour is to increment the value by 100% that most people don't want.
  • Sheldmandu
  • Sheldmandu's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
More
2 years 3 months ago - 2 years 3 months ago #10502 by Sheldmandu
Also, the challenge is to make it work property for both Custom AutoFilter and Autofilter row. To make it work for Detail Forms should be pretty trivial

public class PercentageEditorViewController : ViewController<DetailView>
{

protected override void OnActivated()
{
base.OnActivated();

foreach (DecimalPropertyEditor propertyEditor in View.GetItems<DecimalPropertyEditor>())
{
propertyEditor.ControlCreated += new EventHandler<EventArgs>(propertyEditor_ControlCreated);
}
}

void propertyEditor_ControlCreated(object sender, EventArgs e)
{
SpinEdit spinEdit = ((DecimalPropertyEditor)sender).Control;

if (spinEdit.Properties.EditMask.Substring(0, 1) == "p")
{
spinEdit.Properties.Increment = 0.01m;
}
}

protected override void OnDeactivated()
{
base.OnDeactivated();
foreach (IntegerPropertyEditor propertyEditor in View.GetItems<IntegerPropertyEditor>())
{
propertyEditor.ControlCreated -= new EventHandler<EventArgs>(propertyEditor_ControlCreated);
}
}
}
Last edit: 2 years 3 months ago by Sheldmandu.
More
2 years 3 months ago #10506 by Tolis
in windows its already to configure the controls as
<DetailView Id="Class1_DetailView">
  <Items>
    <PropertyEditor Id="Age">
      <RepositoryItems>
        <RepositoryItemSpinEdit Id="@2fc234fd-6fb5-4d8d-a8ce-20e48b99b924" Increment="10" IsNewNode="True" />
      </RepositoryItems>
    </PropertyEditor>
  </Items>
</DetailView>

depending on the case for web and from next minor one could configure any instance of SpinEdit as
<Application>
  <ModelAdapterContexts>
    <ModelAdapters Id="Default">
      <ASPxSpinEditControl Id="ASPxSpinEditControl" LargeIncrement="100" Increment="0.5" />
    </ModelAdapters>
  </ModelAdapterContexts>

</Application>

are those tools enough to help you with your requirements?

To get notified on new releases follow us on twitter @expandframework or subscribe RSS feed. I am also available @tolisss . Also see How to debug eXpand
Moderators: expand
Time to create page: 0.387 seconds