protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridEditFormItem && e.Item.IsInEditMode) { GridEditFormItem editItem = (GridEditFormItem)e.Item; TextBox txtpwd = (TextBox)editItem["password"].Controls[0]; txtpwd.TextMode = TextBoxMode.Password; if (!(e.Item.DataItem is GridInsertionObject)) { txtpwd.Attributes.Add("value", txtpwd.Text); } } }<telerik:RadGrid GridLines="none" ID="RadGrid1" runat="server" AllowMultiRowSelection="true" AllowPaging="true" AllowCustomPaging="true" AllowSorting="true" AllowAutomaticDeletes="true" AutoGenerateColumns="true" ShowStatusBar="false" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCommand="RadGrid1_ItemCommand" OnGroupsChanging="RadGrid1_GroupsChanging" OnColumnCreated="RadGrid1_ColumnCreated" OnDataBound="RadGrid1_DataBound" OnSortCommand="RadGrid1_SortCommand" OnItemCreated="RadGrid1_ItemCreated" OnPreRender="RadGrid1_PreRender" HorizontalAlign="NotSet" Visible="false"> <ClientSettings AllowColumnHide="true" AllowColumnsReorder="true" AllowDragToGroup="true" ReorderColumnsOnClient="true" AllowKeyboardNavigation="true" AllowRowsDragDrop="true" AllowAutoScrollOnDragDrop="false" EnablePostBackOnRowClick="false" EnableRowHoverStyle="true"> <Resizing AllowColumnResize="true" EnableRealTimeResize="true" ResizeGridOnColumnResize="true" /> <Selecting AllowRowSelect="true" /> <Scrolling UseStaticHeaders="true" SaveScrollPosition="true" AllowScroll="true" /> <ClientEvents OnRowContextMenu="RadGrid1_RowContextMenu" OnRowDropping="RadGrid1_RowDropping" OnActiveRowChanged="RadGrid1_ActiveRowChanged" OnRowSelected="RadGrid1_RowSelected" OnRowDblClick="RadGrid1_RowDblClick" OnKeyPress="RadGrid1_KeyPress" OnCommand="RadGrid1_Command" OnRowClick="rowClick" OnRowMouseOver="RowMouseOver" OnRowMouseOut="RowMouseOut" OnMasterTableViewCreated="RadGrid1_MasterTableViewCreated" /> </ClientSettings> <MasterTableView AllowMultiColumnSorting="false" DataKeyNames="ID,Unread,FolderPath" Width="100%" ClientDataKeyNames="ID,Unread,FolderPath" TableLayout="Fixed"> <PagerStyle Mode="NextPrevNumericAndAdvanced" PageButtonCount="3" AlwaysVisible="true" /> </MasterTableView> </telerik:RadGrid>function RadGrid1_RowSelected(sender, eventArgs){ var mst = sender.get_masterTableView(); var index = eventArgs.get_gridDataItem().get_element().rowIndex;}After a lot of searching and hair pulling I have tracked down what seems to be a real deal breaker issue with a lot of rad controls especially radgrid, sorry for the vagueness of this post but it has been a long few days of deadlines :)
When using IE11 preview to view sites with enablepostbackonrowclick set on a radgrid - clicking on the rows does not work and rather raises a hidden away JavaScript error of: if($telerik.isIE){document.attachEvent("onmousedown",this._onDocumentClickDelegate);
The problem is particular to IE11 and it is not just related to it being in preview.
It is discussed at http://msdn.microsoft.com/en-us/library/ie/ms536343(v=vs.85).aspx
In this post it says:
Binds the specified function to an event, so that the function gets called whenever the event fires on the object.
So it seems that until there is an update to the core way rad controls handle mouse clicks they will not work even on IE final.
Dim rowStateColumn As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("Comp_ProjectCount") rowStateColumn.CurrentFilterFunction = GridKnownFunction.GreaterThan rowStateColumn.CurrentFilterValue = 0 RadGrid1.MasterTableView.FilterExpression = "([Comp_ProjectCount] > 0 ')" RadGrid1.Rebind()<telerik:RadGrid ID="gridShipmentsToBill" runat="server" Width="100%" DataSourceID="ShipmentsToBill" AllowSorting="True" AutoGenerateColumns="False" GridLines="Vertical"> <ClientSettings EnablePostBackOnRowClick="true" EnableRowHoverStyle="True"> <Scrolling AllowScroll="True" ScrollHeight="500px" UseStaticHeaders="true"></Scrolling> <Selecting AllowRowSelect="true" /> </ClientSettings> <MasterTableView HierarchyLoadMode="ServerBind" DataKeyNames="Shipment_Key" DataSourceID="ShipmentsToBill" RetainExpandStateOnRebind="false"> <Columns> <telerik:GridBoundColumn DataField="Shipment_Key" ReadOnly="True" HeaderText="CPU #" SortExpression="Shipment_Key" UniqueName="Shipment_Key"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Shipment_AWorBOL" HeaderText="AWB/BOL #" SortExpression="Shipment_AWorBOL" UniqueName="Shipment_AWorBOL"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Customer_Name" HeaderText="Customer" SortExpression="Customer_Name" UniqueName="Customer_Name"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Shipment_Description" HeaderText="Description" SortExpression="Shipment_Description" UniqueName="Shipment_Description"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Voyage_ArriveDate" HeaderText="Arrival Date" SortExpression="Voyage_ArriveDate" DataFormatString="{0:MM/dd/yyyy}" UniqueName="Voyage_ArriveDate" DataType="System.DateTime"> </telerik:GridBoundColumn> </Columns> <NestedViewSettings DataSourceID="GeneralShipmentData"> <ParentTableRelation> <telerik:GridRelationFields MasterKeyField="Shipment_Key" DetailKeyField="Shipment_Key"></telerik:GridRelationFields> </ParentTableRelation> </NestedViewSettings> <NestedViewTemplate> <div class="generalInfoForm"> <div class="leftForm"> <span> <label>Customer:</label> <%# Eval("Customer_Num")%> <%# Eval("Customer_Name") %></span> <span> <label>Consignee:</label> <%# Eval("Consignee_Num")%> <%# Eval("Consignee_Name") %></span> <span> <label>Arrival Date:</label> <%# Eval("Voyage_ArriveDate", "{0:MM/dd/yyyy}")%></span> </div> <div class="rightForm"> <span> <label>AWB/BOL:</label> <%# Eval("Shipment_AWorBOL")%></span> <span> <label>Carrier:</label> <%# Eval("Carrier_Name")%></span> <span> <label>Vessel:</label> <%# Eval("Vessel_Name") %></span> <span> <label>Forwarding Agent:</label> <%# Eval("ForwardingAgent_Name") %></span> </div> <div class="middleForm"><%# Eval("Shipment_Description")%></div> <div class="leftForm"> <span> <label>Volume Weight:</label> <%# Eval("ShipPackage_VolumeWeight")%></span> <span> <label>Weight:</label> <%# Eval("ShipPackage_TotalWeight")%></span> <span> <label>Cube:</label> <%# Eval("ShipPackage_TotalVolume")%></span> <span> <label>Freight:</label> <%# Eval("ShipmentCover_FaceFreight")%></span> </div> </div> </NestedViewTemplate> </MasterTableView> </telerik:RadGrid>Protected Sub gridShipmentsToBill_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles gridShipmentsToBill.ItemCommand If e.CommandName = "RowClick" OrElse e.CommandName = RadGrid.ExpandCollapseCommandName Then Dim previousState As Boolean = e.Item.Expanded If e.CommandName = "ExpandCollapse" Then previousState = Not previousState End If CollapseAllRows() e.Item.Expanded = Not previousState End If End Sub Private Sub CollapseAllRows() For Each item As GridItem In gridShipmentsToBill.MasterTableView.Items item.Expanded = False Next End Sub