protected
override void RaisePostBackEvent(IPostBackEventHandler source, string eventArgument)
{
try
{
base.RaisePostBackEvent(source, eventArgument);
if (source == this.grdADInbox && eventArgument.IndexOf("RowDblClicked") != -1)
{
Session[
"strApproveUrl"] = null;
Session[
"strRejectUrl"] = null;
Session[
"TranType"] = null;
RadGrid rg = (RadGrid)source;
int index = int.Parse(eventArgument.Split(':')[1]);
mvTransaction.ActiveViewIndex = 0;
rtsADItem.SelectedIndex = 0;
divAction.Visible =
true;
Decimal transaction_Key = Convert.ToDecimal(rg.Items[index].OwnerTableView.DataKeyValues[index]["Tran_Key"]);
hdnTranKey.Value =
Convert.ToString(transaction_Key);
hdnTranType.Value = (
string) rg.Items[index].OwnerTableView.DataKeyValues[index]["TransactionType"];
Session[
"TranType"] = hdnTranType.Value;
//load attachment
LoadAttachment();
ViewState[
"islinkkVisible"] = true;
//load transaction detail
LoadTransactionDetail();
Session[
"strApproveUrl"] = "ApproveAction.aspx?action=Approve&&Tran_Key=" + transaction_Key + "&&Current_Step=" + rg.Items[index]["CurrentStep"].Text;
Session[
"strRejectUrl"] = "ApproveAction.aspx?action=Reject&&Tran_Key=" + transaction_Key + "&&Current_Step=" + rg.Items[index]["CurrentStep"].Text;
btnApprove.Attributes.Add(
"onclick", "return ShowApprovalPopUp('" + Convert.ToString(Session["strApproveUrl"]) + "');");
btnReject.Attributes.Add(
"onclick", "return ShowApprovalPopUp('" + Convert.ToString(Session["strRejectUrl"]) + "');");
}
}
catch (Exception ex) {
throw ex;}
}
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AutoGenerateColumns
=
"False"
GridLines
=
"None"
DataSourceID
=
"ObjectDataSource1"
AllowPaging
=
"True"
AllowSorting
=
"True"
PageSize
=
"20"
>
<
ExportSettings
IgnorePaging
=
"true"
OpenInNewWindow
=
"true"
>
<
Pdf
PageHeight
=
"297mm"
PageWidth
=
"210mm"
PageTitle
=
"Pic"
/>
</
ExportSettings
>
<
MasterTableView
CommandItemDisplay
=
"Top"
>
<
CommandItemSettings
ShowExportToPdfButton
=
"true"
ShowAddNewRecordButton
=
"false"
ShowExportToExcelButton
=
"true"
ShowExportToWordButton
=
"true"
/>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"UserID"
HeaderText
=
"User ID"
ReadOnly
=
"True"
SortExpression
=
"UserID"
UniqueName
=
"UserID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"FirstName"
HeaderText
=
"First Name"
ReadOnly
=
"True"
SortExpression
=
"FirstName"
UniqueName
=
"FirstName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"LastName"
HeaderText
=
"Last Name"
ReadOnly
=
"True"
SortExpression
=
"LastName"
UniqueName
=
"LastName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"OtherName"
HeaderText
=
"Other Name"
ReadOnly
=
"True"
SortExpression
=
"OtherName"
UniqueName
=
"OtherName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridDateTimeColumn
DataField
=
"dateTime"
HeaderText
=
"Date Time"
ReadOnly
=
"True"
SortExpression
=
"dateTime"
UniqueName
=
"dateTime"
DataFormatString
=
"{0:yyyy/MM/dd HH:mm}"
>
</
telerik:GridDateTimeColumn
>
<
telerik:GridTemplateColumn
DataField
=
"FileName"
HeaderText
=
"Image"
SortExpression
=
"FileName"
UniqueName
=
"FileName"
>
<
ItemTemplate
>
<
asp:Image
ID
=
"FileName"
runat
=
"server"
ImageUrl='<%# String.Format("~/Capture/{0}", Eval("FileName")) %>'
Width="100px" Height="70px" BorderWidth="1px" BorderColor="Black" AlternateText="image" />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
script
type
=
"text/javascript"
language
=
"javascript"
>
function requestStart(sender, args) {
if (args.get_eventTarget().indexOf("ExportToPdfButton") > 0 || args.get_eventTarget().indexOf("ExportToWordButton") > 0 || args.get_eventTarget().indexOf("ExportToExcelButton") > 0)
args.set_enableAjax(false);
}
</
script
>
</
head
>
<
body
>
<
form
id
=
"form2"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
ClientEvents-OnRequestStart
=
"requestStart"
>
</
telerik:RadAjaxManager
>
<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>