This is a migrated thread and some comments may be shown as answers.

get_masterTableView client side does not work

16 Answers 719 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Fabio Laserra
Top achievements
Rank 1
Fabio Laserra asked on 05 Oct 2011, 02:52 PM
hello
I have a radgrid with edittemplate controls in which there is a radasyncupload. When I upload a file I want to disable the Update button. So I have this code:


<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
alert("1");
var masterTable = $find('<%=rdgrd_Rassegna.ClientID%>').get_masterTableView();
alert("2");
 </script>
 </telerik:RadScriptBlock>

I can get no references to mastertableview, I see alert 1 but no alert 2.Where I am wrong?

Thanks

16 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 05 Oct 2011, 06:34 PM
Hello,

please try with below code and let me know are you able to find grid/Mastertableview or not?

 var grid = $find("<%=RadGrid1.ClientID %>");
 if (grid) {
alert('grid found');
                    var MasterTable = grid.get_masterTableView();

}
else
{
alert('grid not found');
}

Thanks,
Jayesh Goyani
0
Fabio Laserra
Top achievements
Rank 1
answered on 06 Oct 2011, 08:37 AM
Hello,
thank you for your reply!

It says grid not found. The code is written in FormTemplate:

<EditFormSettings EditFormType="Template">
            <FormTemplate>

I have tried also to disable ajax (so the grid makes a complete page reload for each request) but the result is exactly the same! I didn't say that this is a part of DNN 6 pro module... I don't know if it can help to investigate the issue...
0
Iana Tsolova
Telerik team
answered on 10 Oct 2011, 03:20 AM
Hi Fabio,

If the provided script block is in the FormTemplate, try accessing the MasterTableView as below:
var tableView=$find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");

However, you mentioned that you need to disable the update button. I am not sure that in this case you need reference to the MasterTableView at all. Can you share the whole grid declaration and specify on which event you want to disable the Update button?

Best wishes,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Fabio Laserra
Top achievements
Rank 1
answered on 10 Oct 2011, 03:43 PM
Hello Iana,
I don' know why, but the problem is the $find method, it always return null. If I use this:
var tableView = document.getElementById("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>")

the tableview is references without issues. So if I use one of the following a NULL object returns:

var tableView = $find('dnn_ctr463_RassegnaStampa_rdgrd_Rassegna') // the real clientid
var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>")


Well, I need to disable Update and Cancel buttons while uploading files with asyncupload. And I need also to reference two radlistboxes because I want to limit (with javascript) the number of elements that I can move from a list to the other. This is the code of formtemplate:

<EditFormSettings EditFormType="Template">
            <FormTemplate>
                <table border="0" cellspacing="2" cellpadding="1" width="100%" border="1" rules="none"
                    style="border-collapse: collapse">
                    <tr class="EditFormHeader">
                        <td colspan="2">
                            <b>Dettaglio Notizia</b>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <table border="0" cellspacing="1" cellpadding="1" width="100%" border="0">
                                <tr>
                                    <td>
                                        Titolo:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTitolo" MaxLength="150" runat="server" Text='<%# Bind("Titolo") %>'>
                                        </asp:TextBox>
                                        <asp:RequiredFieldValidator ID="reqTitolo" ControlToValidate="txtTitolo" ErrorMessage="*"
                                            runat="server">
                                        </asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Testata:
                                    </td>
                                    <td>
                                        <telerik:RadComboBox ID="RadComboBoxTestata" runat="server" DataSourceID="objDataSourceTestate"
                                            Filter="Contains" DataTextField="Descrizione" DataValueField="ItemID" SelectedValue='<%# Bind("CodTestata") %>'>
                                        </telerik:RadComboBox>
                                        <asp:CompareValidator ID="compareTestata" ControlToValidate="RadComboBoxTestata"
                                            ValueToCompare="1" Operator="GreaterThanEqual" ErrorMessage="*" runat="server">
                                        </asp:CompareValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Data:
                                    </td>
                                    <td>
                                        <telerik:RadDatePicker ID="RadDatePickerData" DatePopupButton-Visible="true" ShowPopupOnFocus="true"
                                            runat="server" SelectedDate='<%# Bind("Data")%>'>
                                        </telerik:RadDatePicker>
                                        <asp:RequiredFieldValidator ID="reqData" ControlToValidate="RadDatePickerData" ErrorMessage="*"
                                            runat="server">
                                        </asp:RequiredFieldValidator>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Riservata:
                                    </td>
                                    <td>
                                        <asp:CheckBox ID="chkFlgRiservata" runat="server" Checked='<%# Bind("FlgRiservata") %>' />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <table border="0" width="100%">
                                            <tr>
                                                <td style="width: 50%;">
                                                    Argomenti: (max 3)<br />
                                                    <telerik:RadListBox ID="RadListBoxArgomentiLiberi" runat="server" Width="200px" Height="200px"
                                                        SelectionMode="Multiple" AllowTransfer="true" TransferToID="RadListBoxArgomentiSelezionati"
                                                        AutoPostBackOnTransfer="false" AllowReorder="false" EnableDragAndDrop="true"
                                                        DataSourceID="objDataSourceGridNotizie_ArgomentiLiberi" DataKeyField="ItemID"
                                                        DataTextField="Descrizione" DataValueField="ItemID">
                                                    </telerik:RadListBox>
                                                    <telerik:RadListBox ID="RadListBoxArgomentiSelezionati" runat="server" Width="200px"
                                                        Height="200px" SelectionMode="Multiple" AllowReorder="true" AutoPostBackOnReorder="false"
                                                        AutoPostBackOnTransfer="false" EnableDragAndDrop="true" DataSourceID="objDataSourceGridNotizie_Argomenti"
                                                        DataKeyField="CodArgomento" DataTextField="Descrizione" DataValueField="CodArgomento">
                                                    </telerik:RadListBox>
                                                </td>
                                                <td style="width: 50%;">
                                                    Tags: (max 3)<br />
                                                    <telerik:RadListBox ID="RadListBoxTagsLiberi" runat="server" Width="200px" Height="200px"
                                                        SelectionMode="Multiple" AllowTransfer="true" TransferToID="RadListBoxTagsSelezionati"
                                                        AutoPostBackOnTransfer="false" AllowReorder="false" EnableDragAndDrop="true"
                                                        DataSourceID="objDataSourceGridNotizie_TagsLiberi" DataKeyField="ItemID" DataTextField="Descrizione"
                                                        DataValueField="ItemID">
                                                    </telerik:RadListBox>
                                                    <telerik:RadListBox ID="RadListBoxTagsSelezionati" runat="server" Width="200px" Height="200px"
                                                        SelectionMode="Multiple" AllowReorder="true" AutoPostBackOnReorder="false" AutoPostBackOnTransfer="false"
                                                        EnableDragAndDrop="true" DataSourceID="objDataSourceGridNotizie_Tags" DataKeyField="CodTag"
                                                        DataValueField="CodTag" DataTextField="Descrizione">
                                                    </telerik:RadListBox>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Percorso attuale file:
                            <asp:Label ID="lblPercorsoNotizia" runat="server" Text=""></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <telerik:RadScriptBlock ID="test" runat="server">
 
                                <script type="text/javascript">
                                
                                    
                                    var tableView = document.getElementById("<%# TryCast(Container,GridItem).OwnerTableView.ClientID %>")
                                    if (tableView) {
                                        alert('grid found');
                                    }
                                    else {
                                        alert('grid not found');
                                    }
                                     
                                     
                                     
                                </script>
 
                            </telerik:RadScriptBlock>
                            <telerik:RadAsyncUpload AllowedFileExtensions="pdf" AutoAddFileInputs="false" Localization-Cancel="Annulla"
                                Localization-Remove="Rimuovi" Localization-Select="Seleziona" MaxFileInputsCount="1"
                                MultipleFileSelection="Disabled" runat="server" ID="AsyncUploadNotizia" Skin="Office2007"
                                OnClientFileUploadFailed="onUploadFailed" OnClientFileSelected="onFileSelected"
                                OnClientFileUploaded="onFileUploaded" TemporaryFolder="~/App_Data/RadUploadTemp"
                                InputSize="50" Culture="it-IT">
                            </telerik:RadAsyncUpload>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" colspan="2">
                            <telerik:RadButton ID="btnUpdate" runat="server" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Inserisci", "Aggiorna") %>'
                                CssClass="MyImageButton" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'>
                            </telerik:RadButton>
                            <telerik:RadButton ID="btnCancel" Text="Annulla" runat="server" CausesValidation="False"
                                CommandName="Cancel">
                            </telerik:RadButton>
                        </td>
                    </tr>
                </table>
                <telerik:RadDatePicker ID="RadDatePickerData_OldValue" DatePopupButton-Visible="true"
                    ShowPopupOnFocus="true" runat="server" Visible="false">
                </telerik:RadDatePicker>
                <asp:CheckBox ID="chkFlgRiservata_OldValue" runat="server" Visible="false" />
                <asp:TextBox ID="txtTitolo_OldValue" Visible="false" MaxLength="150" runat="server">
                </asp:TextBox>
                <asp:HiddenField ID="hidFileIDPubblico" runat="server" Value='<%# Bind("FileIDPubblico") %>' />
                <asp:HiddenField ID="hidDocumentIDRiservato" runat="server" Value='<%# Bind("DocumentIDRiservato") %>' />
                <asp:HiddenField ID="hidFileIDPubblico_OldValue" runat="server" Value="0" />
                <asp:HiddenField ID="hidDocumentIDRiservato_OldValue" runat="server" Value="0" />
 
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
    <script type="text/javascript">
 
        var $ = $telerik.$;
        var uploadsInProgress = 0;
 
        function onFileSelected(sender, args) {
            //alert("kkk");
            if (!uploadsInProgress)
                $("#btnUpdate").attr("disabled", "disabled");
 
            uploadsInProgress++;
        }
 
        function onFileUploaded(sender, args) {
            decrementUploadsInProgress();
        }
 
        function onUploadFailed(sender, args) {
            decrementUploadsInProgress();
        }
 
        function decrementUploadsInProgress() {
            uploadsInProgress--;
 
            if (!uploadsInProgress)
                $("#btnUpdate").removeAttr("disabled");
        }
             
 
         
    </script>
 
</telerik:RadScriptBlock>
 
</FormTemplate>
<EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column">
</EditColumn>
</EditFormSettings>

While I transfer a file, the button is not disabled. I think that it depends of the fact that the find function (and $) does not work at all. Can you give me a feedback?

Thanks for your support
0
Iana Tsolova
Telerik team
answered on 11 Oct 2011, 02:52 PM
Hello Fabio,

What if you change the code for finding the tableView as below:
var grid= $find("<%# TryCast(Container,GridItem).OwnerTableView.OwnerGrid.ClientID %>");
var tableView = grid.get_masterTableView();


Greetings,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Fabio Laserra
Top achievements
Rank 1
answered on 15 Oct 2011, 05:23 PM
It's exactly the same thing... grid is null... :(
perhaps it is an issue related to an incompatibility with dnn 6...
0
Iana Tsolova
Telerik team
answered on 16 Oct 2011, 04:44 PM
Hello Fabio,

RadGrid for ASP.NET AJAX is compatible with DNN 6. However, I suggest that you open a formal support ticket and send me there the files for the module so I can perform further testing on youe exact scenario.

Greetings,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Fabio Laserra
Top achievements
Rank 1
answered on 17 Oct 2011, 08:16 AM
Iana,
I am a customer of DNN, I bought 6 PRO that includes telerik engine. Can I open anyway support ticket with telerik? If so, how can I do?

Thanks
Fabio
0
Iana Tsolova
Telerik team
answered on 17 Oct 2011, 09:18 AM
Hi Fabio,

Currently you have a trial license for RadControls for ASP.NET AJAX, so you can open support ticket. For that purpose, log in to your Telerik account, go to Your Account page from the link located on the right top of the page, from the Quick links on the right menu select "Get Support" and on the next page choose "Contact Support Team".

Kind regards,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Fabio Laserra
Top achievements
Rank 1
answered on 17 Oct 2011, 10:41 AM
Ok but after the trial expiration? DNN customers have support for telerik products or a discount in order to buy it?

Thanks
Fabio
0
Iana Tsolova
Telerik team
answered on 17 Oct 2011, 02:56 PM
Hello Fabio,

You do not automatically get valid subscription for our controls. For a discount, please contact sales, by opening Sales Feedback for instance.

All the best,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Mario
Top achievements
Rank 1
answered on 17 Oct 2011, 05:02 PM
Done some days ago, but I didn' received any feedback at all...
0
Iana Tsolova
Telerik team
answered on 18 Oct 2011, 03:54 PM
Hi Mario,

You can try writing again or contact them on the phone: +1-888-365-2779

Best wishes,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Patrick
Top achievements
Rank 1
answered on 25 Apr 2019, 05:21 AM

I have the same issue.  Did someone post a solution to this problem yet?  I have search for a solution for this problem over 20 hours without success.  Whenever I use ClientScript.RegisterStartupScript and call my JavaScript function the $find returns null.  If I replace the $find with document.getElementById  or $get it works.  Also, he $find also works as expected when I set the Attributes in the ItemDataBound Event.

function ScrollToLastRow(radGridId, searchKey, dataKey) {
        //var grid = document.getElementById(radGridId);
        var grid=$get(radGridId);
        var master = grid.get_masterTableView();
       // master.set_dataSource(result);
        //master.rebind();
        var items = master.get_dataItems();
        for (var i = 0; i < items.length; i++) {
            var id = items[i].getDataKeyValue(dataKey);
            if (id == searchKey) {
                var rowElement = items[i].get_element();
                var offset = rowElement.offsetTop;
                setScroll(grid, offset);
            }
        }
    }

 

protected void rgdBrokerSourceSystemMapping_PreRender(object sender, EventArgs e)
   {
       try
 
       {
           if (IsAddNewRow)
           {
               var rgdBrokerSourceSystemMapping = (RadGrid)(sender);
 
               FutureBrokerSourceSystemMappings brokerSourceSystemMappings = (FutureBrokerSourceSystemMappings)ViewState["BrokerSourceSystemMappings"];
 
               var radGridId = rgdBrokerSourceSystemMapping.ClientID;
               //Index of last record in collection
               var index = ((FutureBrokerSourceSystemMappings)ViewState["BrokerSourceSystemMappings"]).Count - 1;
               //BrokerMappingID of last record in collection
               var searchKey = ((FutureBrokerSourceSystemMappings)ViewState["BrokerSourceSystemMappings"])[index].BrokerMappingID;
               var dataKey = "BrokerMappingID";
 
               var script = "ScrollToLastRow('" + radGridId + "', " + searchKey + ", '" + dataKey + "')";
 
               //ScriptManager sm = ScriptManager.GetCurrent(Page);
 
               //Invoke Javascript to scroll to the last record in the grid when user clicks the AddNewMapping Button
               ClientScript.RegisterStartupScript(this.GetType(), "MyFunction", script, true);
 
               rgdBrokerSourceSystemMapping.Items[brokerSourceSystemMappings.Count - 1].Focus();
 
               IsAddNewRow = false;
           }
       }
 
       catch (Exception ex)
 
       {
 
           // must not be any data yet - or something went horribly wrong!
 
       }
   }
<%@ Page Language="C#" AutoEventWireup="true" MaintainScrollPositionOnPostback="true" ValidateRequest="false" Inherits="Admin_FutureBrokerPage" MasterPageFile="~/Admin/AdminMasterPage.master" EnableEventValidation="false" CodeBehind="FutureBroker.aspx.cs" %>
 
<%@ Register TagPrefix="CONtrOLS" Namespace="BMS.Web.Controls" Assembly="BMSData" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
 
<asp:Content ID="cntMainContent" ContentPlaceHolderID="cphdMainContent" runat="Server">
 
    <asp:PlaceHolder ID="phdBroker" runat="server">
        <table cellspacing="0" cellpadding="0" width="100%">
            <tr>
                <td valign="top" width="100%">
                    <table cellspacing="0" cellpadding="0" width="100%" align="center">
                        <tr>
                            <td valign="top" width="100%" colspan="2">
                                <table cellspacing="0" cellpadding="0" width="100%" border="0">
                                    <tr>
                                        <td valign="top">
                                            <div class="pageheader">Admin - Futures Brokers</div>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <telerik:RadComboBox ID="ddlBrokerType" runat="server" DataTextField="BrokerTypeName" DataValueField="BrokerTypeID" MarkFirstMatch="true" Skin="Office2010Silver" NoWrap="true" TabIndex="1" AutoPostBack="true" Width="250px" OnSelectedIndexChanged="cboBrokerType_SelectedIndexChanged" />
                                  
                        <telerik:RadComboBox ID="cboBrokerName" runat="server" DataTextField="BrokerName" DataValueField="BrokerID" MarkFirstMatch="true" Skin="Office2010Silver" NoWrap="true" TabIndex="2" AutoPostBack="true" Width="250px" OnSelectedIndexChanged="cboBrokerName_SelectedIndexChanged" />
                                  
                         Broker Code: <telerik:RadTextBox ID="txtBrokerCode" runat="server" TabIndex="3"></telerik:RadTextBox
                        <telerik:RadComboBox ID="cboIsActive" runat="server" MarkFirstMatch="true" Skin="Office2010Silver" NoWrap="true" TabIndex="4" AutoPostBack="true" Width="130px" OnSelectedIndexChanged="cboIsActive_SelectedIndexChanged">
                            <Items>
                                <telerik:RadComboBoxItem Value="2" Text="SELECT ISACTIVE" Selected="true" />
                                <telerik:RadComboBoxItem Value="1" Text="IS ACTIVE" />
                                <telerik:RadComboBoxItem Value="0" Text="NOT ACTIVE" />
                            </Items>
                        </telerik:RadComboBox>
                                  
                        <telerik:RadButton ID="btnSearch" Text="Search" runat="server" OnClick="btnSearch_Click" Skin="Office2010Silver" TabIndex="5"></telerik:RadButton>
                                <br />
                                <asp:Panel ID="pnlSearch" runat="server" DefaultButton="btnSearch">
                                    <telerik:RadButton ID="btnFilterDisplay" runat="server" Text="Hide Filter" OnClick="btnFilterDisplay_Click" Skin="Office2010Silver" TabIndex="4" Visible="false"></telerik:RadButton>
                                    <telerik:RadFilter runat="server" ID="rfBrokers" ShowApplyButton="false" Skin="Office2010Silver" Visible="true" TabIndex="3">
                                        <FieldEditors>
                                            <telerik:RadFilterTextFieldEditor FieldName="BrokerName" DisplayName="BROKER NAME" DataType="System.String" />
                                            <telerik:RadFilterTextFieldEditor FieldName="Description" DisplayName="BROKER DESCRIPTION" DataType="System.String" />
                                        </FieldEditors>
                                    </telerik:RadFilter>
                                </asp:Panel>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" width="100%" colspan="2">
                                <telerik:RadGrid ID="rgdBroker" Width="100%"
                                    AllowSorting="True" ShowFooter="True" runat="server"
                                    AutoGenerateColumns="False" GridLines="Both" HeaderStyle-Font-Bold="true" ShowStatusBar="true"
                                    Skin="Office2010Silver" AllowMultiRowSelection="True"
                                    OnNeedDataSource="rgdBroker_NeedDataSource"
                                    OnItemCommand="rgdBroker_ItemCommand"
                                    OnItemDataBound="rgdBroker_ItemDataBound"
                                    AllowFilteringByColumn="False" AllowPaging="true" PageSize="100"
                                    EnableLinqExpressions="false"
                                    AllowAutomaticInserts="false"
                                    AllowAutomaticUpdates="false">
                                    <GroupingSettings CaseSensitive="false" />
                                    <ClientSettings EnableRowHoverStyle="true">
                                        <Selecting AllowRowSelect="true" />
                                    </ClientSettings>
                                    <MasterTableView
                                        AllowAutomaticInserts="false"
                                        AllowAutomaticUpdates="false" CommandItemDisplay="Top" DataKeyNames="BrokerID" AutoGenerateColumns="false" EditMode="EditForms" ShowFooter="True" TableLayout="Auto">
                                        <HeaderStyle HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" />
                                        <AlternatingItemStyle HorizontalAlign="Center" />
                                        <FooterStyle HorizontalAlign="Center" />
                                        <Columns>
                                            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" />
                                            <telerik:GridBoundColumn DataField="BrokerID" HeaderText="" Visible="false" />
                                            <telerik:GridBoundColumn DataField="BrokerName" HeaderText="BROKER NAME" />
                                            <telerik:GridBoundColumn DataField="Description" HeaderText="BROKER DESCRIPTION" />
                                            <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="EMAIL ADDRESS" />
                                            <telerik:GridBoundColumn DataField="Address1" HeaderText="ADDRESS 1" />
                                            <telerik:GridBoundColumn DataField="Address2" HeaderText="ADDRESS 2" />
                                            <telerik:GridBoundColumn DataField="Address3" HeaderText="ADDRESS 3" />
                                            <telerik:GridBoundColumn DataField="Address4" HeaderText="ADDRESS 4" />
                                        </Columns>
                                        <EditFormSettings EditFormType="Template">
                                            <FormTemplate>
                                                <table>
                                                    <tr>
                                                        <td valign="top" align="left">
                                                            <asp:PlaceHolder ID="phdValidation" runat="server" Visible="false">
                                                                <br />
                                                                <asp:ValidationSummary ID="valSummary" runat="server" CssClass="error" DisplayMode="BulletList" Enabled="true" HeaderText="Please fix the following:" ShowSummary="true" />
                                                            </asp:PlaceHolder>
                                                            <table id="tblEditBrokers" cellspacing="2" cellpadding="1" border="0" rules="none" style="border-collapse: collapse; background: white;">
                                                                <tr>
                                                                    <td>Broker Name:</td>
                                                                    <td>
                                                                        <telerik:RadTextBox ID="txtBrokerName" runat="server" Width="300px" TabIndex="44" MaxLength="100"></telerik:RadTextBox></td>
                                                                    <asp:RequiredFieldValidator ID="reqValidBrokerName" runat="server" ErrorMessage="Broker Name is a required field." ControlToValidate="txtBrokerName" Display="None" Enabled="false"></asp:RequiredFieldValidator>
                                                                </tr>
                                                                <tr>
                                                                    <td>Broker Description:</td>
                                                                    <td>
                                                                        <telerik:RadTextBox ID="txtBrokerDescription" runat="server" Width="300px" TabIndex="45" MaxLength="250"></telerik:RadTextBox></td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Notes:</td>
                                                                    <td>
                                                                        <telerik:RadTextBox ID="txtBrokerNote" runat="server" TextMode="MultiLine" Rows="3" Width="300px" MaxLength="250" Skin="Office2010Silver" TabIndex="46"></telerik:RadTextBox></td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Email Address:</td>
                                                                    <td>
                                                                        <telerik:RadTextBox ID="txtEmailAddress" runat="server" Width="300px" TabIndex="47" MaxLength="250"></telerik:RadTextBox></td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Send Email:</td>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkSendEmail" runat="server" TabIndex="48" /></td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Address 1:</td>
                                                                    <td>
                                                                        <telerik:RadTextBox ID="txtAddress1" runat="server" TabIndex="49" Enabled="true" Width="300px"></telerik:RadTextBox></td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Address 2:</td>
                                                                    <td>
                                                                        <telerik:RadTextBox ID="txtAddress2" runat="server" TabIndex="50" Enabled="true" Width="300px"></telerik:RadTextBox></td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Address 3:</td>
                                                                    <td>
                                                                        <telerik:RadTextBox ID="txtAddress3" runat="server" TabIndex="51" Enabled="true" Width="300px"></telerik:RadTextBox></td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Address 4:</td>
                                                                    <td>
                                                                        <telerik:RadTextBox ID="txtAddress4" runat="server" TabIndex="52" Enabled="true" Width="300px"></telerik:RadTextBox></td>
                                                                </tr>
                                                                <tr>
                                                                    <td>Is Active:</td>
                                                                    <td>
                                                                        <asp:CheckBox ID="chkIsActive" runat="server" TabIndex="53" /></td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="2" align="center">
                                                                        <telerik:RadButton ID="btnUpdate" Text='Update' runat="server" CommandName="Update" CommandArgument="" Skin="Office2010Silver" TabIndex="60"></telerik:RadButton>
                                                                          
                                                                <telerik:RadButton ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel" Skin="Office2010Silver" TabIndex="61"></telerik:RadButton>
                                                                        <asp:CustomValidator ID="custValidDuplicateBroker" runat="server" ControlToValidate="txtBrokerName" ErrorMessage="This broker already exists." Display="None" Enabled="false"></asp:CustomValidator>
                                                                    </td>
                                                        </td>
                                                    </tr>
                                                </table>
                                                </td>
                                                <td valign="top" align="left">
                                                    <table id="Table1" cellspacing="2" cellpadding="1" border="0" rules="none" style="border-collapse: collapse; background: white;">
                                                        <tr>
                                                            <td colspan="2">
                                                                <telerik:RadGrid ID="rgdBrokerDocument" ShowFooter="True" Width="200px"
                                                                    runat="server"
                                                                    AutoGenerateColumns="False" GridLines="Both" HeaderStyle-Font-Bold="true" ShowStatusBar="true"
                                                                    Skin="Office2010Silver"
                                                                    AllowFilteringByColumn="False"
                                                                    EnableLinqExpressions="false"
                                                                    AllowAutomaticInserts="false"
                                                                    AllowAutomaticUpdates="false"
                                                                    OnNeedDataSource="rgdBrokerDocument_NeedDataSource"
                                                                    OnItemDataBound="rgdBrokerDocument_ItemDataBound"
                                                                    OnItemCommand="rgdBrokerDocument_ItemCommand">
                                                                    <MasterTableView AllowAutomaticInserts="false" AllowAutomaticUpdates="false" DataKeyNames="BrokerDocumentID" AutoGenerateColumns="false" TableLayout="Auto">
                                                                        <HeaderStyle HorizontalAlign="Center" />
                                                                        <ItemStyle HorizontalAlign="Center" />
                                                                        <AlternatingItemStyle HorizontalAlign="Center" />
                                                                        <FooterStyle HorizontalAlign="Center" />
                                                                        <Columns>
                                                                            <telerik:GridBoundColumn DataField="BrokerDocumentID" HeaderText="" Visible="false" />
                                                                            <telerik:GridBoundColumn DataField="Extension" HeaderText="" Visible="false" />
                                                                            <telerik:GridTemplateColumn DataField="Type" UniqueName="Type" HeaderText="TYPE">
                                                                                <ItemTemplate>
                                                                                    <telerik:RadComboBox ID="cboBrokerDocumentType" runat="server" MarkFirstMatch="true" Skin="Office2010Silver" NoWrap="true" TabIndex="40" Width="75px">
                                                                                        <Items>
                                                                                            <telerik:RadComboBoxItem Value="1" Text="BROKER DOCUMENT" Selected="true" />
                                                                                        </Items>
                                                                                    </telerik:RadComboBox>
                                                                                </ItemTemplate>
                                                                            </telerik:GridTemplateColumn>
                                                                            <telerik:GridTemplateColumn DataField="Document" UniqueName="Document" HeaderText="DOCUMENT">
                                                                                <ItemTemplate>
                                                                                    <telerik:RadUpload ID="rupBrokerDocument" runat="server" ControlObjectsVisibility="None" MaxFileInputsCount="1" Skin="Office2010Silver" Width="230px" />
                                                                                    <asp:ImageButton ID="btnDocument" runat="server" ImageUrl="~/Images/ExportToPDF.gif" CommandName="DocumentImage" Visible="false" />
                                                                                </ItemTemplate>
                                                                                <FooterTemplate>
                                                                                    <telerik:RadButton ID="btnAddNewRow" runat="server" Text="Add Another Document" Skin="Office2010Silver" CommandName="AddAnotherDocument" />
                                                                                </FooterTemplate>
                                                                            </telerik:GridTemplateColumn>
                                                                            <telerik:GridButtonColumn ConfirmText="Delete this document?" ConfirmDialogType="RadWindow"
                                                                                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                                                                                UniqueName="DeleteColumn">
                                                                                <ItemStyle HorizontalAlign="Center" CssClass="handcursor" />
                                                                            </telerik:GridButtonColumn>
                                                                        </Columns>
                                                                    </MasterTableView>
                                                                </telerik:RadGrid>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td valign="top" align="left">
                                                                <table id="Table1" cellspacing="2" cellpadding="1" border="0" rules="none" style="border-collapse: collapse; background: white;">
                                                                    <tr>
                                                                        <td colspan="2">
                                                                            <telerik:RadGrid ID="rgdEntity" ShowFooter="True" Width="1050px"
                                                                                runat="server"
                                                                                AutoGenerateColumns="False" GridLines="Both" HeaderStyle-Font-Bold="true" ShowStatusBar="true"
                                                                                Skin="Office2010Silver"
                                                                                AllowFilteringByColumn="False"
                                                                                EnableLinqExpressions="false"
                                                                                AllowAutomaticInserts="false"
                                                                                AllowAutomaticUpdates="false"
                                                                                OnNeedDataSource="rgdEntity_NeedDataSource"
                                                                                OnItemDataBound="rgdEntity_ItemDataBound"
                                                                                OnItemCommand="rgdEntity_ItemCommand">
                                                                                <MasterTableView AllowAutomaticInserts="false" AllowAutomaticUpdates="false" DataKeyNames="EntityId" AutoGenerateColumns="false" TableLayout="Auto" CommandItemDisplay="Top" EditMode="EditForms">
                                                                                    <HeaderStyle HorizontalAlign="Center" />
                                                                                    <ItemStyle HorizontalAlign="Center" />
                                                                                    <AlternatingItemStyle HorizontalAlign="Center" />
                                                                                    <FooterStyle HorizontalAlign="Center" />
                                                                                    <Columns>
                                                                                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" />
                                                                                        <telerik:GridBoundColumn DataField="EntityId" HeaderText="ENTITY ID" Visible="true" />
                                                                                        <telerik:GridBoundColumn DataField="Entity" HeaderText="ENTITY NAME" Visible="true" />
                                                                                        <telerik:GridBoundColumn DataField="Descriptions" HeaderText="ENTITY DESCRIPTION" Visible="true" />
                                                                                        <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="EMAIL" Visible="true" />
                                                                                        <telerik:GridBoundColumn DataField="Address1" HeaderText="ADDRESS 1" Visible="true" />
                                                                                        <telerik:GridBoundColumn DataField="Address2" HeaderText="ADDRESS 2" Visible="true" />
                                                                                        <telerik:GridBoundColumn DataField="Address3" HeaderText="ADDRESS 3" Visible="true" />
                                                                                        <telerik:GridBoundColumn DataField="Address4" HeaderText="ADDRESS 4" Visible="true" />
                                                                                        <telerik:GridBoundColumn DataField="Address5" HeaderText="ADDRESS 5" Visible="true" />
                                                                                        <telerik:GridBoundColumn DataField="SendEmail" HeaderText="EMAIL INVOICE" Visible="False" />
                                                                                        <telerik:GridTemplateColumn DataField="SendEmail" UniqueName="SendEmail" HeaderText="EMAIL INVOICE" >
                                                                                            <ItemTemplate>
                                                                                                <asp:CheckBox ID="chkSendEmail" runat="server"  Enabled="False"/>
                                                                                            </ItemTemplate>
                                                                                            <ItemStyle Width="100px" />
                                                                                            <HeaderStyle Width="100px" />
                                                                                        </telerik:GridTemplateColumn>
                                                                                       
                                                                                        <telerik:GridBoundColumn DataField="UseEntityAddressForInvoice" HeaderText="USE ENTITY ADDRESS INV" Visible="false"  />
                                                                                        <telerik:GridTemplateColumn DataField="UseEntityAddressForInvoice" UniqueName="UseEntityAddressForInvoice" HeaderText="USE ENTITY ADDRESS INV" >
                                                                                            <ItemTemplate>
                                                                                                <asp:CheckBox ID="chkUseEntityAddressForInvoice" runat="server"  Enabled="False"/>
                                                                                            </ItemTemplate>
                                                                                            <ItemStyle Width="100px" />
                                                                                            <HeaderStyle Width="100px" />
                                                                                        </telerik:GridTemplateColumn>
                                                                                        <telerik:GridButtonColumn ConfirmText="Delete this Entity Code?"
                                                                                            ConfirmDialogType="RadWindow"
                                                                                            ConfirmTitle="Delete"
                                                                                            ButtonType="ImageButton"
                                                                                            CommandName="Delete"
                                                                                            Text="Delete"
                                                                                            UniqueName="DeleteColumn">
                                                                                            <ItemStyle HorizontalAlign="Center" CssClass="handcursor" />
                                                                                        </telerik:GridButtonColumn>
                                                                                    </Columns>
                                                                                    <EditFormSettings EditFormType="Template">
                                                                                        <FormTemplate>
                                                                                            <table>
                                                                                                <tr>
                                                                                                    <td>Entity ID:</td>
                                                                                                    <td>
                                                                                                        <telerik:RadTextBox ID="txtEntityID" runat="server" Visible="False"></telerik:RadTextBox>
                                                                                                    </td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td>Entity:
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <telerik:RadTextBox ID="txtEntity" runat="server"></telerik:RadTextBox>
                                                                                                    </td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td>Entity Name (Description):
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <telerik:RadTextBox ID="txtDescriptions" runat="server"></telerik:RadTextBox>
                                                                                                    </td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td>Email Address:
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <telerik:RadTextBox ID="txtEmailAddress" runat="server"></telerik:RadTextBox>
                                                                                                    </td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td>Address 1:
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <telerik:RadTextBox ID="txtEntityAddress1" runat="server"></telerik:RadTextBox>
                                                                                                    </td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td>Address 2:
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <telerik:RadTextBox ID="txtEntityAddress2" runat="server"></telerik:RadTextBox>
                                                                                                    </td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td>Address 3:
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <telerik:RadTextBox ID="txtEntityAddress3" runat="server"></telerik:RadTextBox>
                                                                                                    </td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td>Address 4:
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <telerik:RadTextBox ID="txtEntityAddress4" runat="server"></telerik:RadTextBox>
                                                                                                    </td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td>Address 5:
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <telerik:RadTextBox ID="txtEntityAddress5" runat="server"></telerik:RadTextBox>
                                                                                                    </td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td>Send Email:
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <asp:CheckBox ID="chkEntitySendEmail" runat="server" TabIndex="57" />
                                                                                                    </td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td>Use Entity Address For Invoice:
                                                                                                    </td>
                                                                                                    <td>
                                                                                                        <asp:CheckBox ID="chkUseEntityAddressForInvoice" runat="server" TabIndex="57" />
                                                                                                    </td>
                                                                                                </tr>
                                                                                                <tr>
                                                                                                    <td colspan="2" align="center">
                                                                                                        <telerik:RadButton ID="btnUpdate" Text='Update' runat="server" CommandName="Update" CommandArgument="" Skin="Office2010Silver" TabIndex="60"></telerik:RadButton>
                                                                                                        <telerik:RadButton ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel" Skin="Office2010Silver" TabIndex="61"></telerik:RadButton>
                                                                                                        <%--<asp:CustomValidator ID="custValidDuplicateBroker" runat="server" ControlToValidate="txtBrokerName" ErrorMessage="There is already an broker with these details." Display="None" Enabled="false"></asp:CustomValidator>--%>
                                                                                                    </td>
                                                                                                </tr>
                                                                                            </table>
                                                                                        </FormTemplate>
                                                                                    </EditFormSettings>
                                                                                </MasterTableView>
                                                                            </telerik:RadGrid>
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                        </tr>
                                                    </table>
                                                    <br />
                                                    <table id="Table2" cellspacing="2" cellpadding="1" border="0" rules="none" style="border-collapse: collapse; background: white;">
                                                        <tr>
                                                            <td colspan="2">
                                                                <telerik:RadGrid ID="rgdBrokerSourceSystemMapping" ShowFooter="True"  Width="1050px"  runat="server"
                                                                    AutoGenerateColumns="False" GridLines="Both" HeaderStyle-Font-Bold="true" ShowStatusBar="true"
                                                                    Skin="Office2010Silver"
                                                                    AllowFilteringByColumn="True"
                                                                    EnableLinqExpressions="false"
                                                                    AllowAutomaticInserts="false"
                                                                    AllowAutomaticUpdates="false"
                                                                    FilterItemStyle=""
                                                                    OnNeedDataSource="rgdBrokerSourceSystemMapping_NeedDataSource"
                                                                    OnItemDataBound="rgdBrokerSourceSystemMapping_ItemDataBound"
                                                                    OnItemCommand="rgdBrokerSourceSystemMapping_ItemCommand"
                                                                    OnPreRender="rgdBrokerSourceSystemMapping_PreRender"
                                                                    MasterTableView-ClientDataKeyNames="BrokerMappingID">
                                                                    <GroupingSettings CaseSensitive="false" />
                                                                    <ClientSettings EnableRowHoverStyle="true">
                                                                        <Selecting AllowRowSelect="true" />
                                                                        <Resizing AllowColumnResize="False" AllowRowResize="False" ResizeGridOnColumnResize="False"
                                                                            ClipCellContentOnResize="True" EnableRealTimeResize="False" AllowResizeToFit="False" />
                                                                        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true"  ScrollHeight="700"></Scrolling>
                                                                        <ClientEvents OnGridCreated="GridCreated" />
                                                                    </ClientSettings>
                                                                    <MasterTableView
                                                                        EditMode="EditForms" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
                                                                        DataKeyNames="BrokerMappingID"
                                                                        AutoGenerateColumns="false" TableLayout="Auto">
                                                                        <HeaderStyle HorizontalAlign="Center" />
                                                                        <ItemStyle HorizontalAlign="Center" />
                                                                        <AlternatingItemStyle HorizontalAlign="Center" />
                                                                        <FooterStyle HorizontalAlign="Center" />
                                                                        <Columns>
                                                                            <telerik:GridBoundColumn DataField="BrokerMappingID" HeaderText="" Visible="false" />
                                                                            <telerik:GridBoundColumn DataField="BrokerID" HeaderText="" Visible="false" />
 
                                                                            <telerik:GridBoundColumn DataField="SourceSystemID" UniqueName="USourceSystemID" HeaderText="" Visible="false" />
                                                                            <%--<telerik:GridBoundColumn DataField="SourceSystemName" UniqueName="USourceSystemName" HeaderText="" Visible="false" />--%>
                                                                            <telerik:GridBoundColumn DataField="ExchangeCode" UniqueName="UExchangeCode" HeaderText="" Visible="false" />
                                                                            <telerik:GridBoundColumn DataField="BrokerCode" UniqueName="UBrokerCode" HeaderText="" Visible="false" />
                                                                            <telerik:GridBoundColumn DataField="EntityID" UniqueName="UEntityID" HeaderText="" Visible="false" />
 
                                                                            <telerik:GridTemplateColumn DataField="SourceSystemID" UniqueName="Type" HeaderText="SOURCE">
                                                                                <ItemTemplate>
                                                                                    <telerik:RadComboBox ID="cboSourceSystem" runat="server" MarkFirstMatch="true" Skin="Office2010Silver" NoWrap="true" TabIndex="40" Width="150px" AutoPostBack="False" OnSelectedIndexChanged="cboSourceSystem_SelectedIndexChanged">
                                                                                        <Items>
                                                                                            <telerik:RadComboBoxItem Value="1" Text="GMI" Selected="true" />
                                                                                            <telerik:RadComboBoxItem Value="5" Text="CME BPS" />
                                                                                            <telerik:RadComboBoxItem Value="6" Text="CME EFS" />
                                                                                            <telerik:RadComboBoxItem Value="7" Text="CME GPS" />
                                                                                            <telerik:RadComboBoxItem Value="10" Text="ICEUS_ATOM" />
                                                                                            <telerik:RadComboBoxItem Value="11" Text="ICEUS_EFS" />
                                                                                            <telerik:RadComboBoxItem Value="12" Text="ICEUS_EGAINS" />
                                                                                            <telerik:RadComboBoxItem Value="14" Text="ICEEU_EFS" />
                                                                                            <telerik:RadComboBoxItem Value="15" Text="ICEEU_EGAINS" />
                                                                                        </Items>
                                                                                         
                                                                                    </telerik:RadComboBox>
                                                                                </ItemTemplate>
                                                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"  width="200px"/>
                                                                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="200px"/>
                                                                            </telerik:GridTemplateColumn>
                                                                            <telerik:GridTemplateColumn DataField="ExchangeCode" UniqueName="ExchangeCode" HeaderText="EXCHANGE CODE" >
                                                                                <ItemTemplate>
                                                                                    <telerik:RadTextBox ID="txtExchangeCode" runat="server" MaxLength="10" ></telerik:RadTextBox>
                                                                                </ItemTemplate>
                                                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"  width="175px"/>
                                                                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="175px"/>
                                                                            </telerik:GridTemplateColumn>
                                                                            <telerik:GridTemplateColumn DataField="BrokerCode" UniqueName="BrokerCode" HeaderText="BROKER CODE">
                                                                                <ItemTemplate>
                                                                                    <telerik:RadTextBox ID="txtBrokerCode" runat="server" MaxLength="10"> </telerik:RadTextBox>
                                                                                </ItemTemplate>
                                                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"  width="175px"/>
                                                                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="175px"/>
                                                                                 
                                                                            </telerik:GridTemplateColumn>
                                                                            <telerik:GridBoundColumn DataField="EntityName" HeaderText="ENTITY" Visible="false" UniqueName="UEntityName"/>
                                                                            <telerik:GridTemplateColumn DataField="EntityID" UniqueName="EntityID" HeaderText="ENTITY" >
                                                                                <ItemTemplate>
                                                                                    <telerik:RadComboBox ID="cboEntity" runat="server" Width="150px" NoWrap="True" MarkFirstMatch="true" Skin="Office2010Silver" DataTextField="Entity" DataValueField="EntityID" />
                                                                                </ItemTemplate>
                                                                                <FooterTemplate>
                                                                                    <telerik:RadButton ID="btnAddNewRow" runat="server" Text="Add Another Mapping" Skin="Office2010Silver" CommandName="AddAnotherSourceSystemMapping" />
                                                                                </FooterTemplate>
                                                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"  width="200px"/>
                                                                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="200px"/>
                                                                            </telerik:GridTemplateColumn>
                                                                            <telerik:GridTemplateColumn AllowFiltering="false">
                                                                                <ItemTemplate >
                                                                                    <asp:LinkButton ID="lnkAccountMapping" runat="server" CommandName="AccountMapping" Text="Account Mapping" Width="150" ForeColor="Black" AllowFiltering="false"></asp:LinkButton>
                                                                                </ItemTemplate>
                                                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"  width="175px"/>
                                                                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="175px"/>
                                                                            </telerik:GridTemplateColumn>
                                                                            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" />
                                                                            <telerik:GridButtonColumn ConfirmText="Delete this broker source system mapping?" ConfirmDialogType="RadWindow"
                                                                                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                                                                                UniqueName="DeleteColumn">
                                                                                <ItemStyle HorizontalAlign="Center" CssClass="handcursor" />
                                                                            </telerik:GridButtonColumn>
                                                                        </Columns>
                                                                        <EditFormSettings EditFormType="Template">
                                                                            <FormTemplate>
 
<%--                                                                                <div style="background-color: white; border: 1px black solid; height: 300px">--%>
 
                                                                                    <table cellspacing="2" cellpadding="1" width="100%" border="0" rules="none" style="border-collapse: collapse; background: white;">
                                                                                        <tr>
                                                                                            <td colspan="2">
                                                                                                <telerik:RadGrid ID="rgdFutureBrokerMarketMapping" ShowFooter="True" runat="server"
                                                                                                    AutoGenerateColumns="False" GridLines="Both" HeaderStyle-Font-Bold="true" ShowStatusBar="true"
                                                                                                    Skin="Office2010Silver"
                                                                                                    AllowFilteringByColumn="False"
                                                                                                    EnableLinqExpressions="false"
                                                                                                    AllowAutomaticInserts="false"
                                                                                                    AllowAutomaticUpdates="false"
                                                                                                    OnNeedDataSource="rgdFutureBrokerMarketMapping_NeedDataSource"
                                                                                                    OnItemDataBound="rgdFutureBrokerMarketMapping_ItemDataBound"
                                                                                                    OnItemCommand="rgdFutureBrokerMarketMapping_ItemCommand">
                                                                                                    <MasterTableView
                                                                                                        EditMode="EditForms" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" DataKeyNames="BrokerMappingID,BrokerMarketMappingID" AutoGenerateColumns="false" TableLayout="Auto" >
                                                                                                        <HeaderStyle HorizontalAlign="Center" />
                                                                                                        <ItemStyle HorizontalAlign="Center" />
                                                                                                        <AlternatingItemStyle HorizontalAlign="Center" />
                                                                                                        <FooterStyle HorizontalAlign="Center" />
                                                                                                        <Columns>
                                                                                                            <telerik:GridBoundColumn DataField="BrokerMarketMappingID" HeaderText="" Visible="false" />
                                                                                                            <telerik:GridBoundColumn DataField="BrokerMappingID" HeaderText="" Visible="false" />
                                                                                                            <telerik:GridBoundColumn DataField="BrokerMarketID" UniqueName="UBrokerMarketID" HeaderText="" Visible="false" />
                                                                                                            <telerik:GridBoundColumn DataField="IsParticipant" UniqueName="UIsParticipant" HeaderText="" Visible="false" />
                                                                                                            <telerik:GridBoundColumn DataField="EffectiveDateStart" UniqueName="UEffectiveDateStart" HeaderText="" Visible="false" />
                                                                                                            <telerik:GridBoundColumn DataField="EffectiveDateEND" UniqueName="UEffectiveDateEND" HeaderText="" Visible="false" />
 
                                                                                                            <telerik:GridTemplateColumn DataField="BrokerMarketID" UniqueName="BrokerMarketID" HeaderText="PARTICIPANT MARKET">
                                                                                                                <ItemTemplate>
                                                                                                                   <telerik:RadComboBox ID="cboMarket" runat="server" MarkFirstMatch="true"  DataTextField="Participant" DataValueField="BrokerMarketID" />
                                                                                                                </ItemTemplate>
                                                                                                                <ItemStyle Width="150px" />
                                                                                                                <HeaderStyle Width="150px" />
                                                                                                            </telerik:GridTemplateColumn>
                                                                                                            <telerik:GridTemplateColumn DataField="IsParticipant" UniqueName="IsParticipant" HeaderText="PARTICIPANT">
                                                                                                                <ItemTemplate>
                                                                                                                    <asp:CheckBox ID="chkIsParticipant" runat="server"  />
                                                                                                                </ItemTemplate>
                                                                                                                <ItemStyle Width="150px" />
                                                                                                                <HeaderStyle Width="150px" />
                                                                                                            </telerik:GridTemplateColumn>
                                                                                                            <telerik:GridTemplateColumn DataField="EffectiveDateStart" UniqueName="EffectiveDateStart" HeaderText="EFFECTIVE START DATE">
                                                                                                                <ItemTemplate>
                                                                                                                    <telerik:RadDatePicker ID="dtpEffectiveDateStart" runat="server" AutoPostBack="false" />
                                                                                                                </ItemTemplate>
                                                                                                                <ItemStyle Width="150px" />
                                                                                                                <HeaderStyle Width="150px" />
                                                                                                            </telerik:GridTemplateColumn>
                                                                                                            <telerik:GridTemplateColumn DataField="EffectiveDateEND" UniqueName="EffectiveDateEND" HeaderText="EFFECTIVE END DATE">
                                                                                                                <ItemTemplate>
                                                                                                                    <telerik:RadDatePicker ID="dtpEffectiveDateEnd" runat="server" AutoPostBack="false" />
                                                                                                                </ItemTemplate>
                                                                                                                <ItemStyle Width="150px" />
                                                                                                                <HeaderStyle Width="150px" />
                                                                                                                <FooterTemplate>
                                                                                                                    <table>
                                                                                                                        <tr>
                                                                                                                            <td>
                                                                                                                                <telerik:RadButton ID="btnAddNewMarket" runat="server" Text="Add Market" Skin="Office2010Silver" CommandName="Add" />
                                                                                                                            </td>
                                                                                                                            <td>
                                                                                                                                <telerik:RadButton ID="btnUpdateMarket" runat="server" Text="Update Market" Skin="Office2010Silver" CommandName="Update" />
                                                                                                                            </td>
                                                                                                                            <td>
                                                                                                                                <telerik:RadButton ID="btnCancel" runat="server" Text="Exit" Skin="Office2010Silver" CommandName="Cancel" />
                                                                                                                            </td>
                                                                                                                        </tr>
                                                                                                                    </table>
                                                                                                                </FooterTemplate>
                                                                                                            </telerik:GridTemplateColumn>
 
                                                                                                            <telerik:GridButtonColumn ConfirmText="Delete this Participant Market?" ConfirmDialogType="RadWindow"
                                                                                                                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                                                                                                                UniqueName="DeleteColumn">
                                                                                                                <ItemStyle HorizontalAlign="Center" CssClass="handcursor" />
                                                                                                            </telerik:GridButtonColumn>
                                                                                                        </Columns>
                                                                                                    </MasterTableView>
                                                                                                </telerik:RadGrid>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                <%--</div>--%>
                                                                            </FormTemplate>
                                                                        </EditFormSettings>
                                                                    </MasterTableView>
                                                                </telerik:RadGrid>
                                                                <asp:CustomValidator ID="custValidDuplicateBrokerMapping" runat="server" ErrorMessage="" Display="None" Enabled="false"></asp:CustomValidator>
                                                                <br />
                                                                <telerik:RadGrid ID="rgdBrokerAudit" ShowFooter="True" Width="200px"
                                                                    runat="server"
                                                                    AutoGenerateColumns="False" GridLines="Both" HeaderStyle-Font-Bold="true" ShowStatusBar="true"
                                                                    Skin="Office2010Silver"
                                                                    AllowFilteringByColumn="False"
                                                                    EnableLinqExpressions="false"
                                                                    AllowAutomaticInserts="false"
                                                                    AllowAutomaticUpdates="false"
                                                                    OnNeedDataSource="rgdBrokerAudit_NeedDataSource">
                                                                    <MasterTableView AllowAutomaticInserts="false" AllowAutomaticUpdates="false" DataKeyNames="BrokerAuditID" AutoGenerateColumns="false" TableLayout="Auto">
                                                                        <HeaderStyle HorizontalAlign="Center" />
                                                                        <ItemStyle HorizontalAlign="Left" />
                                                                        <AlternatingItemStyle HorizontalAlign="Left" />
                                                                        <FooterStyle HorizontalAlign="Center" />
                                                                        <Columns>
                                                                            <telerik:GridBoundColumn DataField="BrokerAuditID" HeaderText="" Visible="false" />
                                                                            <telerik:GridBoundColumn DataField="Description" HeaderText="DESCRIPTION" ItemStyle-Wrap="false" Visible="true" />
                                                                            <telerik:GridBoundColumn DataField="ModifiedBy" HeaderText="MODIFIED BY" Visible="true" />
                                                                            <telerik:GridBoundColumn DataField="DateTimeStamp" HeaderText="MODIFIED ON" ItemStyle-Wrap="false" Visible="true" />
                                                                        </Columns>
                                                                    </MasterTableView>
                                                                </telerik:RadGrid>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                                </tr>
                                        </table>
                                            </FormTemplate>
                                        </EditFormSettings>
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" colspan="2"
                            </td>
                        </tr>
                    </table>
                <br/>
                <br/>
                </td>
            </tr>
        </table>
    </asp:PlaceHolder>
 
    <asp:DataGrid ID="dtgExcelExport" runat="server"
        BorderColor="black"
        BorderWidth="1"
        GridLines="Both"
        CellPadding="3"
        CellSpacing="0"
        Font-Names="Times New Roman"
        Font-Size="10pt"
        HeaderStyle-BackColor="#999999"
        Visible="False" />
     
<script type="text/javascript">
    function TextBoxChanged(radGridId, textBoxUniqueName, index) {
        var masterTable = $find(radGridId).get_masterTableView();
        var cell1 = masterTable.getCellByColumnUniqueName(masterTable.get_dataItems()[index], textBoxUniqueName);
        cell1.style.backgroundColor="blue";
       // var txtCell = cell1.getElementsByTagName("input")[0];
 
        //txtCell.style.borderColor = 'blue';
        ////txtCell.innerText = "HeyMon";
 
    }
 
    function GridCreated(sender, args) {
        var scrollArea = sender.GridDataDiv;
        var dataHeight = sender.get_masterTableView().get_element().clientHeight; if (dataHeight < 350) {
            scrollArea.style.height = dataHeight + 17 + "px";
        }
    }
 
    function ScrollToLastRow(radGridId, searchKey, dataKey) {
        //var grid = document.getElementById(radGridId);
        var grid=$get(radGridId);
        var master = grid.get_masterTableView();
       // master.set_dataSource(result);
        //master.rebind();
        var items = master.get_dataItems();
        for (var i = 0; i < items.length; i++) {
            var id = items[i].getDataKeyValue(dataKey);
            if (id == searchKey) {
                var rowElement = items[i].get_element();
                var offset = rowElement.offsetTop;
                setScroll(grid, offset);
            }
        }
    }
 
    function setScroll(grid, scrollTop) {
        var dataDiv = $telerik.findElement(grid.get_element(), grid.get_id() + "_GridData");
        dataDiv.scrollTop = scrollTop;
    }
 
</script>
        </asp:Content>
0
Patrick
Top achievements
Rank 1
answered on 25 Apr 2019, 05:39 AM
protected void rgdBrokerSourceSystemMapping_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
   {
 
       RadGrid rgdBrokerSourceSystemMapping = (RadGrid)sender;
 
      
       if (e.Item is GridDataItem)
       {
           GridDataItem gridItem = (GridDataItem)e.Item;
           FutureBrokerSourceSystemMapping mapping = (FutureBrokerSourceSystemMapping)e.Item.DataItem;
 
           RadComboBox cboSourceSystem = (RadComboBox)gridItem.FindControl("cboSourceSystem");
           RadTextBox txtBrokerCode = (RadTextBox)gridItem.FindControl("txtBrokerCode");
           RadTextBox txtExchangeCode = (RadTextBox)gridItem.FindControl("txtExchangeCode");
           //RadTextBox txtEntityName = (RadTextBox)gridItem.FindControl("txtEntityName");
           ImageButton delete = (ImageButton)gridItem["DeleteColumn"].Controls[0];
           RadComboBox cboEntity = (RadComboBox)gridItem.FindControl("cboEntity");
           LinkButton lnkAccountMapping = (LinkButton) gridItem.FindControl("lnkAccountMapping");
 
           cboEntity.DataSource = EntityTable;
           cboEntity.DataBind();
           cboEntity.SelectedValue = mapping.EntityId.ToString();
 
           lnkAccountMapping.CommandArgument = mapping.BrokerCode;
           delete.CommandArgument = mapping.BrokerMappingID.ToString();
 
           if (mapping.SourceSystemID != 0)
           {
               cboSourceSystem.Items.FindItemByValue(mapping.SourceSystemID.ToString()).Selected = true;
           }
 
           txtExchangeCode.Visible = true;
           txtBrokerCode.Text = mapping.BrokerCode;
           txtExchangeCode.Text = mapping.ExchangeCode;
 
           if (mapping.BrokerMappingID <= 0)
           {
               gridItem.BackColor = Color.Yellow;
           }
 
           //Javascript to change border to blue when Cell Value changes
           txtExchangeCode.Attributes.Add("onchange", "TextBoxChanged('" + rgdBrokerSourceSystemMapping.ClientID + "','ExchangeCode'," + gridItem.ItemIndex + ")");
           txtBrokerCode.Attributes.Add("onchange", "TextBoxChanged('" + rgdBrokerSourceSystemMapping.ClientID + "','BrokerCode'," + gridItem.ItemIndex + ")");
           cboSourceSystem.Attributes.Add("onchange", "TextBoxChanged('" + rgdBrokerSourceSystemMapping.ClientID + "','Type'," + gridItem.ItemIndex + ")");
           cboEntity.Attributes.Add("onchange", "TextBoxChanged('" + rgdBrokerSourceSystemMapping.ClientID + "','EntityID'," + gridItem.ItemIndex + ")");
 
       }
 
       if (e.Item is GridFooterItem)
       {
           var gridFooter = (GridFooterItem)e.Item;
           var btnAddNewRow = (RadButton)gridFooter.FindControl("btnAddNewRow");
           var radGridId = rgdBrokerSourceSystemMapping.ClientID;
           //Index of last record in collection
           var index = ((FutureBrokerSourceSystemMappings)ViewState["BrokerSourceSystemMappings"]).Count - 1;
           //BrokerMappingID of last record in collection
           var searchKey = ((FutureBrokerSourceSystemMappings)ViewState["BrokerSourceSystemMappings"])[index].BrokerMappingID;
           var dataKey = "BrokerMappingID";
 
           //Invoke Javascript to scroll to the last record in the grid when user clicks the AddNewMapping Button
           btnAddNewRow.Attributes.Add("onclick", "ScrollToLastRow('" + radGridId + "', " + searchKey + ", '" + dataKey + "')");
       }
   }

Is there away to invoke the JavaScript after post back.in a RadGrid.  The RadButton has a server side and client side event.  The client side event is process first.  I need the server side to complete then the client side to process afterward. 

function ScrollToLastRow(radGridId, searchKey, dataKey) {
        //var grid = document.getElementById(radGridId);
        var grid=$find(radGridId);
        var master = grid.get_masterTableView();
       // master.set_dataSource(result);
        //master.rebind();
        var items = master.get_dataItems();
        for (var i = 0; i < items.length; i++) {
            var id = items[i].getDataKeyValue(dataKey);
            if (id == searchKey) {
                var rowElement = items[i].get_element();
                var offset = rowElement.offsetTop;
                setScroll(grid, offset);
            }
        }
    }
0
Eyup
Telerik team
answered on 29 Apr 2019, 08:01 AM
Hello Patrick,

When registering a client-side function from the code-behind, try using this approach instead:
https://docs.telerik.com/devtools/aspnet-ajax/controls/window/troubleshooting/opening-from-the-server

It will make sure that the Telerik scripts, including the $find method, are properly loaded beforehand.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Fabio Laserra
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Fabio Laserra
Top achievements
Rank 1
Iana Tsolova
Telerik team
Mario
Top achievements
Rank 1
Patrick
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or