I need to programmatically load RadGrid2, and the parameters that I will feed into the stored procedure will come from RadGrid1. I'm not sure how to find RadGrid2, let alone how to find the columns within RadGrid2.
Thanks. Please let me know what additional information you might need.
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title>Untitled Page</title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <asp:ScriptManager ID="ScriptManager1" runat="server" /> |
| <div> |
| <telerik:RadGrid ID="RadGrid1" runat="server" |
| OnNeedDataSource="RadGrid1_NeedDataSource"> |
| <ClientSettings AllowKeyboardNavigation="true"> |
| </ClientSettings> |
| <MasterTableView AutoGenerateColumns="False" DataKeyNames="Id" ClientDataKeyNames="Id" ShowHeader="true" EditMode="InPlace" CommandItemDisplay="top" > |
| <Columns> |
| <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton" /> |
| <telerik:GridBoundColumn UniqueName="someColumn" DataField="someField" /> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid></div> |
| </form> |
| </body> |
| </html> |
| using System; |
| using System.Data; |
| using System.Configuration; |
| 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; |
| public partial class _Default : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| } |
| protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) |
| { |
| RadGrid1.DataSource = new DataTable(); |
| } |
| } |
I have two buttons in each gridrow. One button(openDetail) is used to open detail page as a modal popup and another button "submit" raises itemcommand event and does some data processing.
The problem that I have is once i click submit, OpenDetail button stops working(page just refreshes but doesnt open detail page).
In Item_Created Event handler I have the following code
int Id = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "DataId"));
LBTN Namebtn = e.Item.FindControl("NameBTN") as BTN;
Namebtn.Attributes["onclick"] = string.Format("return OpenDetail('{0}','{1}');", Id, e.Item.ItemIndex);
This is the OpenDetail javascript:
function OpenDetail(id, rowIndex)
{
var grid = window[<%=Grid.ClientId%>];
var rowControl = grid.MasterTableView.Rows[rowIndex].Control;
grid.MasterTableView.SelectRow(rowControl, true);
window.radopen("Details.aspx?data=" + id, "Dialog");
return false;
}
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
<telerik:RadWindow ID="Dialog" runat="server" Title="Dialog" Height="400px"
Width="300px" Left="150px" ReloadOnShow="true" Modal="true"/>
</Windows>
</telerik:RadWindowManager>
Could you please tell me what I am doing wrong...
thanks..
Can you please lead me in the right direction?