We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Styling SegmentControl

Hello,

I want to style to segment control that gets rendered in a SfDataForm. 

How do I style SelectionIndicatorSettings and other aspects?

1 Reply

SP Subburaj Pandian Veluchamy Syncfusion Team August 4, 2019 11:26 PM

Hi Mario, 
  
Thank you for contacting Syncfusion support. 
  
We have analyzed your requirement “Customize Segment editor styles in DataForm”. Segment editor styles can be customized using custom DataForm editor. In custom segment editor you can change SelectionIndicatorSettings for the view.  
 
Kindly refer our UG documentation to know more about customizing DataForm editor, 
  
  
Code Snippet: 
        
 public class SegmentEditorExt : DataFormSegmentedEditor 
{ 
     public SegmentEditorExt(SfDataForm dataForm) : base(dataForm) 
     { 
     } 
     protected override void OnInitializeView(DataFormItem dataFormItem, SfSegmentedControl view) 
     { 
        base.OnInitializeView(dataFormItem, view); 
        SelectionIndicatorSettings selectionIndicator = new SelectionIndicatorSettings(); 
        selectionIndicator.Color = Color.Red; 
        view.SelectionIndicatorSettings = selectionIndicator; 
     } 
} 
  
dataForm.RegisterEditor("Segment"new SegmentEditorExt(dataForm)); 
dataForm.RegisterEditor("SaveTo""Segment"); 
  
We have prepared a simple sample for the same, 
 
Sample link: DataForm 
  
We hope this helps. Kindly revert us if you have any concern. 
 
Regards,
Subburaj Pandian V 
 


Loader.
Live Chat Icon For mobile
Up arrow icon