Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
620
programmatically create dropdownprovider
posted

I need to programmatically create editor providers.  Is that possible?  I will be creating dropdown, datepicker, numeric and percent providers.   If possible, can you provide some example code in VB?  Thanks!

Parents
No Data
Reply
  • 19693
    posted

    Hello kpjgpm ,

    Please refer to the documentation regarding editor providers in WebDataGrid

    You may use the same approach in the WHDG too:

    http://help.infragistics.com/NetAdvantage/ASPNET/2010.3?page=WebDataGrid_Using_Editor_Providers.html

    For example :

    In Visual Basic:

    ' Enable cell editing 
    Me.WebDataGrid1.Behaviors.CreateBehavior(Of EditingCore)() 
    Me.WebDataGrid1.Behaviors.EditingCore.Behaviors.CreateBehavior(Of CellEditing)() 
        
    ' Create an editor provider 
    Dim datePickerProvider As New DatePickerProvider() 
    datePickerProvider.ID = "DatePickerProvider1" 
        
    ' Add to collection 
    Me.WebDataGrid1.EditorProviders.Add(datePickerProvider) 
        
    ' Create a column setting to use the editor provider 
    Dim columnSetting As New EditingColumnSetting() 
    columnSetting.ColumnKey = "RequiredDate" 
        
    ' Assign editor for column to use 
    columnSetting.EditorID = datePickerProvider.ID
        
    ' Add column setting 
    Me.WebDataGrid1.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(columnSetting) 
    
    Let me know if you need further assistance
Children