<
MasterTableView EditMode="PopUp" CommandItemDisplay="Top" DataKeyNames="Customer _ID" DataSourceID="sdsCustomer" Width="100%">
<Columns>
<
telerik:GridTemplateColumn DataField="Customer_ID" Visible="false" HeaderText="Customer ID"
SortExpression="Customer_ID" UniqueName="Customer_ID">
<ItemTemplate>
<asp:Label ID="Customer_IDLabel" runat="server" Text='<%# Eval("Customer_ID") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="Customer_IDTextBox" Width="200px" runat="server"
Text='<%# Bind("Customer_ID") %>'></asp:TextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="Customer_Name" HeaderText="Name"
SortExpression="Customer_Name" ItemStyle-Wrap="false" UniqueName="Customer_Name">
<EditItemTemplate>
<asp:TextBox ID="Customer_NameTextBox" Width="200px" runat="server"
Text='<%# Bind("Customer_Name") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Customer_NameLabel" runat="server"
Text='<%# Eval("Customer_Name") %>'></asp:Label>
</ItemTemplate>
<
ItemStyle Wrap="False"></ItemStyle>
</telerik:GridTemplateColumn>
</
Columns>
Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs)
If (TypeOf e.Item Is GridEditableItem) AndAlso (e.Item.IsInEditMode) Then
Dim edititem As GridEditableItem = DirectCast(e.Item, GridEditableItem)
Dim txtbx As TextBox = DirectCast(edititem("Customer_ID").Controls(0), TextBox)
txtbx.Enabled =
False
End If
End Sub
But it don't seems to work. Thanks
| <asp:UpdatePanel ID="UpdatePanel1" runat="server"> |
| <ContentTemplate> |
| <telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedView="TimelineView" |
| OnAppointmentDataBound="RadScheduler1_OnAppointmentDataBound" TimelineView-HeaderDateFormat="D" |
| DataSourceID="dsEventsDataSource" Skin="Office2007" GroupBy="Room" GroupingDirection="Vertical" |
| DayStartTime="08:00:00" DayEndTime="23:30:00" TimeZoneOffset="03:00:00" DataKeyField="Conf_ID" |
| DataSubjectField="Conference_Name" DataStartField="Start" DataEndField="End" |
| OverflowBehavior="Expand" ShowViewTabs="false" ColumnWidth="10px" Width="950px" |
| Height="400px" CustomAttributeNames="Conf_ID,Name,RoomID,RoomEmail" OnAppointmentCommand="RadScheduler1_OnAppointmentCommand" |
| OnResourceHeaderCreated="RadScheduler1_ResourceHeaderCreated" RowHeight="40px" |
| MultiDayView-NumberOfDays="2" RowHeaderWidth="100px" EnableDatePicker="false" |
| ShowNavigationPane="false" AllowInsert="false" AllowEdit="false" AllowDelete="false"> |
| <AdvancedForm Modal="true" /> |
| <TimelineView NumberOfSlots="192" SlotDuration="0:15" ColumnHeaderDateFormat="h tt" |
| TimeLabelSpan="4" /> |
| <ResourceTypes> |
| <telerik:ResourceType KeyField="RoomID" Name="Room" TextField="Name" ForeignKeyField="RoomID" |
| DataSourceID="dsRoomsDataSource" /> |
| </ResourceTypes> |
| <ResourceHeaderTemplate> |
| <asp:LinkButton ID="btnRemove" runat="server" Text="X" CommandName="RemoveResource" |
| CausesValidation="false" CssClass="ui-icon ui-icon-trash" Style="float: left" |
| OnClientClick="return confirm('Are you sure you want to remove this room?')" /> |
| <asp:Label ID="ResourceLabel" runat="server" /> |
| </ResourceHeaderTemplate> |
| </telerik:RadScheduler> |
| <asp:LinqDataSource ID="dsEventsDataSource" runat="server" OnSelecting="dsEventsDataSource_OnSelecting"> |
| </asp:LinqDataSource> |
| <asp:LinqDataSource ID="dsRoomsDataSource" runat="server" OnSelecting="dsRoomsDataSource_OnSelecting"> |
| </asp:LinqDataSource> |
| </ContentTemplate> |
| </asp:UpdatePanel> |
| protected void dsRoomsDataSource_OnSelecting(object sender, LinqDataSourceSelectEventArgs e) |
| { |
| e.Result = Rooms; |
| } |
| public class Room |
| { |
| public Guid RoomID { get; set; } |
| public string Name { get; set; } |
| public bool Host { get; set; } |
| public bool Presenting { get; set; } |
| public int Attendees { get; set; } |
| public bool ClientsPresent { get; set; } |
| public string RoomEmail { get; set; } |
| public string Tools { get; set; } |
| public string Comments { get; set; } |
| public List<RoomSchedule> Schedules { get; set; } |
| } |
| RadTreeView radTreeView = (RadTreeView)RadComboBox1.Items[0].FindControl("RadTreeView1"); |
| IList<CoorIS.DomainObjects.Unit> units = UnitService.GetUnitsAsExpanded(PageInfo.CurrentUnitID, Guid.Empty); |
| radTreeView.DataSource = units; |
| radTreeView.DataTextField = "Name"; |
| radTreeView.DataValueField = "ID"; |
| radTreeView.DataFieldID = "ID"; |
| radTreeView.DataFieldParentID = "ParentID"; |
| radTreeView.DataBind(); |
| RadTreeNode node = radTreeView.FindNodeByValue(PageInfo.CurrentUnitID.ToString()); |
| if (node != null) |
| { |
| node.ExpandParentNodes(); |
| node.Selected = true; |
| RadComboBox1.SelectedItem.Text = node.Text; |
| } |
I have some code that has been working for a while, where I do stuff mostly on the client side (drag drop/delete/edit). I process the client transactions saved in the ClientChanges collection on the server when a Save button is clicked I had a need to add code to a context menu to allow adding a child to a selected node. I specifically needed to have the node show up in edit mode right away for the user to add the node text. I couldn't get this to work on the client side, so I saw a server side sample on your website that does exactly what I needed (right click on node and select 'new folder' in context menu http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/contextmenu/defaultcs.aspx).
So I added the onContextMenuItemClick server event to the .aspx (line 3 below)
| <telerik:RadTreeView ID="tvwCategory" runat="server" EnableDragAndDrop="true" EnableDragAndDropBetweenNodes="true" AllowNodeEditing="true" OnClientNodeDropping="onNodeDropping" OnClientContextMenuItemClicked="onClientContextMenuItemClicked" | |
| OnClientNodeEdited="onClientNodeEdited" onprerender="tvwCategory_PreRender" | |
| oncontextmenuitemclick="tvwCategory_ContextMenuItemClick"> |