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

error using hyperlink in grid

5 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
kellyroberts
Top achievements
Rank 1
kellyroberts asked on 06 Jun 2013, 12:49 PM
Hi Folks - I'm getting an error using the grid.  I have a hyperlink column that allows the user to select a certain record and view full details.  Grid seems to work for 99% of people.  I have one user in Moscow that is getting following error.  'get_masterTableView().get_dataItems()[...]' is null or not an object.  I asked the user to reinstall Java but same result.  Any ideas?  This is the first time I have run into a client error like this.

5 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 06 Jun 2013, 12:54 PM
Hello,

Can you please provide your code ?

Thanks,
Jayesh Goyani
0
kellyroberts
Top achievements
Rank 1
answered on 06 Jun 2013, 01:01 PM
Hi Jayesh - Thanks for quick reply ... you must be bored ;-)  the .cs is posted in sep reply

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="NET_Sales_Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>• Reactor Cycle Model</title>
    <link href="../../rcmmain.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .pagetitle
        {
            font-family: Verdana, Tahoma, Arial;
            color: White;
            font-size: 13px;
        }
       
       
        TABLE TD
        {
            font-family: Verdana, Tahoma, Arial;
            font-size: 9pt;
        }
       
        .style1
        {
        }
       
        .style6
        {
        }
        .style8
        {
        }
        .style17
        {
            width: 111px;
        }
        .style18
        {
            width: 89px;
        }
        .style21
        {
            width: 60px;
        }
        .style23
        {
            width: 73px;
        }
        .style24
        {
            width: 82px;
        }
        .style25
        {
            width: 88px;
        }
        .style26
        {
            width: 76px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <img src='../../images/TopBanner1.jpg' alt="" /><br />
    <span class="pagetitle" style="left: 115px; top: 5px; position: absolute">..:: Sales
        Demand Management - List</span>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
            </asp:ScriptReference>
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" EnableAJAX="false">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="gridLoadingPanel">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="gridLoadingPanel">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function ShowBudgetForm(SapUnitNo, rowIndex) {
                var grid = $find("<%= RadGrid1.ClientID %>");

                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                grid.get_masterTableView().selectItem(rowControl, true);

                window.radopen("Budget.aspx?sapunitno=" + SapUnitNo, "BudgetForm");
               
                return false;
            }

            function ShowLatestEstForm(SapUnitNo, rowIndex) {
                var grid = $find("<%= RadGrid1.ClientID %>");

                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                grid.get_masterTableView().selectItem(rowControl, true);

                window.radopen("BudgetLE.aspx?sapunitno=" + SapUnitNo, "LatestEstForm");
                return false;
            }

            function refreshGrid(arg) {
                if (!arg) {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                }
                else {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                }
            }
            function RowDblClick(sender, eventArgs) {
                window.radopen("Budget.aspx?sapunitno=" + eventArgs.getDataKeyValue("SAPUnitNo"), "BudgetForm");
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
        <Windows>
            <telerik:RadWindow ID="BudgetForm" runat="server" Title="RCM Popup" Skin="WebBlue"
                Height="275px" Width="500px" Left="50px" ReloadOnShow="true" ShowContentDuringLoad="false"
                Modal="true">
            </telerik:RadWindow>
        </Windows>

        <Windows>
            <telerik:RadWindow ID="LatestEstForm" runat="server" Title="RCM Popup" Skin="WebBlue"
                Height="275px" Width="500px" Left="50px" ReloadOnShow="true" ShowContentDuringLoad="false"
                Modal="true">
            </telerik:RadWindow>
        </Windows>

    </telerik:RadWindowManager>
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
        Skin="WebBlue" SelectedIndex="1">
        <Tabs>

            <telerik:RadTab runat="server" Text="Sales Demand Management" PageViewID="pgFind"  Selected="true">
            </telerik:RadTab>

            <telerik:RadTab runat="server" Text="Dashboard" PageViewID="pgDashboard" Visible="false">
            </telerik:RadTab>

            <telerik:RadTab runat="server" Text="My Units" PageViewID="pgMyUnits">
            </telerik:RadTab>

            <telerik:RadTab runat="server" Text="2013 Budgeted Units" PageViewID="pgBudgeted" Visible="false">
            </telerik:RadTab>

            <telerik:RadTab runat="server" Text="2013 Change-Outs" PageViewID="pgChangeouts"  Visible="false">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" Width="100%" SelectedIndex="1">
       
        <!-- DASHBOARD TAB - HIDDEN FOR NOW -->
        <telerik:RadPageView ID="pgDashboard" runat="server" BorderColor="#00008d"
            BorderStyle="Solid" BorderWidth="1px" Height="600px">
            <table>
                <tr>
                    <td>
                        Current Exceptions
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/DashboardPart1.jpg" />
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        Upcoming Changeouts without Quotes
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Image ID="Image2" runat="server" ImageUrl="~/Images/DashboardPart2.jpg" />
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        Other kinds of Dashboard items can go here
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </telerik:RadPageView>

        <!-- MY UNITS TAB -->
        <telerik:RadPageView ID="pgMyUnits" runat="server">
            <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" DataSourceID="SqlDataSource1"
                GridLines="None" Skin="WebBlue" AllowPaging="False" AllowSorting="True" PageSize="20"
                Height="600px" OnItemCreated="RadGrid1_ItemCreated">
                <ExportSettings ExportOnlyData="true" IgnorePaging="true">
                </ExportSettings>
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="SAPUnitNo" ClientDataKeyNames="SAPUnitNo"
                    CommandItemDisplay="Top" DataSourceID="SqlDataSource1">
                    <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false"
                        ExportToExcelText="Export to Excel" />
                    <Columns>

                   

                        <telerik:GridHyperLinkColumn DataNavigateUrlFields="SapUnitNo" DataNavigateUrlFormatString="/Sales/GetForm.asp?sapunitno={0}"
                            SortExpression="SapUnitNo" HeaderText="Unit No" Target="_New" DataTextField="SapUnitNo" UniqueName="OpenContent">
                        </telerik:GridHyperLinkColumn>

                        <telerik:GridTemplateColumn UniqueName="TemplateEditColumn" HeaderText="BDGT">
                            <ItemTemplate>
                                <asp:HyperLink ID="BudgetLink" runat="server" Text="BDGT"></asp:HyperLink>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>

                        <telerik:GridTemplateColumn UniqueName="TemplateEditColumn" HeaderText="LE">
                            <ItemTemplate>
                                <asp:HyperLink ID="LatestEstLink" runat="server" Text="LE"></asp:HyperLink>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>

                        <telerik:GridBoundColumn DataField="Company" HeaderText="Company" SortExpression="Company"
                            UniqueName="Company" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Location" HeaderText="Location" SortExpression="Location"
                            UniqueName="Location" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CountryCode" HeaderText="Country" SortExpression="CountryCode"
                            UniqueName="CountryCode">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Region" HeaderText="Region" SortExpression="Region"
                            UniqueName="Region">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="UnitReactor" HeaderText="Unit/Reactor Group"
                            SortExpression="UnitReactor" UniqueName="UnitReactor" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ServiceType" HeaderText="Svc Type" SortExpression="ServiceType"
                            UniqueName="ServiceType" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="BusinessSegment" HeaderText="Busn Seg" SortExpression="BusinessSegment"
                            UniqueName="BusinessSegment">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Market_Segment" HeaderText="Mkt Seg" SortExpression="Market_Segment"
                            UniqueName="Market_Segment">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="AcctResp" HeaderText="Acct Resp" SortExpression="AcctResp"
                            UniqueName="AcctResp">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="zsalesmgr" HeaderText="Sales Mgr" SortExpression="zsalesmgr"
                            UniqueName="zsalesmgr">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="LastChange" HeaderText="Last Change" ReadOnly="True"
                            SortExpression="LastChange" UniqueName="LastChange">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="NextChange" HeaderText="Next Change" ReadOnly="True"
                            SortExpression="NextChange" UniqueName="NextChange">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_DeliveryDate" DataType="System.DateTime"
                            HeaderText="Delivery Date" DataFormatString="{0:d}" SortExpression="FSN_DeliveryDate"
                            UniqueName="FSN_DeliveryDate">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Mktg_Shift_Status" HeaderText="W/L/K/FTG" ItemStyle-Wrap="false"
                            SortExpression="Mktg_Shift_Status" UniqueName="Mktg_Shift_Status">
                            <ItemStyle Wrap="False"></ItemStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_CycleMonths" DataType="System.Int32" HeaderText="Cycle Mo"
                            SortExpression="FSN_CycleMonths" UniqueName="FSN_CycleMonths">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_CCCProbability" DataType="System.Byte" HeaderText="Probability"
                            SortExpression="FSN_CCCProbability" UniqueName="FSN_CCCProbability">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Budget" HeaderText="Budget" SortExpression="Budget"
                            UniqueName="Budget">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="BudgetLE" HeaderText="BudgetLE" SortExpression="BudgetLE"
                            UniqueName="BudgetLE">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CurrentMssgText" HeaderText="Action Message"
                            SortExpression="CurrentMssgText" UniqueName="CurrentMssgText" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="LastUpdated" HeaderText="Last Updated" ReadOnly="True"
                            SortExpression="LastUpdated" UniqueName="LastUpdated">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CurrentIncumbent" ItemStyle-Wrap="false" HeaderText="Incumbent"
                            SortExpression="CurrentIncumbent" UniqueName="CurrentIncumbent">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Winner" HeaderText="Award To" SortExpression="Winner"
                            UniqueName="Winner" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Lbs" DataType="System.Int32" HeaderText="Lbs"
                            ReadOnly="True" SortExpression="Lbs" UniqueName="Lbs">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Revenue" DataType="System.Decimal" HeaderText="Revenue"
                            ReadOnly="True" SortExpression="Revenue" UniqueName="Revenue">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CM" DataType="System.Decimal" HeaderText="CM"
                            ReadOnly="True" SortExpression="CM" UniqueName="CM">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="SAPCustNo" DataType="System.Int32" HeaderText="SAP Cust"
                            SortExpression="SAPCustNo" UniqueName="SAPCustNo">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="SAPUnitNo" DataType="System.Int32" HeaderText="SAP Unit"
                            ReadOnly="True" SortExpression="SAPUnitNo" UniqueName="SAPUnitNo">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_P_SAPDescription" HeaderText="Product Description (Fresh 1)"
                            SortExpression="FSN_P_SAPDescription" UniqueName="FSN_P_SAPDescription" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_S_SAPDescription" HeaderText="Product Description (Fresh 2)"
                            SortExpression="FSN_S_SAPDescription" UniqueName="FSN_S_SAPDescription" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_RG_SAPDescription" HeaderText="Regen" SortExpression="FSN_RG_SAPDescription"
                            UniqueName="FSN_RG_SAPDescription" Display="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_RS_SAPDescription" HeaderText="Resale" SortExpression="FSN_RS_SAPDescription"
                            UniqueName="FSN_RS_SAPDescription" Display="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_RV_SAPDescription" HeaderText="Revit" SortExpression="FSN_RV_SAPDescription"
                            UniqueName="FSN_RV_SAPDescription" Display="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_P_ReactorVolume" DataType="System.Int32"
                            HeaderText="Reactor Volume (cuft)" SortExpression="FSN_P_ReactorVolume" UniqueName="FSN_P_ReactorVolume">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="PreSul" HeaderText="PreSul" SortExpression="PreSul"
                            Display="false" UniqueName="PreSul">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="RegenPot" HeaderText="RegenPot" SortExpression="RegenPot"
                            Display="false" UniqueName="RegenPot">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="HPP" DataType="System.Decimal" HeaderText="HPP"
                            Display="false" SortExpression="HPP" UniqueName="HPP">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Craked" DataType="System.Int32" HeaderText="Craked"
                            Display="false" SortExpression="Craked" UniqueName="Craked">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Sulfur" DataType="System.Decimal" HeaderText="Sulfur"
                            Display="false" SortExpression="Sulfur" UniqueName="Sulfur">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="LHSV" DataType="System.Decimal" HeaderText="LHSV"
                            Display="false" SortExpression="LHSV" UniqueName="LHSV">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Crudes" HeaderText="Crudes" SortExpression="Crudes"
                            Display="false" UniqueName="Crudes">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" ReadOnly="True"
                            SortExpression="ID" UniqueName="ID">
                        </telerik:GridBoundColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                    <PagerStyle AlwaysVisible="True" />
                </MasterTableView>
                <ClientSettings>
                    <Selecting AllowRowSelect="true"></Selecting>
                    <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                </ClientSettings>
                <PagerStyle AlwaysVisible="True" />
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                </HeaderContextMenu>
            </telerik:RadGrid>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="sp_RCM_NET_Sales_Select_MyUnits" SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:Parameter Name="username" Type="String" />
                </SelectParameters>
            </asp:SqlDataSource>
        </telerik:RadPageView>

        <!-- ADVANCED FIND TAB - AKA SALES DEMAND MANAGEMENT -->
        <telerik:RadPageView ID="pgFind" runat="server" Height="600px" Selected="true">
            <table border="0" cellpadding="2" style="border: 5px #000080 1px solid; border-bottom-width: 3px;
                background-color: #CBCED5;">
                <tr>
                    <td class="style1" colspan="3">
                        <asp:Label ID="Label2" runat="server">Company</asp:Label><br />
                        <asp:DropDownList ID="ddlCompany" runat="server" AppendDataBoundItems="true" DataSourceID="sqlCompany"
                            DataTextField="name" DataValueField="name">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td class="style6" colspan="3">
                        <asp:Label ID="Label1" runat="server">Parent</asp:Label>
                        <br />
                        <asp:DropDownList ID="ddlParent" runat="server" AppendDataBoundItems="true"
                            DataSourceID="sqlParent" DataTextField="name" DataValueField="hkunnr">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                        </asp:DropDownList>
                        <br />
                    </td>
                    <td class="style8" colspan="2">
                        <asp:Label ID="Label4" runat="server">SAP Material Description</asp:Label>
                        <br />
                        <asp:TextBox ID="txtSAPMaterialDesc" runat="server"></asp:TextBox>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="style17">
                        <asp:Label ID="Label6" runat="server">Country</asp:Label><br />
                        <asp:DropDownList ID="ddlCountryCode" runat="server" AppendDataBoundItems="true"
                            DataSourceID="sqlCountryCode" DataTextField="name" DataValueField="name">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td class="style25" rowspan="3">
                        <asp:Label ID="Label8" runat="server">Acct Resp</asp:Label>
                        <asp:ListBox ID="lstAcctResp" runat="server" AppendDataBoundItems="true"
                            DataSourceID="sqlAcctResp" DataTextField="name" DataValueField="name" Rows="8">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                        </asp:ListBox>
                    </td>
                    <td class="style18" rowspan="3">
                        <asp:Label ID="Label9" runat="server">Sales Mgr</asp:Label>
                        <asp:ListBox ID="lstSalesMgr" runat="server" AppendDataBoundItems="true"
                            DataSourceID="sqlSalesMgr" DataTextField="name" DataValueField="name" Rows="8">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                        </asp:ListBox>
                    </td>
                    <td class="style21" rowspan="3">
                        <asp:Label ID="Label10" runat="server">Budget</asp:Label><br />
                        <asp:ListBox runat="server" ID="lstBudget" AppendDataBoundItems="true" Rows="8" DataSourceID="sqlBudget"
                            DataTextField="name" DataValueField="name">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                        </asp:ListBox>
                    </td>
                    <td class="style23" rowspan="3">
                        <asp:Label ID="Label11" runat="server">Latest Est</asp:Label><br />
                        <asp:ListBox runat="server" ID="lstBudgetLE" AppendDataBoundItems="true" Rows="8"
                            DataSourceID="sqlBudget" DataTextField="name" DataValueField="name">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                        </asp:ListBox>
                    </td>
                    <td class="style24" rowspan="3">
                        <asp:Label ID="Label3" runat="server">Service Type</asp:Label><br />
                        <asp:ListBox runat="server" ID="lstServiceType" AppendDataBoundItems="true" Rows="8"
                            DataSourceID="sqlServiceType" DataTextField="name" DataValueField="name">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                        </asp:ListBox>
                    </td>
                    <td class="style8" colspan="2">
                        <asp:Label ID="Label12" runat="server">Business Seg</asp:Label>
                        <br />
                        <asp:DropDownList ID="ddlBusinessSeg" runat="server"
                            AppendDataBoundItems="true" DataSourceID="sqlBusinessSegment"
                            DataTextField="name" DataValueField="name" Height="16px">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                        </asp:DropDownList>
                        <br />
                    </td>
                </tr>
                <tr>
                    <td class="style17">
                        <asp:Label ID="Label5" runat="server">Region</asp:Label><br />
                        <asp:DropDownList ID="ddlRegion" runat="server" AppendDataBoundItems="true"
                            DataSourceID="sqlRegion" DataTextField="name" DataValueField="name">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td class="style26">
                        <asp:Label ID="Label7" runat="server">Mkt Seg</asp:Label>
                        <br />
                        <asp:DropDownList ID="ddlMarketSeg" runat="server">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                            <asp:ListItem Text="AD" Value="AD"></asp:ListItem>
                            <asp:ListItem Text="BD" Value="BD"></asp:ListItem>
                            <asp:ListItem Text="DR" Value="DR"></asp:ListItem>
                            <asp:ListItem Text="FG" Value="FG"></asp:ListItem>
                            <asp:ListItem Text="LR" Value="LR"></asp:ListItem>
                            <asp:ListItem Text="PP" Value="PP"></asp:ListItem>
                            <asp:ListItem Text="TF" Value="TF"></asp:ListItem>
                            <asp:ListItem Text="ZZ" Value="ZZ"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:Label ID="Label13" runat="server">Date From</asp:Label>
                        <br />
                        <telerik:RadDatePicker ID="dtpDateFrom" runat="server">
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td class="style17">
                       
                        <asp:Button ID="Find" runat="server" OnClick="Find_Click" Text="Show" />
                        <asp:Button ID="Reset" runat="server" OnClick="Reset_Click" Text="Reset" />
                       
                    </td>
                    <td class="style26">
                        <asp:Label ID="Label15" runat="server">Probability</asp:Label>
                        <br />
                        <asp:DropDownList ID="ddlProbability" runat="server">
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                            <asp:ListItem Text="0" Value="0"></asp:ListItem>
                            <asp:ListItem Text="25" Value="25"></asp:ListItem>
                            <asp:ListItem Text="50" Value="50"></asp:ListItem>
                            <asp:ListItem Text="70" Value="70"></asp:ListItem>
                            <asp:ListItem Text="75" Value="75"></asp:ListItem>
                            <asp:ListItem Text="90" Value="90"></asp:ListItem>
                            <asp:ListItem Text="100" Value="100"></asp:ListItem>
                        </asp:DropDownList>
                        <br />
                    </td>
                    <td>
                        <asp:Label ID="Label14" runat="server">Date To </asp:Label>
                        <br />
                        <telerik:RadDatePicker ID="dtpDateTo" runat="server">
                        </telerik:RadDatePicker>
                    </td>
                </tr>
            </table>
            <telerik:RadGrid ID="grdAdvancedFind" runat="server" CellSpacing="0"
                GridLines="None" Skin="WebBlue" AllowPaging="False" AllowSorting="True" PageSize="20"
                Height="600px" OnItemCreated="RadGrid1_ItemCreated"
                onneeddatasource="grdAdvancedFind_NeedDataSource"
                ondeletecommand="grdAdvancedFind_DeleteCommand1">
                <ExportSettings ExportOnlyData="true" IgnorePaging="true">
                </ExportSettings>
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="id" ClientDataKeyNames="id"
                    CommandItemDisplay="Top">
                    <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false"
                        ExportToExcelText="Export to Excel" />
                    <Columns>
                   
                       

                        <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" HeaderText="Delete" ConfirmTextFields="company,location,unitreactor"
                            ConfirmTextFormatString="Are you sure you wan to delete {0},{1}: {2}" ConfirmTitle="Delete Unit" UniqueName="Delete" Visible="false" />                   
                   
                   
                        <telerik:GridHyperLinkColumn DataNavigateUrlFields="SapUnitNo" DataNavigateUrlFormatString="/Sales/GetForm.asp?sapunitno={0}"
                            SortExpression="SapUnitNo" HeaderText="Unit No" DataTextField="SapUnitNo" UniqueName="OpenContent">
                        </telerik:GridHyperLinkColumn>
                       
                        <telerik:GridTemplateColumn UniqueName="TemplateEditColumn" HeaderText="BDGT">
                            <ItemTemplate>
                                <asp:HyperLink ID="BudgetLink" runat="server" Text="BDGT"></asp:HyperLink>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>

                        <telerik:GridTemplateColumn UniqueName="TemplateEditColumn" HeaderText="LE">
                            <ItemTemplate>
                                <asp:HyperLink ID="LatestEstLink" runat="server" Text="LE"></asp:HyperLink>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>

                        <telerik:GridBoundColumn DataField="sapunitno" HeaderText="sapunitno" UniqueName="SapUnitNo">
                        </telerik:GridBoundColumn>

                        <telerik:GridBoundColumn DataField="Company" HeaderText="Company" SortExpression="Company"
                            UniqueName="Company" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Location" HeaderText="Location" SortExpression="Location"
                            UniqueName="Location" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CountryCode" HeaderText="Country" SortExpression="CountryCode"
                            UniqueName="CountryCode">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Region" HeaderText="Region" SortExpression="Region"
                            UniqueName="Region">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="UnitReactor" HeaderText="Unit/Reactor Group"
                            SortExpression="UnitReactor" UniqueName="UnitReactor" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ServiceType" HeaderText="Svc Type" SortExpression="ServiceType"
                            UniqueName="ServiceType" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="BusinessSegment" HeaderText="Busn Seg" SortExpression="BusinessSegment"
                            UniqueName="BusinessSegment">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Market_Segment" HeaderText="Mkt Seg" SortExpression="Market_Segment"
                            UniqueName="Market_Segment">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="AcctResp" HeaderText="Acct Resp" SortExpression="AcctResp"
                            UniqueName="AcctResp">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="zsalesmgr" HeaderText="Sales Mgr" SortExpression="zsalesmgr"
                            UniqueName="zsalesmgr">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="LastChange" HeaderText="Last Change" ReadOnly="True"
                            SortExpression="LastChange" UniqueName="LastChange">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="NextChange" HeaderText="Next Change" ReadOnly="True"
                            SortExpression="NextChange" UniqueName="NextChange">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_DeliveryDate" DataType="System.DateTime"
                            HeaderText="Delivery Date" DataFormatString="{0:d}" SortExpression="FSN_DeliveryDate"
                            UniqueName="FSN_DeliveryDate">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Mktg_Shift_Status" HeaderText="W/L/K/FTG" ItemStyle-Wrap="false"
                            SortExpression="Mktg_Shift_Status" UniqueName="Mktg_Shift_Status">
                            <ItemStyle Wrap="False"></ItemStyle>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_CycleMonths" DataType="System.Int32" HeaderText="Cycle Mo"
                            SortExpression="FSN_CycleMonths" UniqueName="FSN_CycleMonths">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_CCCProbability" DataType="System.Byte" HeaderText="Probability"
                            SortExpression="FSN_CCCProbability" UniqueName="FSN_CCCProbability">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Budget" HeaderText="Budget" SortExpression="Budget"
                            UniqueName="Budget">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="BudgetLE" HeaderText="BudgetLE" SortExpression="BudgetLE"
                            UniqueName="BudgetLE">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CurrentMssgText" HeaderText="Action Message"
                            SortExpression="CurrentMssgText" UniqueName="CurrentMssgText" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="LastUpdated" HeaderText="Last Updated" ReadOnly="True"
                            SortExpression="LastUpdated" UniqueName="LastUpdated">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CurrentIncumbent" ItemStyle-Wrap="false" HeaderText="Incumbent"
                            SortExpression="CurrentIncumbent" UniqueName="CurrentIncumbent">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Winner" HeaderText="Award To" SortExpression="Winner"
                            UniqueName="Winner" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Lbs" DataType="System.Int32" HeaderText="Lbs"
                            ReadOnly="True" SortExpression="Lbs" UniqueName="Lbs">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Revenue" DataType="System.Decimal" HeaderText="Revenue"
                            ReadOnly="True" SortExpression="Revenue" UniqueName="Revenue">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CM" DataType="System.Decimal" HeaderText="CM"
                            ReadOnly="True" SortExpression="CM" UniqueName="CM">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="SAPCustNo" DataType="System.Int32" HeaderText="SAP Cust"
                            SortExpression="SAPCustNo" UniqueName="SAPCustNo">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="SAPUnitNo" DataType="System.Int32" HeaderText="SAP Unit"
                            ReadOnly="True" SortExpression="SAPUnitNo" UniqueName="SAPUnitNo">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_P_SAPDescription" HeaderText="Product Description (Fresh 1)"
                            SortExpression="FSN_P_SAPDescription" UniqueName="FSN_P_SAPDescription" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_S_SAPDescription" HeaderText="Product Description (Fresh 2)"
                            SortExpression="FSN_S_SAPDescription" UniqueName="FSN_S_SAPDescription" ItemStyle-Wrap="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_RG_SAPDescription" HeaderText="Regen" SortExpression="FSN_RG_SAPDescription"
                            UniqueName="FSN_RG_SAPDescription" Display="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_RS_SAPDescription" HeaderText="Resale" SortExpression="FSN_RS_SAPDescription"
                            UniqueName="FSN_RS_SAPDescription" Display="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_RV_SAPDescription" HeaderText="Revit" SortExpression="FSN_RV_SAPDescription"
                            UniqueName="FSN_RV_SAPDescription" Display="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="FSN_P_ReactorVolume" DataType="System.Int32"
                            HeaderText="Reactor Volume (cuft)" SortExpression="FSN_P_ReactorVolume" UniqueName="FSN_P_ReactorVolume">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="PreSul" HeaderText="PreSul" SortExpression="PreSul"
                            Display="false" UniqueName="PreSul">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="RegenPot" HeaderText="RegenPot" SortExpression="RegenPot"
                            Display="false" UniqueName="RegenPot">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="HPP" DataType="System.Decimal" HeaderText="HPP"
                            Display="false" SortExpression="HPP" UniqueName="HPP">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Craked" DataType="System.Int32" HeaderText="Craked"
                            Display="false" SortExpression="Craked" UniqueName="Craked">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Sulfur" DataType="System.Decimal" HeaderText="Sulfur"
                            Display="false" SortExpression="Sulfur" UniqueName="Sulfur">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="LHSV" DataType="System.Decimal" HeaderText="LHSV"
                            Display="false" SortExpression="LHSV" UniqueName="LHSV">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Crudes" HeaderText="Crudes" SortExpression="Crudes"
                            Display="false" UniqueName="Crudes">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" ReadOnly="True"
                            SortExpression="ID" UniqueName="ID">
                        </telerik:GridBoundColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                    <PagerStyle AlwaysVisible="True" />
                </MasterTableView>
                <ClientSettings>
                    <Selecting AllowRowSelect="true"></Selecting>
                    <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                </ClientSettings>
                <PagerStyle AlwaysVisible="True" />
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                </HeaderContextMenu>
            </telerik:RadGrid>

            <asp:SqlDataSource ID="sqlAdvancedFind" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="sp_RCM_NET_Sales_Select_AdvancedFind" SelectCommandType="StoredProcedure"
                DeleteCommand="sp_RCM_NET_Sales_DeleteUnit" DeleteCommandType="StoredProcedure"
                CancelSelectOnNullParameter="false">
                <SelectParameters>

                    <asp:ControlParameter Name="Parent" ControlID="ddlParent" PropertyName="SelectedValue" />
                    <asp:ControlParameter Name="Company" ControlID="ddlCompany" PropertyName="SelectedValue" />
                    <asp:ControlParameter Name="Region" ControlID="ddlRegion" PropertyName="SelectedValue" />
                    <asp:ControlParameter Name="CountryCode" ControlID="ddlCountryCode" PropertyName="SelectedValue" />
                    <asp:ControlParameter Name="AcctResp" ControlID="lstAcctResp" PropertyName="SelectedValue" />
                    <asp:ControlParameter Name="SalesMgr" ControlID="lstSalesMgr" PropertyName="SelectedValue" />
                    <asp:ControlParameter Name="MarketSeg" ControlID="ddlMarketSeg" PropertyName="SelectedValue" />
                    <asp:ControlParameter Name="ServiceType" ControlID="lstServiceType" PropertyName="SelectedValue" />
                    <asp:ControlParameter Name="BusinessSeg" ControlID="ddlBusinessSeg" PropertyName="SelectedValue" />
                    <asp:ControlParameter Name="Budget" ControlID="lstBudget" PropertyName="SelectedValue" />
                    <asp:ControlParameter Name="BudgetLE" ControlID="lstBudgetLE" PropertyName="SelectedValue" />
                    <asp:ControlParameter Name="DateFrom" ControlID="dtpDateFrom" PropertyName="SelectedDate" />
                    <asp:ControlParameter Name="DateTo" ControlID="dtpDateTo" PropertyName="SelectedDate" />
              

              
                </SelectParameters>
                <DeleteParameters>
                    <asp:Parameter name="sapunitno" />
                    <asp:SessionParameter SessionField="username" Name="username" />
                </DeleteParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="sqlParent" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="sp_RCM_NET_GetList_Parent" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="sqlCompany" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="sp_RCM_NET_GetList_Company" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="sqlCountryCode" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="sp_RCM_NET_GetList_CountryCode" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="sqlServiceType" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="sp_RCM_NET_GetList_ServiceType" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="sqlRegion" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="sp_RCM_NET_GetList_Region" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="sqlAcctResp" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="sp_RCM_NET_GetList_AcctResp" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="sqlSalesMgr" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="sp_RCM_NET_GetList_SalesMgr" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="sqlBudget" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="sp_RCM_NET_GetList_Budget" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="sqlBudgetLE" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="sp_RCM_NET_GetList_Budget" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="sqlBusinessSegment" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="sp_RCM_NET_GetList_BusinessSegment" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>

            <asp:SqlDataSource ID="sqlDeleteAuthorities" runat="server" ConnectionString="<%$ ConnectionStrings:RCMConnectionString %>"
                SelectCommand="SELECT SETTINGVALUE FROM SETTINGS WHERE SETTINGNAME='UNIT_DELETE_AUTHORITY'">
            </asp:SqlDataSource>

 

        </telerik:RadPageView>

        <telerik:RadPageView ID="pgBudgeted" runat="server" BorderColor="#00008d" BorderStyle="Solid"
            BorderWidth="1px" Height="600px">
            Budgeted Units (List of units budgeted for the current year)
        </telerik:RadPageView>

        <telerik:RadPageView ID="pgChangeouts" runat="server" BorderColor="#00008d" BorderStyle="Solid"
            BorderWidth="1px" Height="600px">
            Upcoming Change-outs (List of units with change outs this year)
        </telerik:RadPageView>
    </telerik:RadMultiPage>
    <br />
    <asp:Label runat="server" ID="lblDebug"></asp:Label>
    </form>
</body>
</html>

0
kellyroberts
Top achievements
Rank 1
answered on 06 Jun 2013, 01:01 PM

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
using System.Data.SqlClient;

public partial class NET_Sales_Default : System.Web.UI.Page
{

    //static int _len = HttpContext.Current.User.Identity.Name.Length;
    //static int _start = HttpContext.Current.User.Identity.Name.IndexOf('\\') +1;
    //string _username = HttpContext.Current.User.Identity.Name.Substring(_start, _len-_start).ToString();

    protected void Page_Load(object sender, EventArgs e)
    {

        int _len = HttpContext.Current.User.Identity.Name.Length;
        int _start = HttpContext.Current.User.Identity.Name.IndexOf('\\') +1;
        string _username = HttpContext.Current.User.Identity.Name.Substring(_start, _len-_start).ToString();

        RadTabStrip1.Tabs[1].Text = "My Units (" + _username + ")";
        lblDebug.Text = "current User: " + HttpContext.Current.User.Identity.Name;
        SqlDataSource1.SelectParameters["username"].DefaultValue = HttpContext.Current.User.Identity.Name;

        toggleDeletecolumn();

    }

 

    protected void toggleDeletecolumn()
    {
        int len = HttpContext.Current.User.Identity.Name.Length;
        int start = HttpContext.Current.User.Identity.Name.IndexOf('\\') +1;
        string username = HttpContext.Current.User.Identity.Name.Substring(start, len-start).ToString();

 

        DataView dv = (DataView)sqlDeleteAuthorities.Select(DataSourceSelectArguments.Empty);
       
        if (dv.Count > 0) {

            string deleteauthorities = dv[0]["SETTINGVALUE"].ToString();

            if (deleteauthorities.Length > 0) {

               
                if (deleteauthorities.Contains(username)) {

                        grdAdvancedFind.Columns[0].Visible = true;

                } else {

                        grdAdvancedFind.Columns[0].Visible = false;
                }

            }

        }
       
       
        //sqlDeleteAuthorities

        //UNIT_DELETE_AUTHORITY
    }

    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {
            RadGrid1.MasterTableView.SortExpressions.Clear();
            RadGrid1.MasterTableView.GroupByExpressions.Clear();
            RadGrid1.Rebind();
        }
        else if (e.Argument == "RebindAndNavigate")
        {
            RadGrid1.MasterTableView.SortExpressions.Clear();
            RadGrid1.MasterTableView.GroupByExpressions.Clear();
            RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
            RadGrid1.Rebind();
        }
    }

 

    protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {

        if (e.Item is GridDataItem)
        {
            HyperLink budgetLink = (HyperLink)e.Item.FindControl("BudgetLink");
            HyperLink latestestLink = (HyperLink)e.Item.FindControl("LatestEstLink");
            budgetLink.Attributes["href"] = "javascript:void(0);";
            latestestLink.Attributes["href"] = "javascript:void(0);";

            //budgetLink.Attributes["onclick"] = String.Format("return ShowBudgetForm('{0}','{1}');", 99999 , e.Item.ItemIndex);
           
            budgetLink.Attributes["onclick"] = String.Format("return ShowBudgetForm('{0}','{1}');",
                   e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["SAPUnitNo"],
                   e.Item.ItemIndex);

            latestestLink.Attributes["onclick"] = String.Format("return ShowLatestEstForm('{0}','{1}');",
                    e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["SAPUnitNo"],
                    e.Item.ItemIndex);

        }

    }

 

    protected void Find_Click(object sender, EventArgs e)
    {

        //lblDebug.Text = lstBudget.SelectedValue;
        grdAdvancedFind.Rebind();

    }

    protected void Reset_Click(object sender, EventArgs e)
    {

        ddlParent.SelectedIndex = 0;
        ddlCompany.SelectedIndex = 0;
        ddlCountryCode.SelectedIndex = 0;
        ddlRegion.SelectedIndex = 0;
        lstAcctResp.SelectedIndex = 0;
        lstSalesMgr.SelectedIndex = 0;
        lstBudgetLE.SelectedIndex = 0;
        lstBudget.SelectedIndex = 0;

        txtSAPMaterialDesc.Text = "";
        dtpDateFrom.SelectedDate = null;
        dtpDateTo.SelectedDate = null;

       
    }
    protected void grdAdvancedFind_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {

        //grdAdvancedFind.DataSource = sqlAdvancedFind;

        if (Page.IsPostBack)
        {
            grdAdvancedFind.DataSource = sqlAdvancedFind;

        }

    }

 

    protected void grdAdvancedFind_DeleteCommand1(object sender, GridCommandEventArgs e)
    {

        string sapunitno = grdAdvancedFind.MasterTableView.Items[e.Item.ItemIndex]["sapunitno"].Text;

        sqlAdvancedFind.DeleteParameters["sapunitno"].DefaultValue = sapunitno;
        sqlAdvancedFind.DeleteParameters["username"].DefaultValue = HttpContext.Current.User.Identity.Name;
        sqlAdvancedFind.Delete();
        //Response.Write("deleted");

    }
}

0
kellyroberts
Top achievements
Rank 1
answered on 06 Jun 2013, 01:04 PM
This works ok on my machine.  I can click the hyperlink column and a new page opens.  So based on that I dont think there are any server/compile errors.  Since this is one machine that it does not work on I presumed it would be a client issue.  I am in the US and the user is in Moscow.  Could this be caused by regional settings? or codepages?
0
Eyup
Telerik team
answered on 11 Jun 2013, 12:27 PM
Hello Kelly,

Probably this is a browser related behavior - does this user face this issue on all browsers? You can send him the following demo and ask him to share whether the same error is observed:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=grid

In any case, we will need a sample to reproduce the issue from our end to further analyze and debug the problematic behavior.
 
Regards,
Eyup
Telerik
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 the blog feed now.
Tags
Grid
Asked by
kellyroberts
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
kellyroberts
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or