or

Hi
I have a RadGrid and one of the columns is a button:
<telerik:GridTemplateColumn UniqueName="AgreeColumn"> <ItemTemplate> <asp:Button ID="AgreeButton" runat="server" onClick="AgreeButton_Click" Text="Agree" /> </ItemTemplate> </telerik>When the button is clicked AgreeButton_Click is fired and in the method, I do some databse updates. Only if the dabase updates are successfull, I want to call a Javascript function:
protected void AgreeButton_Click(object sender, EventArgs e) { // do some database work ..... if (success) this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "myJS", "myJSFunction();", true); }For some reason, the Javascript function never gets called.
It works, however, if I create a button outside of grid:
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /> protected void Button1_Click(object sender, EventArgs e) { // do some database work ..... if (success) this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "myJS", "myJSFunction();", true); } What do I have to do to make this work for button in the grid?
Thanks
For a RadComboBox I am still having trouble with aligning the text to be indented off of the image on the selected item. I followed this example: http://www.telerik.com/community/code-library/aspnet-ajax/combobox/show-the-selected-item-image-in-input.aspx
This won't indent the text.
<style type="text/css"> .cbGeographicUnit .rcbInputCell .rcbInput { padding-left: 22px; } </style> <tr> <td> <telerik:RadComboBox ID="cbGeographicUnit" OnClientLoad="showFirstItemImage" OnClientSelectedIndexChanging="showImageOnSelectedItemChanging" HighlightTemplatedItems="true"> <ItemTemplate> ... </ItemTemplate> </telerik:RadComboBox> </td> </tr> function RowClick(sender, eventArgs) { sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());}function RowClick(sender, eventArgs) { if(?????) { sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical()); } else { sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical()).????; }}/// <summary> /// RadScheduler1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadScheduler RadScheduler1;using System; using System.ComponentModel; using System.Collections; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Drawing; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using Telerik.Web.UI; using Telerik.Web.UI.Calendar; <h5><asp:Label ID="ViewCommentsHdg" runat="server" Text="Comments" Visible="false" ></asp:Label></h5> <telerik:RadGrid ID="RadGrid2" runat="server" AutoGenerateColumns="False" AllowPaging="True" Enabled="false" Visible="false" GridLines="None" Width="450px" EnableEmbeddedSkins="true" BackColor="#11161D" Skin="Black" OnItemCreated="RadGrid2_ItemCreated" > <PagerStyle Mode="NumericPages" PageButtonCount="5" /> <PagerStyle Mode="NumericPages" AlwaysVisible="true"></PagerStyle> <MasterTableView TableLayout="Fixed"> <ItemTemplate> <asp:Label ID="Image1" Text='<%# Eval("TextLangLongBody1") %>' runat="server" /> <div> <span style="font-weight: bold;"></span> <%# Eval("UserUName")%> <br /> <span style="font-weight: bold;"></span> <%# Format(Eval("TextRunFromDate"), "General Date")%> <br /> </div> <br /> </ItemTemplate> </MasterTableView> <ClientSettings AllowDragToGroup="false"> <Scrolling AllowScroll="true" UseStaticHeaders="true" /> </ClientSettings> </telerik:RadGrid> Dim boundcolumn As GridBoundColumn boundcolumn = New GridBoundColumn Me.RadGrid2.Columns.Add(boundcolumn) boundcolumn.UniqueName = "TextLangLongBody1" boundcolumn.DataField = "TextLangLongBody1" boundcolumn.Visible = True boundcolumn = Nothing RadGrid2.Enabled = True RadGrid2.Visible = True