| GridEditableItem editedItem = e.Item as GridEditableItem; |
| Hashtable newValues = new Hashtable(); |
| e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem); |
| <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Video.ascx.cs" Inherits="Admin_Controls_Video" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" |
| AllowAutomaticInserts="false" AllowAutomaticUpdates="false" |
| DataSourceID="SqlDataSource1" GridLines="None" |
| onitemdeleted="RadGrid1_ItemDeleted" oniteminserted="RadGrid1_ItemInserted" |
| onitemupdated="RadGrid1_ItemUpdated" |
| oninsertcommand="RadGrid1_InsertCommand" |
| onupdatecommand="RadGrid1_UpdateCommand"> |
| <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" |
| DataKeyNames="Id,title,description,path,data" DataSourceID="SqlDataSource1"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" HeaderText="Id" |
| ReadOnly="True" SortExpression="Id" UniqueName="Id"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="title" HeaderText="title" |
| SortExpression="title" UniqueName="title"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="description" HeaderText="description" |
| SortExpression="description" UniqueName="description"> |
| </telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn DataField="path" HeaderText="Screen Shot" |
| SortExpression="path" UniqueName="path"> |
| <EditItemTemplate> |
| <asp:TextBox ID="pathTextBox" runat="server" Text='<%# Bind("path") %>'></asp:TextBox> |
| </EditItemTemplate> |
| <ItemTemplate> |
| <asp:Image ID="Image1" runat="server" ImageUrl='<%# "~/Images/thumbs/" +Eval("path") %>' /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn DataField="data" Display="False" HeaderText="data" |
| SortExpression="data" UniqueName="data"> |
| </telerik:GridBoundColumn> |
| <telerik:GridEditCommandColumn> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridButtonColumn CommandName="Delete" Text="Delete" |
| UniqueName="column"> |
| </telerik:GridButtonColumn> |
| </Columns> |
| <EditFormSettings> |
| <EditColumn UniqueName="EditCommandColumn1"> |
| </EditColumn> |
| </EditFormSettings> |
| </MasterTableView> |
| <FilterMenu EnableTheming="True"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </FilterMenu> |
| </telerik:RadGrid> |
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" |
| ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>" |
| DeleteCommand="DELETE FROM [Video] WHERE [Id] = @Id" |
| InsertCommand="INSERT INTO [Video] ([title], [description], [path], [data]) VALUES (@title, @description, @path, @data)" |
| ProviderName="<%$ ConnectionStrings:ASPNETDBConnectionString1.ProviderName %>" |
| SelectCommand="SELECT [Id], [title], [description], [path], [data] FROM [Video]" |
| UpdateCommand="UPDATE [Video] SET [title] = @title, [description] = @description, [path] = @path, [data] = @data WHERE [Id] = @Id"> |
| <DeleteParameters> |
| <asp:Parameter Name="Id" Type="Int32" /> |
| </DeleteParameters> |
| <InsertParameters> |
| <asp:Parameter Name="title" Type="String" /> |
| <asp:Parameter Name="description" Type="String" /> |
| <asp:Parameter Name="path" Type="String" /> |
| <asp:Parameter Name="data" Type="String" /> |
| </InsertParameters> |
| <UpdateParameters> |
| <asp:Parameter Name="title" Type="String" /> |
| <asp:Parameter Name="description" Type="String" /> |
| <asp:Parameter Name="path" Type="String" /> |
| <asp:Parameter Name="data" Type="String" /> |
| <asp:Parameter Name="Id" Type="Int32" /> |
| </UpdateParameters> |
| </asp:SqlDataSource> |
_this._webRequest.completed(Sys.EventArgs.Empty);
Other filters work and these 4 filters work if there are no nulls in the datasource for that column. Does anyone have any clues as to what is cuasing this?
Thanks,
Brent
Hello!
I am trying to implement the similar to this
http://demos.telerik.com/ASPNET/prometheus/Dock/Examples/DynamicDocks/DefaultCS.aspx article functionality.
I also have 2 RadZones (the second is like a cart).
But the difference is:
instead of "Add Dock" i have "Search" button. So on its click I have to completely change (clear and add found items) the first RadZone and, possible some elements from the second one.
My current Search method is:
private void SearchSongs()
zoneSearch.Controls.Clear();
zoneSearch.Docks.Clear();
CurrentDockStates.Clear();
DataTable dt = <-- getting data
foreach (... dr in dt.Rows)
{
RadDock rd = new RadDock();
rd.UniqueName =
Guid.NewGuid().ToString();
rd.Text = dr.Title;
rd.Title = dr.Title;
rd.ID =
string.Format("RadDock{0}", rd.UniqueName);
rd.DockMode =
DockMode.Docked;
rd.Commands.Add(
new DockCloseCommand());
rd.Commands.Add(
new DockExpandCollapseCommand());
rd.Command +=
new DockCommandEventHandler(dock_Command);
CreateSaveStateTrigger(rd); // <-- but here an exception occured. actually, inside the method here: UpdatePanel1.Triggers.Add(saveStateTrigger);
zoneSearch.Controls.Add(rd);
can you give me a clue how should I manage this situation?
and what should I do to add another button handler (for instance, search2Button).
I hope the provided code is enough. All the code similar to the sample's one and another commands connected to moving, closing etc Docks works ok. The only problem (and difference) is in Search button work.
Thank you and the best regards,
Boleslav
| foreach (Telerik.Web.UI.RadTreeNode tn in CellTree.Nodes) |
| { |
| tn.Expanded = true; |
| tn.ExpandChildNodes(); |
| //Set header/item templates |
| SetItemTemplate(tn); |
| } |
| private void SetItemTemplate(Telerik.Web.UI.RadTreeNode Node) |
| { |
| if (Node.ParentNode == null) |
| { |
| MyTemplate template = new MyTemplate("Header"); |
| template.InstantiateIn(Node); |
| } |
| else |
| { |
| MyTemplate template = new MyTemplate("Item"); |
| template.InstantiateIn(Node); |
| } |
| foreach (Telerik.Web.UI.RadTreeNode tn1 in Node.Nodes) |
| { |
| //Use reflection to set each child item's template |
| SetItemTemplate(tn1); |
| } |
| } |
| public class MyTemplate : System.Web.UI.ITemplate |
| { |
| string TemplateType; |
| public MyTemplate(string type) |
| { |
| TemplateType = type; |
| } |
| public void InstantiateIn(Control container) |
| { |
| PlaceHolder ph = new PlaceHolder(); |
| ph.ID = "test"; |
| Label label1 = new Label(); |
| switch (TemplateType) |
| { |
| case "Header": |
| ph.Controls.Add(new LiteralControl("<div style=\"background-image:url(images/Parent.jpg); background-repeat:no-repeat; padding-left:15px; padding-top:4px; width:400px; height:31px\">")); |
| label1.ID = "MenuItem"; |
| label1.Text = "Text"; |
| label1.Font.Size = 10; |
| label1.Font.Bold = true; |
| label1.ForeColor = Color.White; |
| ph.Controls.Add(label1); |
| ph.DataBinding += new EventHandler(ph_DataBinding); |
| ph.Controls.Add(new LiteralControl("</div>")); |
| break; |
| case "Item": |
| ph.Controls.Add(new LiteralControl("<div style=\"background-image:url(images/item.bmp); background-repeat:no-repeat; padding-left:10px; width:400px; height:24px\">")); |
| label1.ID = "MenuItem"; |
| label1.Text = "Text"; |
| label1.Font.Size = 10; |
| label1.Font.Bold = true; |
| ph.Controls.Add(label1); |
| ph.DataBinding += new EventHandler(ph_DataBinding); |
| ph.Controls.Add(new LiteralControl("</div>")); |
| break; |
| } |
| container.Controls.Add(ph); |
| } |
| private void ph_DataBinding(object sender, EventArgs e) |
| { |
| PlaceHolder ph = (PlaceHolder)sender; |
| Telerik.Web.UI.RadTreeNode ri = (Telerik.Web.UI.RadTreeNode)ph.NamingContainer; |
| string menutext = (string)DataBinder.Eval(ri.DataItem, "Text"); |
| ((Label)ph.FindControl("MenuItem")).Text = menutext; |
| } |
| } |