or
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="btnRefreshPosts" EventName="onclick"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="pnlPosts" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="repPosts" EventName="onitemcommand"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="pnlComments" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="repComments" EventName="onitemcommand"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="pnlComments" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager><asp:Panel ID="pnlPosts" runat="server"> <div id="Posts" style="padding:10px;margin:15px; width:700px;"> <asp:Repeater ID="repPosts" runat="server" onitemdatabound="repPosts_ItemDataBound" OnItemCommand="repPosts_ItemCommand"> <ItemTemplate> <div class="postitem" > <div class="sep"></div> <div class="postitem_name" > <asp:Literal ID="litName" runat="server" /> <asp:Literal ID="litCreated" runat="server" /> </div> <div class="postitem_content"> <asp:Button ID="btnDelete" runat="server" Text="" CssClass="btnDelete" /> <asp:Literal ID="litContent" runat="server" /> </div> </div> <div style="clear:both;"></div> <asp:Panel ID="pnlComments" runat="server"> <div class="CommentsWrapper"> <asp:Repeater ID="repComments" runat="server" OnItemDataBound="repComments_ItemDataBound" OnItemCommand="repComments_ItemCommand"> <HeaderTemplate> <h3>Comments</h3> </HeaderTemplate> <ItemTemplate> <div class="Comment"> <asp:Button ID="btnDelete" runat="server" Text="" CssClass="btnDelete" /> <asp:Literal ID="litComment" runat="server" /> </div> </ItemTemplate> </asp:Repeater> <div class="AddComment"> <asp:Panel ID="pnlAddComment" runat="server" DefaultButton="btnAddComment"> <asp:TextBox ID="txtComment" runat="server"></asp:TextBox> <asp:Button ID="btnAddComment" CssClass="common btnAddComment" runat="server" Text="Submit" /> </asp:Panel> </div> <div style="clear:both;"></div> </div> </asp:Panel> </ItemTemplate> </asp:Repeater> </div> </asp:Panel>protected void GetPosts() { repPosts.DataSource = WineclubManager.GetPosts(19,20); repPosts.DataBind(); } protected void repPosts_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { PostItem row = (PostItem)(e.Item.DataItem); CustomerItem customer = CustomerManager.GetCustomer(row.CustomerID); Repeater repComments = (Repeater)e.Item.FindControl("repComments"); Literal litName = (Literal)e.Item.FindControl("litName"); Literal litCreated = (Literal)e.Item.FindControl("litCreated"); Literal litContent = (Literal)e.Item.FindControl("litContent"); TextBox txtComment = (TextBox)e.Item.FindControl("txtComment"); Button btnAddComment = (Button)e.Item.FindControl("btnAddComment"); Button btnDelete = (Button)e.Item.FindControl("btnDelete"); if (row.CustomerID != 0) litName.Text = "<span>" + customer.Firstname + " " + customer.Lastname + "</span>"; else litName.Text = "<span>LabelWines</span>"; litCreated.Text = "<span class=\"date\">" + row.Created.ToString("dd.MM.yyyy HH:mm") + "</span>"; litContent.Text = row.Content; txtComment.Text = "Write a comment"; if (row.CustomerID == CustomerManager.GetCustomerID()) { btnDelete.CommandName = "Delete"; btnDelete.CommandArgument = row.ID.ToString(); btnDelete.Attributes.Add("onclick", "jConfirm('" + Resources.Language.Wineclub_PostPopupMessage.Replace(Environment.NewLine, "<br />") + "', '" + Resources.Language.Wineclub_PostPopupHeader + "', function(r) { if(r==true) __doPostBack(\"" + btnDelete.ClientID.Replace("_", "$") + "\", \"\"); }); return false;"); } else btnDelete.Visible = false; btnAddComment.CommandName = "AddComment"; btnAddComment.CommandArgument = row.ID.ToString(); BindInnerRepeaterComments(repComments, row.ID); } } protected void repPosts_ItemCommand(object source, RepeaterCommandEventArgs e) { switch (e.CommandName) { case "AddComment": CommentItem item = new CommentItem(); item.PostID = int.Parse(e.CommandArgument.ToString()); item.CustomerID = 2; TextBox txtComment = e.Item.FindControl("txtComment") as TextBox; if ((txtComment.Text.Length > 0) && (txtComment.Text != "Write a comment")) item.Comment = txtComment.Text; int id = WineclubManager.AddComment(item); txtComment.Text = Resources.Language.Wineclub_PostDefaultCommentText; Repeater repComments = (Repeater)e.Item.FindControl("repComments"); BindInnerRepeaterComments(repComments, int.Parse(e.CommandArgument.ToString())); RadAjaxManager ra = (RadAjaxManager)(Page.FindControl("RadAjaxManager1")); ra.ResponseScripts.Add("javascript:InitCommentTextFields();"); break; } switch (e.CommandName) { case "Delete": WineclubManager.DeletePost(int.Parse(e.CommandArgument.ToString())); GetPosts(); RadAjaxManager ra = (RadAjaxManager)(Page.FindControl("RadAjaxManager1")); ra.ResponseScripts.Add("javascript:InitCommentTextFields();"); ra.ResponseScripts.Add("javascript:YoutubePosts();"); break; } } private void BindInnerRepeaterComments(Repeater Rep, int PostID) { CommentCollection items = WineclubManager.GetComments(PostID, false); if (items.Count > 0) { Rep.DataSource = items; Rep.DataBind(); Rep.Visible = true; } else Rep.Visible = false; } protected void repComments_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { CommentItem row = (CommentItem)e.Item.DataItem; CustomerItem customer = CustomerManager.GetCustomer(row.CustomerID); Literal litComment = (Literal)e.Item.FindControl("litComment"); Button btnDelete = (Button)e.Item.FindControl("btnDelete"); litComment.Text = "<span class=\"commentname\">" + customer.Firstname + " " + customer.Lastname + " - </span><span class=\"commentdate\">" + row.Created.ToString("dd.MM.yyyy HH:mm") + "</span>" + "<span class=\"commentmessage\">" + row.Comment + "</span>"; if (row.CustomerID == 2) { btnDelete.CommandName = "Delete"; btnDelete.CommandArgument = row.ID.ToString(); btnDelete.Attributes.Add("onclick", "jConfirm('" + Resources.Language.Wineclub_PostCommentPopupMessage.Replace(Environment.NewLine, "<br />") + "', '" + Resources.Language.Wineclub_PostCommentPopupHeader + "', function(r) { if(r==true) __doPostBack(\"" + btnDelete.ClientID.Replace("_", "$") + "\", \"\"); }); return false;"); } else btnDelete.Visible = false; } } protected void repComments_ItemCommand(object source, RepeaterCommandEventArgs e) { CommentItem currentComment = WineclubManager.GetComment(int.Parse(e.CommandArgument.ToString())); Repeater currentRep = (Repeater)source; switch (e.CommandName) { case "Delete": WineclubManager.DeleteComment(int.Parse(e.CommandArgument.ToString())); //GetPosts(); BindInnerRepeaterComments(currentRep, currentComment.PostID); RadAjaxManager ra = (RadAjaxManager)(Page.FindControl("RadAjaxManager1")); ra.ResponseScripts.Add("javascript:InitCommentTextFields();"); break; } }var editedRowIndex;function RowDblClick(sender, eventArgs){ var gridMPA = $find("<%= gridMPA.ClientID %>"); var editedRow; if (editedRowIndex) { editedRow = gridMPA.get_masterTableView().get_dataItems()[editedRowIndex]; if (editedRow.get_isInEditMode()) { gridMPA.get_masterTableView().updateItem(editedRow.get_itemIndexHierarchical()); } } editedRowIndex = eventArgs.get_itemIndexHierarchical(); gridMPA.get_masterTableView().editItem(editedRowIndex);}<asp:Content ID="Main" runat="server" contentplaceholderid="PlaceHolderMain"> <telerik:RadFormDecorator ID="RadFormDecorator" Skin="Office2007" runat="server" /> <telerik:RadWindowManager ID="RadWindowManager" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" EnableShadow="true" Skin="Office2007" runat="server" > <Windows> <telerik:RadWindow ID="RZPositionPickerRadWindow" Title="Wybierz rachunek zamknięty" NavigateUrl="ReconnetRZPositionsPickerDialog.aspx" Modal="true" Width="1000" Height="550" Skin="Office2007" Behaviors="Move, Close, Resize" EnableShadow="false" OnClientClose="RZPositionPickerRadWindow_OnClose" EnableViewState="false" RestrictionZoneID="aspnetForm" runat="server"> </telerik:RadWindow> </Windows> </telerik:RadWindowManager></asp:Content><script type="text/javascript"> function fileUploaded(sender, args) { var name = args.get_fileName(); var $ = $telerik.$; $(".info-panel"). append($("<div>" + name + "</div>")).show(); }</script><div class="upload-panel"> <%-- For the purpose of this demo the files are discarded. In order to store the uploaded files permanently set the TargetFolder property to a valid location. --%> <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" OnClientFileUploaded="fileUploaded" MultipleFileSelection="Automatic" TargetFolder="~/ImportPPC"> </telerik:RadAsyncUpload> <telerik:RadProgressArea runat="server" ID="RadProgressArea1"> </telerik:RadProgressArea> </div> <div class="info-panel"> Uploaded files in the target folder: <br /> </div>
EnableEmbeddedSkins="false" Skin="".myClass{ background-color:blue;}GCG_headerGroup = new GridColumnGroup();
GCG_headerGroup.HeaderStyle.CssClass = "myClass";