I've got a radGrid that I've put into edit mode for all rows using the PreRender method (by setting the editableitem.edit property).
It works well...all the rows in the grid are in edit mode...except all the rows are highlighted in the Skin's color (in my case, the Vista skin, so the rows are light blue). All I I want to do is have them show up without the highlight.
So, I've tried editableItem.selected = false, but this does not un-highlight the rows. I've also tried setting the editableItem.style property, all to no avail. What am I missing?
Any advice is appreciated.
Public
Sub EmployeesGrid_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles
EmployeesGrid.ItemCommand
variable = EmployeesGrid.Items(rowIndex 1)("column").Text
EmployeesGrid.Rebind()
End Sub
When the grid is created statically this code isn't a problem, but when it's created programmatically, I get an object not set to an instance of an object error.
I am using a RadGrid with several editor columns, including a CheckBox, DropDownList (RadComboBox style), and a Template column.
When editing, I'm easily able to get a handle on these controls using the following code:
| if (e.Item is GridEditableItem && e.Item.IsInEditMode) |
| { |
| RadComboBox list = (e.Item as GridEditableItem)["MethodColumn"].Controls[0] as RadComboBox; |
| Prometheus.SetRadComboBoxHeight(list,_maxComboBoxItems,_pixelsPerComboBoxItem); |
| list.AutoPostBack = true; |
| list.SelectedIndexChanged += MethodRadComboBox_SelectedIndexChanged; |
| } |
This works in both the ItemCreated event as well as in the ItemDataBound event of the grid. I've also gotten it to work using the GetColumnEditor function.
But, when adding (by simply setting the MasterTableView.IsItemInserted value = true in a RadToolBar button click), this same code above does not work. The GetColumnEditor function returns null, and the method above (...["ColumnName"].Controls[0]) returns a literal object. Is there something specific I need to do for an "Add" in order to get a handle on these controls?
I've spent the better part of a day on this and frankly, I'm stumped.
| lblReason.Text = "<script>RefreshParentPage()</" + "script>"; |
| <script type="text/javascript"> |
| function GetRadWindow() { |
| var oWindow = null; |
| if (window.radWindow) |
| oWindow = window.radWindow; |
| else if (window.frameElement.radWindow) |
| oWindow = window.frameElement.radWindow; |
| return oWindow; |
| } |
| function RefreshParentPage() |
| { |
| GetRadWindow().BrowseWindow.location.reload(); |
| } |
| </script> |