I need sample to handle the following scenarios :
ASP.NET WEBFORM Grid
Three columns: 2 columns are bound check box field and one column is bound string field with text editor. One check box column is read only.
On the client side events should handle the following :
1. On grid initializing: when both check boxes are the same the text field has gray background and disabled(not editable), otherwise it is editable and has white background.
2. When read/write check box changes then if both check boxes in the same row the same – text field in that row cleared and gray and disabled, if check boxes in the same row different – the text field background became white and text could be entered
Please provide simple running sample in 14.1
Hello mcseidel,
I am glad that I've managed to help you.
I hope that other community members will also benefit from your findings.
Thanks.. it works, somehow I found that this is working too .. :
g.get_rows().get_row(i).get_cellByColumnKey("Comment").get_element().style.backgroundColor = '#d6d6d6'
Thank you for contacting us.
Below you will find a working sample that is showing how to change cell style (from the client and server).
You can access the cell and from there to get the html element.
to be more precise I need to change background color of the CELL on the client ( not on the server ) in the CellValueChanged event event : function wdgMBA_Editing_CellValueChanged(sender, eventArgs)
Thanks.
Actually I do not need the whole grid and all related to disable / enable .. what I need is css for background and foreground of the cell, i.e.
I am in the event and have the following references to the cell :
var comm = row.get_cellByColumnKey("Comment");
and also for the editor :
var behaviors = grid.get_behaviors(); var editingCore = behaviors.get_editingCore(); var editingBehaviors = editingCore.get_behaviors(); var cellEditingBehavior = editingBehaviors.get_cellEditing();var commEditingColumnSetting = cellEditingBehavior.get_columnSettingFromKey("Comment");
At this point how to change background color of the cell comm and/or corresponding editor commEditingColumnSetting
please show css class with selectors and where to assign it so the background/foreground of one cell in a row will change.
Thanks