Hello,
How can i load the items of the dropdown provider at runtime. I need it to load the current year and last year. Cliend side load is ok as well.
Thanks,
Hello marcgh,
which editor provider you are using DropDownEditorProvider or DatePickerProvider?
If you are using DropDownProvider you can use something like this:
// Enable cell editing this.WebDataGrid1.Behaviors.CreateBehavior<EditingCore>(); this.WebDataGrid1.Behaviors.EditingCore.Behaviors.CreateBehavior<CellEditing>(); // Create an editor provider //DatePickerProvider datePickerProvider = new DatePickerProvider( ); DropDownProvider dropDownProvider = new DropDownProvider(); //Set ID and DataSource dropDownProvider.ID = "DropDownProvider1"; dropDownProvider.EditorControl.DataSourceID = "AccessDataSourceCategories"; dropDownProvider.EditorControl.DataKeyFields = "CategoryID"; dropDownProvider.EditorControl.TextField = "CategoryName"; dropDownProvider.EditorControl.ValueField = "CategoryID"; // Add to collection //this.WebDataGrid1.EditorProviders.Add(datePickerProvider); this.WebDataGrid1.EditorProviders.Add(dropDownProvider); // Create a column setting to use the editor provider EditingColumnSetting columnSetting = new EditingColumnSetting(); columnSetting.ColumnKey = "CategoryName"; // Assign editor for column to use //columnSetting.EditorID = datePickerProvider.ID; columnSetting.EditorID = dropDownProvider.ID; // Add column setting this.WebDataGrid1.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(columnSetting);
Check this samples to see how is implement client binding in WebDropDown:http://samples.infragistics.com/aspnet/Samples/WebDropDown/Data/jQueryClientTemplates/Default.aspx?cn=drop-down&sid=1cd0d5b4-a6c5-45c2-835b-1d8b230dfb18
http://samples.infragistics.com/aspnet/Samples/WebDropDown/Data/BindingToHierarchicalJSON/Default.aspx?cn=drop-down&sid=c9dd40d1-0068-483e-88e0-d6fac427ba2a
Hope this helps
Thank you for the answer but,
I don't want to create a new drop down provider and add it to the grid at runtime. I have a grid setup with a dropdownprovider and using an object data source. All I need is how to find that control when the grid bind to the data source and populate it with data.
Thank you,