| <EditItemTemplate> |
| <telerik:RadComboBox ID="Programme" AutoPostBack="true" runat="server" EnableLoadOnDemand="true" Height="200px" OnSelectedIndexChanged="Programme_SelectedIndexChanged" OnItemsRequested="Programme_ItemsRequested" Width="150"/> |
| </EditItemTemplate> |
| protected void Programme_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) |
| { |
| RadComboBox drp = (RadComboBox)sender; |
| e.Context.Clear(); |
| Dv.Table = DropDownDs.Tables[0]; |
| Dv.RowFilter = "Type in ('" + drp.ID + "') and Text like '" + e.Text + "*' "; |
| drp.Items.Clear(); |
| drp.DataTextField = "Text"; |
| drp.DataValueField = "Value"; |
| drp.DataSource = Dv; |
| drp.DataBind(); |
| } |
For Each i As GridDataItem In rdgCategories.Items
If CType(i.FindControl("chkDelete"), CheckBox).Checked() Then
myAdmin.DeleteLeadAffiliate(
CInt(CType(i.FindControl("lblID"), Label).Text()))
End If
'this works in normal - master only view
Next
>> gives error with master detail,
how can i findcontrol the detail rows lblID2 value?
regards
Wouter
private void SetPreviousAccountData(int rowsCount) { if (Page.IsPostBack) { Table table = (Table)Page.FindControl("Table1"); if (table != null) { for (int i = 0; i < rowsCount; i++) { //Extracting the Dynamic Controls from the Table DropDownList ddAccount = (DropDownList)table.Rows[i].Cells[1].FindControl("ddAccount" + i + "Col_1"); //Use Request objects for getting the previous data of the dynamic textbox ddAccount.Text = Request.Form["ddAccount" + i + "Col_1"]; TextBox txtProxy = (TextBox)table.Rows[i].Cells[3].FindControl("txtProxy" + i + "Col_3"); //Use Request objects for getting the previous data of the dynamic textbox txtProxy.Text = Request.Form["txtProxy" + i + "Col_3"]; } } } } private void AddAccount(int rowsCount, bool addNewRow) { //Sore the current Rows Count in ViewState if (addNewRow) { rowsCount++; ViewState["AccountRowCount"] = rowsCount; } //Creat the Table and Add it to the Page Table table = new Table(); table.ID = "Table1"; AccountSpan.Controls.Add(table); for (int i = 0; i < rowsCount; i++) { TableRow tRow = new TableRow(); TableCell lblAccountCell = new TableCell(); TableCell tcAccountCell = new TableCell(); TableCell lblProxyCell = new TableCell(); TableCell tcProxyCell = new TableCell(); DropDownList ddAccount = new DropDownList(); TextBox txtProxy = new TextBox(); lblAccountCell.Text = "Account Number:"; lblProxyCell.Text = "Proxy:"; ddAccount.ID = "ddAccount" + i + "Col_1"; txtProxy.ID = "txtProxy" + i + "Col_3"; if (ddClientID.SelectedIndex > 0) { ClientDataContext db = new ClientDataContext(); var query = from p in db.ProxyAccounts where p.ClientID == Int32.Parse(ddClientID.SelectedValue) select new { p.ProxyAccountID, Account = p.NameOnAccount + ": " + p.AccountNumber }; ddAccount.DataSource = query.ToList(); ddAccount.DataTextField = "Account"; ddAccount.DataValueField = "ProxyAccountID"; ddAccount.DataBind(); ddAccount.Items.Insert(0, ""); } tcAccountCell.Controls.Add(ddAccount); tcProxyCell.Controls.Add(txtProxy); tRow.Cells.Add(lblAccountCell); tRow.Cells.Add(tcAccountCell); tRow.Cells.Add(lblProxyCell); tRow.Cells.Add(tcProxyCell); table.Rows.Add(tRow); } SetPreviousAccountData(rowsCount); }Table table = (Table)Page.FindControl("Table1"); does not find the table.
<
telerik:RadGrid runat="server" ID="dgFilingManager" AutoGenerateColumns="False" Height="350px" GridLines="None" Skin="Windows7" OnItemDataBound="dgFilingManager_ItemCommand">
<MasterTableView TableLayout="Fixed" GroupLoadMode="Client" AllowPaging="true" PagerStyle-Mode="NextPrevNumericAndAdvanced" PagerStyle-Position="TopAndBottom" PagerStyle-HorizontalAlign="Center" PagerStyle-PageButtonCount="4" >
<Columns>
<telerik:GridTemplateColumn HeaderText=" FILING" DataField="UCCTYPE" UniqueName="FILING" HeaderStyle-Width="10%" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Left">
<ItemTemplate><asp:Label ID="lblFiling" runat="server" Text="" Visible="true"></asp:Label></ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="UCCTYPE" HeaderText="UCCTYPE" UniqueName="UCCTYPE" ItemStyle-HorizontalAlign="Left" Visible="false" />
<telerik:GridBoundColumn DataField="LienRefNumber" HeaderText="LIENREFNUMBER" UniqueName="LIENREFNUMBER" Visible="false" />
</Columns>
</telerik:RadGrid>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> <style type="text/css"> .rotatorBackground { float: left; margin-left: 50px; margin-top: 10px; width: 440px; height: 185px; border: solid 2px #dedede; -moz-border-radius: 15px; -webkit-border-radius: 15px; } .rotatorStyle { margin: 40px auto 0px; } .rotatorStyle .RotatorItem { margin:5px; height: 100px; width: 100px; } .rotatorCarouselStyle { margin: 0px auto; } .RotatorItem { border: solid 1px #dff3ff !important; } .mainDiv { margin-bottom: 20px; } .configurationPanel { width: 290px; border: 0px; } </style> </head> <body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="Server" Transparency="30" EnableSkinTransparency="false" BackColor="#E0E0E0"> </telerik:RadAjaxLoadingPanel> <telerik:RadAjaxPanel ID="AjaxPanel1" runat="server" LoadingPanelID="LoadingPanel1"> <div class="mainDiv"> <div class="rotatorBackground"> <telerik:RadRotator ID="RadRotator1" runat="server" Width="224px" Height="112px" CssClass="rotatorStyle" ItemHeight="112" ItemWidth="112" SlideShowAnimation-Type="Fade" SlideShowAnimation-Duration="3000" > <Items> <telerik:RadRotatorItem> <ItemTemplate> <asp:Image runat="server" ID="Image" ImageUrl='Img/Northwind/Customers/Thumbs/ANATR.jpg'CssClass="RotatorItem" AlternateText="Customer Image" /> </ItemTemplate> </telerik:RadRotatorItem> <telerik:RadRotatorItem> <ItemTemplate> <asp:Image runat="server" ID="Image1" ImageUrl='Img/Northwind/Customers/Thumbs/ANTON.jpg'CssClass="RotatorItem" AlternateText="Customer Image" /> </ItemTemplate> </telerik:RadRotatorItem> <telerik:RadRotatorItem> <ItemTemplate> <asp:Image runat="server" ID="Image2" ImageUrl='Img/Northwind/Customers/Thumbs/BOTTM.jpg'CssClass="RotatorItem" AlternateText="Customer Image" /> </ItemTemplate> </telerik:RadRotatorItem> <telerik:RadRotatorItem> <ItemTemplate> <asp:Image runat="server" ID="Image3" ImageUrl='Img/Northwind/Customers/Thumbs/CACTU.jpg'CssClass="RotatorItem" AlternateText="Customer Image" /> </ItemTemplate> </telerik:RadRotatorItem> <telerik:RadRotatorItem> <ItemTemplate> <asp:Image runat="server" ID="Image3" ImageUrl='Img/Northwind/Customers/Thumbs/CENTC.jpg'CssClass="RotatorItem" AlternateText="Customer Image" /> </ItemTemplate> </telerik:RadRotatorItem> <telerik:RadRotatorItem> <ItemTemplate> <asp:Image runat="server" ID="Image3" ImageUrl='Img/Northwind/Customers/Thumbs/ERNSH.jpg'CssClass="RotatorItem" AlternateText="Customer Image" /> </ItemTemplate> </telerik:RadRotatorItem> <telerik:RadRotatorItem> <ItemTemplate> <asp:Image runat="server" ID="Image3" ImageUrl='Img/Northwind/Customers/Thumbs/LAUGB.jpg'CssClass="RotatorItem" AlternateText="Customer Image" /> </ItemTemplate> </telerik:RadRotatorItem> <telerik:RadRotatorItem> <ItemTemplate> <asp:Image runat="server" ID="Image3" ImageUrl='Img/Northwind/Customers/Thumbs/MAISD.jpg'CssClass="RotatorItem" AlternateText="Customer Image" /> </ItemTemplate> </telerik:RadRotatorItem> <telerik:RadRotatorItem> <ItemTemplate> <asp:Image runat="server" ID="Image3" ImageUrl='Img/Northwind/Customers/Thumbs/MEREP.jpg'CssClass="RotatorItem" AlternateText="Customer Image" /> </ItemTemplate> </telerik:RadRotatorItem> <telerik:RadRotatorItem> <ItemTemplate> <asp:Image runat="server" ID="Image3" ImageUrl='Img/Northwind/Customers/Thumbs/OCEAN.jpg'CssClass="RotatorItem" AlternateText="Customer Image" /> </ItemTemplate> </telerik:RadRotatorItem> </Items> </telerik:RadRotator> </div> </div> </telerik:RadAjaxPanel> </form> </body> </html>