5 Answers, 1 is accepted
0
Accepted
Princy
Top achievements
Rank 2
answered on 10 Dec 2008, 05:20 AM
Hello Phil,
Refer to the following online demo link which shows an example on how to insert several new records into the grid on a single button click using ajax requests.
Multi insert in grid using ToolTip
Thanks
Princy.
Refer to the following online demo link which shows an example on how to insert several new records into the grid on a single button click using ajax requests.
Multi insert in grid using ToolTip
Thanks
Princy.
0
Phil H.
Top achievements
Rank 2
answered on 10 Dec 2008, 01:44 PM
Yes, ... thanks
0
Phil H.
Top achievements
Rank 2
answered on 10 Dec 2008, 03:38 PM
The code in the demo is incomplete, in that none of the code behind for the user controls is supplied, and at least one of the user controls (NewProductForm.ascx) is also missing.
0
Hi Phil H.,
Attached to this message, is a zip file, containing all the files for the demo.
I hope this helps.
All the best,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Attached to this message, is a zip file, containing all the files for the demo.
I hope this helps.
All the best,
Yavor
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Accepted
Phil H.
Top achievements
Rank 2
answered on 13 Sep 2009, 01:44 AM
Sorry, should of updated sooner. This is my current solution. I am using RadWindows. This models the laucing program:
This models the RadWindows aspx.:
The above is in the RadWindows directory and is called Repeater.aspx
Phil
| <%@ Page Language="C#" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <script runat="server"> |
| protected void repeaterButton_Click(object sender, EventArgs e) |
| { |
| RadWindow _rWindow1 = new RadWindow(); |
| _rWindow1.ID = "rWindow1"; |
| _rWindow1.NavigateUrl = "~//RadWindows//Repeater.aspx?Kys=" + keysTextBox.Text; |
| _rWindow1.Modal = true; |
| _rWindow1.VisibleOnPageLoad = true; |
| _rWindow1.Height = 400; |
| _rWindow1.Width = 600; |
| RadWindowManager1.Windows.Add(_rWindow1); |
| } |
| </script> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title>Rad Windows 3 Sample</title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadWindowManager ID="RadWindowManager1" runat="server"> |
| </telerik:RadWindowManager> |
| <asp:TextBox ID="keysTextBox" runat="server" Text="10101" /> |
| <br /> |
| <asp:Button ID="repeaterButton" runat="server" Text="Repeater" onclick="repeaterButton_Click" /> |
| </div> |
| </form> |
| </body> |
| </html> |
This models the RadWindows aspx.:
| <%@ Page Language="C#" %> |
| <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <script type="text/javascript"> |
| function GetRadWindow() { |
| var oWindow = null; |
| if (window.radWindow) { |
| oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog |
| } |
| else if (window.frameElement.radWindow) { |
| oWindow = window.frameElement.radWindow; //IE (and Moz az well) |
| } |
| return oWindow |
| } |
| </script> |
| <script runat="server"> |
| // |
| public class cls |
| { |
| public int cl {get ; set; } |
| public int amt1 {get ; set; } |
| public int amt2 { get; set; } |
| public int amt3 { get; set; } |
| public int totAmt { get; set; } |
| } |
| // |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| kysLabel.Text = Request.QueryString["Kys"]; |
| if( !IsPostBack ) |
| { |
| Initialize(); |
| } |
| } |
| // |
| public void Initialize() |
| { |
| cls _cls = new cls{ cl = 0, amt1 = 0, amt2 = 0, amt3 = 0, totAmt = 0 }; |
| List<cls> _ridList = new List<cls>(); |
| _ridList.Add(_cls); |
| _ridList.Add(_cls); |
| _ridList.Add(_cls); |
| classAddRepeater.DataSource = _ridList; |
| classAddRepeater.DataBind(); |
| } |
| // |
| protected void classComboBox_SelectedIndexChanged(Object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) |
| { |
| RadComboBox _classComboBox = (RadComboBox)o; |
| int _class = Convert.ToInt32(_classComboBox.SelectedValue); |
| RepeaterItem _repeaterItem = (RepeaterItem)_classComboBox.Parent; |
| TextBox _amt1 = (TextBox)_repeaterItem.FindControl("amt1TextBox"); |
| TextBox _amt2 = (TextBox)_repeaterItem.FindControl("amt2TextBox"); |
| TextBox _amt3 = (TextBox)_repeaterItem.FindControl("amt3TextBox"); |
| _amt2.Visible = true; |
| _amt2.Focus(); |
| _amt3.Visible = true; |
| switch( _class ) |
| { |
| case 0: |
| _amt1.Visible = false; |
| _amt2.Visible = false; |
| _amt3.Visible = false; |
| break; |
| case 1: |
| _amt1.Visible = true; |
| _amt1.Focus(); |
| break; |
| default: |
| _amt1.Visible = false; |
| break; |
| } |
| } |
| // |
| protected void LinkButton1_Click(object sender, EventArgs e) |
| { |
| ScriptManager.RegisterStartupScript(this,this.GetType(),"Close","GetRadWindow().Close();", true); |
| } |
| // |
| </script> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title></title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> |
| </telerik:RadScriptManager> |
| Keys: <asp:Label ID="kysLabel" runat="server" Text="0" /> |
| <table> |
| <thead> |
| <tr> |
| <th scope="col" class="GridHeader_Office2007">Class</th> |
| <th scope="col" class="GridHeader_Office2007">Amt 1</th> |
| <th scope="col" class="GridHeader_Office2007">Amt 2</th> |
| <th scope="col" class="GridHeader_Office2007">Amt 3</th> |
| <th scope="col" class="GridHeader_Office2007">Total</th> |
| </tr> |
| </thead> |
| <asp:Repeater ID="classAddRepeater" runat="server" |
| > |
| <ItemTemplate> |
| <tr> |
| <td> |
| <telerik:RadComboBox ID="classComboBox" runat="server" |
| Skin="Outlook" |
| MarkFirstMatch="True" |
| Width="100px" |
| SelectedValue='<%# Bind("cl") %>' |
| onselectedindexchanged="classComboBox_SelectedIndexChanged" |
| AutoPostBack="True" |
| > |
| <Items> |
| <telerik:radcomboboxitem Value="0" Text="0 Not Selected" /> |
| <telerik:radcomboboxitem Value="1" Text="1" /> |
| <telerik:radcomboboxitem Value="2" Text="2" /> |
| <telerik:radcomboboxitem Value="3" Text="3" /> |
| </Items> |
| <CollapseAnimation Type="InOutQuint" Duration="200" /> |
| </telerik:RadComboBox> |
| </td> |
| <td> |
| <asp:TextBox ID="amt1TextBox" runat="server" Text='<%# Bind("amt1","{0:N0}") %>' Columns="8" MaxLength="9" Visible="false" /> |
| </td> |
| <td> |
| <asp:TextBox ID="amt2TextBox" runat="server" Text='<%# Bind("amt2","{0:N0}") %>' Columns="7" MaxLength="8" Visible="false" /> |
| </td> |
| <td> |
| <asp:TextBox ID="amt3TextBox" runat="server" Text='<%# Bind("amt3","{0:N0}") %>' Columns="7" MaxLength="8" Visible="false" /> |
| </td> |
| <td> |
| <asp:TextBox ID="totAmtTextBox" runat="server" Text='<%# Bind("totAmt","{0:N0}") %>' Columns="7" MaxLength="8" Visible="True" /> |
| </td> |
| </tr> |
| </ItemTemplate> |
| </asp:Repeater> |
| </table> |
| <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Close Button</asp:LinkButton> |
| </form> |
| </body> |
| </html> |
The above is in the RadWindows directory and is called Repeater.aspx
Phil