| <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>