Hi Team,
I have a webdatagrid where one of column is a dropdown column.
That dropdown column is a multil column dropdown hence what I need to show is an another grid inside the dropdown and selection of row from grid should populate the value and make the row as edited one.
Please find attached image as the exact requirement what I am looking for..
The same has been implemented in Ultrawebgrid but not sure how to do that in WebDatagrid.
Any idea..
Varun
Hello Varun,
I will shortly provide a working sample demonstrating how this can be achieved with WebDataGrid.
Hello,
Please find attached that I have prepared for you. The DropDownEditor for the WebDataGrid uses WebDataGrid as template for the dropdown items. When the user selectes a row in this grid the values are written into the main grid cell. If you use BatchUpdating = true then the cell will receive the proper styling that marks it as "dirty".
Please run it and let me know if you have further questions on the matter.
Regarding your other question - please see a sample code to use for adding dropdown providers from code behind:
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DropDownProvider provider = new DropDownProvider(); provider.ID = "dropdown1"; provider.EditorControl.DropDownContainerWidth = 150; provider.EditorControl.ClientEvents.DropDownOpening = "ChangeTextField"; // provider.EditorControl.ClientEvents. WebDataGrid1.EditorProviders.Add(provider); }
((DropDownProvider) WebDataGrid1.EditorProviders["dropdown1"]).EditorControl.DataSource = populateGrid(); ((DropDownProvider) WebDataGrid1.EditorProviders["dropdown1"]).EditorControl.TextField = "Name"; ((DropDownProvider)WebDataGrid1.EditorProviders["dropdown1"]).EditorControl.ValueField = "Value"; }
If you need to define the Editing behaviors from code behind also you do it in Init event like this:
protected void WebDataGrid1_Init(object sender, EventArgs e) { //instantiate an editing core EditingCore core = new EditingCore(); core.Enabled = true; core.AutoCRUD = false; core.EditingClientEvents.CellValueChanged = "ChangeCellText";
CellEditing editing = new CellEditing(); core.Behaviors.Add(editing); editing.CellEditingClientEvents.EnteringEditMode = "Hey";
//create the column setting for the Dropdown Column EditingColumnSetting setting = new EditingColumnSetting(); setting.ColumnKey = "Value"; setting.EditorID = "dropdown1";
editing.ColumnSettings.Add(setting); WebDataGrid1.Behaviors.Add(core); }
I hope this helps. If you have any further questions on either of both issues, please consider opening a new thread for a new questions. This is recommended by Infragistics' policy as a way to help tracking and searching and enables us to provide better support.
Thanks Hristo for the information.. It helped to implement the feature as desired..
I do have another question, for that I have started a new discussion..
http://www.infragistics.com/community/forums/t/95686.aspx
Regards