Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
186 views
There are 2 scenarios which causes this error.

First scenario:

Selecting a treeview control which is inside the combobox which will cause an ajax process
while a radgrid is within the page and while the code behind are inside a try catch block.
When the code is not in a try catch block, nothing appears.

Second scenario:

Inside a radwindow or normal window(appears using window.open):
Selecting a treeview control which is inside the combobox which will cause an ajax process.
Although this is without a radgrid but error occured, is this due to child window?

I've read some articles about setting something at the web config file but i'm not sure if
its the appropriate solution for me. I'm using version v.2011.2.712.40

Regards,
Dexter
dexter
Top achievements
Rank 1
 asked on 22 Sep 2011
4 answers
186 views
I put the code so please help me with this problem and being able to solve. thanks

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 <%@ Register Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"

 Namespace="CrystalDecisions.Web" TagPrefix="CR" %>

 <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %>

 <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

 <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

    <script language="javascript" type="text/javascript">

     function onRequestStart(sender, args) {

         if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0) {

                 args.set_enableAjax(false);

                 }

       }

 </script>

</telerik:RadScriptBlock>

<table>

<tr>

 <td style="width: 100px; height: 21px">

 <asp:Label ID="LblTituloReporte" runat="server" SkinID="TituloPaginasAdm" Text="Clientes"

 Width="786px"></asp:Label><br />

 <br />

 </td>

 </tr>

 <tr>

 <td>

 <table>

 <tr>

 <td>

 <asp:Label ID="LbClientes" runat="server" CssClass="FormatLabels" SkinID="TitleLabel"

 Text="Cliente" Width="145px"></asp:Label>

 </td>

 <td style="width: 245px">

 <asp:DropDownList ID="DropDownList1Abecedario" runat="server" Font-Names="verdana"

 AutoPostBack="true" Font-Size="10pt" Width="150px" OnSelectedIndexChanged="DropDownList1Abecedario_OnSelectedIndexChanged">

 <asp:ListItem Value="0">----</asp:ListItem>

 <asp:ListItem Value="1">A-C</asp:ListItem>

 <asp:ListItem Value="2">D-F</asp:ListItem>

 <asp:ListItem Value="3">G-I</asp:ListItem>

 <asp:ListItem Value="4">J-L</asp:ListItem>

 <asp:ListItem Value="5">M-O</asp:ListItem>

 <asp:ListItem Value="6">P-R</asp:ListItem>

 <asp:ListItem Value="7">S-U</asp:ListItem>

 <asp:ListItem Value="8">V-Z</asp:ListItem>

 </asp:DropDownList>

 <asp:UpdatePanel ID="UpdatePanel1" runat="server">

 <ContentTemplate>

 <asp:DropDownList ID="DropDownList1Organizador" runat="server" Font-Names="verdana"

 Font-Size="10pt" Width="380px">

 </asp:DropDownList>

 </ContentTemplate>

 <Triggers>

 <asp:AsyncPostBackTrigger ControlID="DropDownList1Abecedario" EventName="SelectedIndexChanged" />

 </Triggers>

 </asp:UpdatePanel>

 </td>

 <td style="width: 99px;">

<telerik:RadButton ID="ImgConsultar" Text="Consultar" runat="server" Skin="Hay" OnClick="ImgConsultar_Click">

 </telerik:RadButton>

 </td>

 </tr>

 <tr>

 <td>

 &nbsp;

 </td>

 <td>

 &nbsp;

 <asp:CheckBox ID="chkVerTodos" Text="Ver todos los clientes" AutoPostBack="true"

 OnCheckedChanged="chkVerTodos_OnCheckedChanged" runat="server" />

 </td>

 <td>

 </td>

 </tr>

 </table>

 <br />

 </td>

 </tr>

 </table>

 <table>

 <tr>

 <td style="width: 121px">

 &nbsp;

 <asp:Label ID="LbTituloCliente" runat="server" CssClass="FormatLabels" SkinID="TituloPaginasAdm"

 Text="Cliente" Visible="false" Width="660px"></asp:Label>

 <asp:Label ID="LbIngresoDatos" runat="server" CssClass="FormatLabels" Enabled="false"

 SkinID="TituloPaginasAdm" Text="Ingreso de datos" Visible="false" Width="160px"></asp:Label>

 </td>

 <td>

 </td>

 <td>

 </td>

 </tr>

 <tr>

 <td>

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 <ClientEvents OnRequestStart="onRequestStart" />

 <AjaxSettings>

 <telerik:AjaxSetting AjaxControlID="RadAjaxPanel1">

 </telerik:AjaxSetting>

 <telerik:AjaxSetting AjaxControlID="RadGridHistorico">

 </telerik:AjaxSetting>

 </AjaxSettings>

 </telerik:RadAjaxManager>

 <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" HorizontalAlign="NotSet"

 Width="1195px">

 <telerik:RadGrid ID="RadGridHistorico" runat="server" Skin="Hay" AllowPaging="True"

 AutoGenerateColumns="False" GridLines="None" AllowFilteringByColumn="True" AllowSorting="True"

 ShowGroupPanel="True" ViewStateMode="Enabled" OnPreRender="RadGridHistorico_OnPreRender">

 <ExportSettings ExportOnlyData="true" FileName="Log clientes" HideStructureColumns="true"

 IgnorePaging="true" OpenInNewWindow="true" />

 <ClientSettings AllowDragToGroup="True">

 </ClientSettings>

 <MasterTableView CommandItemDisplay="Top">

 <CommandItemSettings ShowExportToExcelButton="true" />

 <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">

 </RowIndicatorColumn>

 <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">

 </ExpandCollapseColumn>

 <Columns>

 <telerik:GridBoundColumn AndCurrentFilterFunction="Contains" DataField="NitCliete"

 FilterControlAltText="Filter column column" HeaderText="NitCliete" UniqueName="column">

 </telerik:GridBoundColumn>

 <telerik:GridBoundColumn AndCurrentFilterFunction="Contains" DataField="NombreCliente"

 FilterControlAltText="Filter column1 column" HeaderText="NombreCliente" UniqueName="column1">

 </telerik:GridBoundColumn>

 <telerik:GridBoundColumn AndCurrentFilterFunction="Contains" DataField="ModificadoEliminado"

 FilterControlAltText="Filter column2 column" HeaderText="ModificadoEliminado"

 UniqueName="column2">

 </telerik:GridBoundColumn>

 </Columns>

 <EditFormSettings>

 <EditColumn FilterControlAltText="Filter EditCommandColumn column">

 </EditColumn>

 </EditFormSettings>

 </MasterTableView>

 <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">

 </ClientSettings>

 <GroupPanel Text="Arrastre la cabecera de la columna y sueltela sobre esta &#225;rea para agrupar los registros por esa columna.">

 </GroupPanel>

 <FilterMenu EnableImageSprites="False">

 </FilterMenu>

 <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Hay">

 </HeaderContextMenu>

 </telerik:RadGrid>

 </telerik:RadAjaxPanel>

 </td>

 </td>

 </tr>

  </table>

 <table>

  <tr>

 <td style="width: 100px">

 </td>

 </tr>

 </table>

 </asp:Content>

 

ALBERT
Top achievements
Rank 1
 answered on 21 Sep 2011
1 answer
168 views
Hello,

I have created a rad window popup inside of a web page that passes back data to it's parent, very similar to the demo you provide on your website. The code works perfectly fine in my local dev environment (VS2010), however when we test the same code on another web server the radwindow gives an exception stating '...file does not exist'. We added some logging and it seems to be looking for a code behind file that frankly for what purpose we do not understand. It seems to fail on the .Show() method of the radwindow itself as far as we can tell, when looking for this file.

Again the code works fine locally.

Here is how we have the window set up on the parent page:

<telerik:RadWindowManager ID="RadWindowManager1" <br>ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" runat="server" EnableShadow="True" <br>VisibleTitlebar="true" EnableTheming="True" AutoSize="true" Behaviors="None" Skin="Forest"><br>    <Windows><br>        <telerik:RadWindow ID="rwChemicalCropApplicationRates" runat="server" <br>                            Behaviors="Close, Move"<br>                            OnClientClose="rwChemicalCropApplicationRates_Close"<br>                            NavigateUrl="Dialogs/ModifyCropApplicationRate.aspx" Skin="Telerik"><br>        </telerik:RadWindow><br>    </Windows><br></telerik:RadWindowManager>

On the radwindow itself we just use javascript to pass some of the data back to the parent page.

Again please note this all works perfectly fine in Visual Studio 2010, when we publish the code to another web server this popup (and only this one) does not work.

I am hoping you can help me look in the right direction.

Please let me know what other information, if any, I can provide.

Thank you very much in advance.
Justin
Top achievements
Rank 1
 answered on 21 Sep 2011
7 answers
165 views
http://demos.telerik.com/aspnet-ajax/grid/examples/client/scrolling/defaultcs.aspx.
Hi,
In the link, right top corner of the grid getting blank space(same like in my grid also). please give suggestion how to fill the color in that empty white space. like this happening in version 2011.

Regards
Saravana Kumar
Pavlina
Telerik team
 answered on 21 Sep 2011
8 answers
312 views
Hi,

I'm using a LiteralControl to catch exception errors within the RadGrid. The literal control is added to the bottom of the page, and on a long list of items cannot be seen. Please let me know a setting to add the LiteralControl someplace toward the top of the grid and highlite the line in red. The following is my c# code.

 

 

try

 

{

 

 

BlowDownDataLayer.InsertBlowDownEvents(this.ToString(),

 

 

 

Int32.Parse(RadComboboxPlant.SelectedValue.ToString()),

 

 

 

Int32.Parse(RadComboboxEquip.SelectedValue.ToString()),

 

txtEventDesc.Text.ToString(),

 

 

Int32.Parse(RadComboboxBldGasType.SelectedValue.ToString()),

 

 

 

Int32.Parse((insertedItem["BlowDownEmissionColumn"].Controls[0] as RadNumericTextBox).Text.ToString()),

 

 

 

Int32.Parse((insertedItem["NumberofBlowdownEvents"].Controls[0] as RadNumericTextBox).Text.ToString()),

 

 

 

DateTime.Parse(EventdtTime.SelectedDate.ToString()));

 

}

 

 

catch (Exception ex)

 

{

GridBlowDown.Controls.Add(

 

new LiteralControl("Unable to insert Event. If the problem persists, please contact IT Service Center (x8765)."));

 

e.Canceled =

 

true;

 

}

thanks,
Minh Bui

Andrey
Telerik team
 answered on 21 Sep 2011
3 answers
76 views
I'm having a few problems getting the custom filtering to work. At the moment, I'm getting an error because the SQL Select command string ends up looking like this:

SELECT * FROM WTO_LinkGroups WHERE (Convert.ToString(it["group_name"]) = "3")

The inline code was borrowed from the demo and modified for my needs. Apart from the problem above, it's picking up the ID field in the example above rather than the 'group_name' field. The inline code is this:

<telerik:GridBoundColumn DataField="group_name" HeaderText="Group Name" SortExpression="group_name"
                        UniqueName="group_name">
                        <FilterTemplate>
                            <telerik:RadComboBox runat="server" ID="GroupNameComboBox" DataSourceID="SqlDataSource1"
                                DataTextField="group_name" DataValueField="group_id" Height="200px" AppendDataBoundItems="true"
                                SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("group_name").CurrentFilterValue %>'
                                OnClientSelectedIndexChanged="GroupNameIndexChanged">
                                <Items>
                                    <telerik:RadComboBoxItem Text="All" />
                                </Items>
                            </telerik:RadComboBox>
                            <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                                <script type="text/javascript">
                                    function GroupNameIndexChanged(sender, args) {
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("group_name", args.get_item().get_value(), "EqualTo");
 
                                    }
                                </script>
                            </telerik:RadScriptBlock>
                        </FilterTemplate>
                    </telerik:GridBoundColumn>

Oh ... and here's the codebehind:

protected void RefreshCombos()
    {
        SqlDataSource1.SelectCommand = "SELECT * FROM WTO_LinkGroups WHERE " + RadGrid1.MasterTableView.FilterExpression.ToString();
        SqlDataSource1.SelectCommandType = System.Web.UI.WebControls.SqlDataSourceCommandType.Text;
        RadGrid1.MasterTableView.Rebind();
    }

The error crops up on the Rebind.

Where is the problem being caused?

Thanks.
Daniel
Telerik team
 answered on 21 Sep 2011
1 answer
341 views
Greetings,

I was able to get the RadComboBox to work with autocomplete by loading all of the distinct rows from my sql datatable for a certain column and returning them all at once. Naturally with a lot of values it was very slow, but none the less it worked. Knowing this wouldnt be ok for production I began digging into the LoadOnDemand demo's, specifically this one:
http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/autocompletesql/defaultcs.aspx

I used the demo almost verbatim in my code as I want it to work like the server side example. However when I click my combobox it shows the first 10 items (or whatever I set it to) but when I start typing in lettters it goes to "Loading.." and unless the value is in that first set of 10 it won't autocomplete. Basically it has to be in the ItemsRequested set in order to autocomplete. Is it possible to autocomplete with large data sets without having to load every item into the combobox?

(sorry for the long post, I figured more detail is better than less). Any help is appreciated.

btw FillComboBox() just returns my query string..

My Control:
<telerik:RadComboBox ID="ddlRadComboBox" Runat="server"
            EmptyMessage="Enter a skill name" 
                MarkFirstMatch="True"
                MaxLength="200" ShowDropDownOnTextboxClick="True" 
                OnItemsRequested="ddlRadComboBox_ItemsRequested" 
                EnableVirtualScrolling="True" ItemsPerRequest="10"
                ShowMoreResultsBox="true" EnableLoadOnDemand="True"
                 />

private DataTable GetData(string text)
        {
            try
            {
                //using() requires no close()
                using (connection = new SqlConnection(ConnectionString))
                {
                    //open connection to db
                    connection.Open();
  
                    //change command query based on dropdown
                    myCommand = new SqlCommand(FillComboBox(), connection);
                    using (adapter = new SqlDataAdapter(myCommand))
                    {
                        comboBoxDT = new DataTable();
                        adapter.Fill(comboBoxDT);
  
                        return comboBoxDT;
                    }
                }
            }
            catch (Exception ex)
            {
                HandleException(ex);
            }
  
            return comboBoxDT;
        }

protected void ddlRadComboBox_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
    DataTable data = GetData(e.Text);
    int itemOffset = e.NumberOfItems;
    int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count);
    e.EndOfItems = endOffset == data.Rows.Count;
    for (int i = itemOffset; i < endOffset; i++)
    {
        ddlRadComboBox.Items.Add(new RadComboBoxItem(data.Rows[i]["SkillName"].ToString(), data.Rows[i]["SkillName"].ToString()));
    }
}
Christopher
Top achievements
Rank 1
 answered on 21 Sep 2011
2 answers
104 views
I have a radgrid with a hierarchy and I have it set so the child table has grouping enabled. It works fine except that I would like the rows to be collapsed after the grouping selection is made. How do I go about making that happen? Thanks for any help.

I'm using version Q2 2011 and a the grid is bound to a sqldatasource
AkAlan
Top achievements
Rank 2
 answered on 21 Sep 2011
2 answers
119 views
Hi guys,

I am using Telerik radchart in my web application and the chart is populated from a datasource.

The X-axis is AutoScale = false and Y-axis is AutoScale = true.

I was wondering if there is a way to have only 10 items marked on the Y-axis at all times.

radchart1.PlotArea.YAxis.MaxItemsCount = 10; does not seem to work.

Let me know if you need more information.

Thanks in advance.

Rushma
Top achievements
Rank 1
 answered on 21 Sep 2011
6 answers
134 views
Hello,

I have a senario in which closing an edit form is taking an unacceptable amount of time. It takes an average of 4 seconds to open the form and over 30 seconds to close the form. Does anyone have any suggestions to why this would be the case?

Here is the markup:
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" 
                AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
                AllowMultiRowSelection="True" AllowSorting="True" AllowFilteringByColumn="true"
                AutoGenerateColumns="False" CellSpacing="0" GridLines="None"
                GroupingEnabled="False" PageSize="20" Skin="Web20">
                <clientsettings>
                </clientsettings>
                <headercontextmenu cssclass="GridContextMenu GridContextMenu_Default"></headercontextmenu>
                <PagerStyle AlwaysVisible="True" Mode="NextPrevAndNumeric" />
                <mastertableview allowautomaticinserts="True" DataKeyNames="UPC_Num" 
                    allowmulticolumnsorting="True" commanditemdisplay="Top" 
                    insertitempageindexaction="ShowItemOnFirstPage" NoMasterRecordsText="No UPCs Exist for this Product">
                    <CommandItemSettings ExportToPdfText="Export to PDF" />
                    <rowindicatorcolumn filtercontrolalttext="Filter RowIndicator column"></rowindicatorcolumn>
                    <expandcollapsecolumn filtercontrolalttext="Filter ExpandColumn column"></expandcollapsecolumn>
                    <Columns>
                        <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column" UpdateText="Edit"></telerik:GridEditCommandColumn>
                        <telerik:GridTemplateColumn UniqueName="cbSelect" AllowFiltering="false">
                            <HeaderTemplate>
                                <asp:CheckBox id="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True" runat="server"></asp:CheckBox>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox id="CheckBox1" runat="server"></asp:CheckBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn runat="server" DataField="UPC_Num" FilterControlAltText="Filter UPC_Num column" 
                            HeaderText="UPC #" UniqueName="UPC_Num">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn runat="server" DataField="UPC_Nme" 
                            FilterControlAltText="Filter UPC_Nme column" HeaderText="Name" UniqueName="UPC_Nme">
                        </telerik:GridBoundColumn>
                        <telerik:GridDateTimeColumn runat="server" DataField="Start_Dte" 
                            DataFormatString="{0:M/dd/yyyy}" FilterControlAltText="Filter Start_Dte column" 
                            HeaderText="Start Date" MaxDate="2999-12-31" UniqueName="Start_Dte">
                        </telerik:GridDateTimeColumn>
                        <telerik:GridBoundColumn runat="server" DataField="Active_Flg" 
                            FilterControlAltText="Filter Active_Flg column" HeaderText="Status" UniqueName="Active_Flg">
                        </telerik:GridBoundColumn>
                        <telerik:GridDateTimeColumn runat="server" DataField="Modify_Dte" 
                            DataFormatString="{0:M/dd/yyyy}" 
                            FilterControlAltText="Filter Modify_Dte column" HeaderText="Date Modified" 
                            MaxDate="2999-12-31" UniqueName="Modify_Dte">
                        </telerik:GridDateTimeColumn>
                        <telerik:GridBoundColumn runat="server" DataField="Logon_User" 
                            FilterControlAltText="Filter Logon_User column" HeaderText="Modified By" UniqueName="Logon_User">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn runat="server" DataField="Replenish_FG" 
                            FilterControlAltText="Filter Replenish_FG column" HeaderText="Replenish Flag" UniqueName="Replenish_FG">
                        </telerik:GridBoundColumn>
                        <telerik:GridNumericColumn runat="server" DataField="Avail_Qty" 
                            DecimalDigits="2" FilterControlAltText="Filter Avail_Qty column" HeaderText="Inventory" UniqueName="Avail_Qty">
                        </telerik:GridNumericColumn>
                        <telerik:GridBoundColumn runat="server" DataField="Drop_Ship_FLG" 
                            FilterControlAltText="Filter Drop_Ship_FLG column" HeaderText="DS Flag" UniqueName="Drop_Ship_FLG">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn runat="server" DataField="OVER_WEIGHT_FLG" 
                            FilterControlAltText="Filter OVER_WEIGHT_FLG column" HeaderText="Overweight Flag" UniqueName="OVER_WEIGHT_FLG">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn runat="server" DataField="Web_Exclusive_FLG" 
                            FilterControlAltText="Filter Web_Exclusive_FLG column" HeaderText="WE Flag" UniqueName="Web_Exclusive_FLG">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn runat="server" DataField="Reg_Count" 
                            FilterControlAltText="Filter Reg_Count column" HeaderText="# of Registries" UniqueName="Reg_Count">
                        </telerik:GridBoundColumn>
                        <telerik:GridDateTimeColumn runat="server" DataField="End_Dte" 
                            DataFormatString="{0:M/dd/yyyy}" FilterControlAltText="Filter End_Dte column" 
                            HeaderText="End Date" MaxDate="9999-12-31" UniqueName="End_Dte" Visible="false">
                        </telerik:GridDateTimeColumn>
                    </Columns>
                    <editformsettings editformtype="Template">
                        <editcolumn filtercontrolalttext="Filter EditCommandColumn column" uniquename="EditCommandColumn1"></editcolumn>
                        <formtemplate>
                            <%--<uc3:cntUPCMaint ID="cntUPCMaint1" runat="server" />--%>
                            <table id="Table1" cellspacing="1" cellpadding="0" width="900" border="0">
                            <tr>
                                <td colspan="4"><asp:label id="UMlblError" runat="server" CssClass="ErrorMessage"></asp:label></td>
                            </tr>
                            <tr>
                                <td colspan="4"><asp:label id="lblPageTitle" runat="server"></asp:label></td>
                            </tr>
                            <tr>
                                <td style="WIDTH: 565px" colspan="2"><asp:label id="Label1" runat="server" 
                                        CssClass="title" Visible="False">UPC Attributes:</asp:label></td>
                                <td></td>
                                <td align="right"></td>
                            </tr>
                              
                            <tr>
                            <td style="WIDTH: 281px">
                                <asp:Label ID="Label18" runat="server" CssClass="ContentLabel" 
                                    Text="Start Date:">
                                </asp:Label>
                                   
                                <telerik:RadDatePicker ID="dtStartDate" Runat="server" MaxDate="9999-12-31" 
                                    MinDate="" Skin="Web20">
                                    <Calendar Runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" 
                                        Skin="Web20"></Calendar>
                                    <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                                    <DateInput Runat="server" DisplayDateFormat="MM/dd/yyyy" DateFormat="MM/dd/yyyy"></DateInput>
                                </telerik:RadDatePicker>
                            </td>
                            <td style="WIDTH: 425px">
                                <asp:Label ID="Label19" runat="server" CssClass="ContentLabel" Text="End Date:"></asp:Label>
                                   
                                <telerik:RadDatePicker ID="dtEndDate" Runat="server" MaxDate="9999-12-31" 
                                    MinDate="" Skin="Web20">
                                    <Calendar Runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" 
                                        Skin="Web20"></Calendar>
                                    <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                                    <DateInput Runat="server" DisplayDateFormat="MM/dd/yyyy" DateFormat="MM/dd/yyyy"></DateInput>
                                </telerik:RadDatePicker>
                            </td>
                            <td class="contentLabel"><asp:label id="Label14" runat="server" ToolTip="Rules for changing UPC status:  Can not change Ready to Pending;  Inactive can only be changed to Deleted; Everything else is ok ">Status:</asp:label>
                            <asp:DropDownList ID="ddlUPCStatus" runat="server">
                                    <asp:ListItem Value="P">Pending</asp:ListItem>
                                    <asp:ListItem Value="R">Ready</asp:ListItem>
                                    <asp:ListItem Value="A">Active</asp:ListItem>
                                    <asp:ListItem Value="I">Inactive</asp:ListItem>
                                    <asp:ListItem Value="D">Delete</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td> </td>
                        </tr>
                    </table>
                    <TABLE id="Table2" cellSpacing="1" cellPadding="0" width="900" border="0">
                        <tr>
                            <td vAlign="top" class="style1"><asp:label id="Label2" runat="server" 
                                    CssClass="contentlabel" Visible="False">Web Description:</asp:label></td>
                            <td vAlign="top" class="style1"> </td>
                            <td style="WIDTH: 429px" colSpan="2" vAlign="top">
                                <asp:Label id="txtWebDesc" runat="server" CssClass="title" Width="416px" 
                                    Height="56px" Visible="False">Label</asp:Label></td>
                            <td> </td>
                        </tr>
                        <tr>
                            <td class="style1"><asp:label id="Label4" runat="server" 
                                    CssClass="ContentLabel">Weight</asp:label></td>
                            <td class="style1"> </td>
                            <td style="WIDTH: 429px" colSpan="2"><asp:textbox id="txtWeight" runat="server"></asp:textbox></td>
                            <td><asp:label id="LabelUPC11" runat="server" CssClass="title" Visible="False">Mainframe Values:</asp:label></td>
                        </tr>
                        <tr>
                            <td class="style1"><asp:label id="Label5" runat="server" CssClass="contentlabel">Overweight: </asp:label><asp:checkbox id="chkOverweight" runat="server" CssClass="contentlabel"></asp:checkbox>
                                <asp:RadioButtonList ID="rblOverweight" runat="server" CssClass="ContentLabel">
                                    <asp:ListItem>Set to Overweight</asp:ListItem>
                                    <asp:ListItem>Reset Overweight</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                            <td class="style1"> </td>
                            <td style="WIDTH: 429px" colSpan="2"><asp:label id="Label6" runat="server" 
                                    CssClass="contentlabel" Visible="False">Overweight Cost</asp:label>  
                                <asp:textbox id="txtFatCost" runat="server" Visible="False"></asp:textbox></td>
                            <td><asp:label id="lblSSNdc" runat="server" CssClass="contentLabel"></asp:label></td>
                        </tr>
                        <tr>
                            <td class="style1"><asp:label id="Label7" runat="server" CssClass="contentlabel">Safety Stock Number</asp:label></td>
                            <td class="style1"> </td>
                            <td style="WIDTH: 429px" colSpan="2"><asp:textbox id="txtSafetyNum" runat="server"></asp:textbox></td>
                            <td><asp:label id="lblColor" runat="server" CssClass="contentLabel"></asp:label></td>
                        </tr>
                        <tr>
                            <td class="style1"><asp:label id="Label17" runat="server" CssClass="contentlabel">Special Handling Fee</asp:label></td>
                            <td class="style1"> </td>
                            <td style="WIDTH: 429px" colspan="2"><asp:textbox id="txtSHF" runat="server"></asp:textbox></td>
                            <td><asp:label id="lblSize" runat="server" CssClass="contentLabel"></asp:label></td>
                        </tr>
                        <tr>
                            <td class="style1"><asp:label id="Label9" runat="server" CssClass="contentlabel">Pre Order Date</asp:label></td>
                            <td class="style1"> </td>
                            <td style="WIDTH: 429px" colSpan="2">
                                <telerik:RadDatePicker ID="txtpreorderdt" Runat="server" MaxDate="2999-12-31" 
                                    Skin="Web20">
                                    <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x" 
                                        Skin="Web20"></Calendar>
                                    <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                                    <DateInput DisplayDateFormat="MM/dd/yyyy" DateFormat="MM/dd/yyyy"></DateInput>
                                </telerik:RadDatePicker>
                            </td>
                            <td><asp:label id="lblColorFamily" runat="server" CssClass="contentLabel"></asp:label></td>
                        </tr>
                        <tr>
                            <td class="style1"><asp:label id="Label10" runat="server" CssClass="contentlabel">Back Order Time Frame</asp:label></td>
                            <td class="style1"> </td>
                            <td style="WIDTH: 429px" colSpan="2"><asp:textbox id="txtBackOrder" runat="server"></asp:textbox></td>
                            <td></td>
                        </tr>
                        <tr>
                            <td class="style1"><asp:label id="Label12" runat="server" CssClass="contentlabel" ToolTip="Comment for the product goes here. This field will not display on the website.">Comment:</asp:label></td>
                            <td class="style1"> </td>
                            <td style="WIDTH: 429px" colSpan="2"><asp:textbox id="txtUPCComment" runat="server" Height="30px" Width="500px" TextMode="MultiLine"></asp:textbox></td>
                            <td> </td>
                        </tr>
                        <tr>
                            <td class="style1" ><asp:label id="Label13" runat="server" CssClass="contentlabel">Drop-Ship:</asp:label>
                            <asp:checkbox id="chbDropShip" runat="server" CssClass="contentlabel"></asp:checkbox>
                                <asp:RadioButtonList ID="rblDropShip" runat="server" CssClass="ContentLabel">
                                    <asp:ListItem>Set to Drop-Ship</asp:ListItem>
                                    <asp:ListItem>Reset Drop-Ship</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                            <td class="style1" > </td>
                            <td ><asp:label id="Label15" runat="server" CssClass="contentlabel">Web Exclusive:</asp:label>
                            <asp:checkbox id="chbWebEx" runat="server" CssClass="contentlabel"></asp:checkbox>
                                <asp:RadioButtonList ID="rblWebEx" runat="server" CssClass="ContentLabel">
                                    <asp:ListItem>Set to Web Exclusive</asp:ListItem>
                                    <asp:ListItem>Reset Web Exclusive</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                            <td><asp:label id="Label16" runat="server" CssClass="contentLabel"></asp:label></td>
                        </tr>
                        <tr>
                            <td class="style1"><asp:HyperLink ID="HyperLink1" CssClass="contentlabel" Font-Underline="true" ToolTip="Click on this link to see the list of Return Codes and their instructions." NavigateUrl="javascript:image_window=window.open('view_return_codes.aspx','image_window','width=700,height=400,left=323,top=195,scrollbars=yes');image_window.focus()" runat="server">Return Code:</asp:HyperLink></td>
                            <td class="style1"> </td>
                           <td style="WIDTH: 429px" colSpan="2"><asp:DropDownList ID="ddlRtnCodes" runat="server" CssClass="contentlabel"></asp:DropDownList>
                                <td> </td>
                        </tr>
                        <tr>
                            <td colSpan="5"><hr>
                            </td>
                        </tr>
        <tr>
            <td colSpan="5">
               <%-- <uc1:cntattibuteoptiontypes ID="cntattibuteoptiontypes1" runat="server" />--%>
                <table class="style2">
                    <tr>
                        <td nowrap="nowrap">
                            <asp:Label ID="lblOptionColor" runat="server" Visible="False" 
                                Text="Select a Color"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlOptionColor" runat="server" Visible="False">
                            </asp:DropDownList>
                        </td>
                        <td nowrap="nowrap">
                            <asp:Label ID="lblOptionColorAdd" runat="server" Text="Add option" 
                                Visible="False"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtOptionColor" runat="server" Visible="False"></asp:TextBox>
                        </td>
                        <td nowrap="nowrap">
                            <asp:Label ID="lblOptionColorSwatch" runat="server" Text="Swatch ID:" 
                                Visible="False"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtOptionColorSwatch" runat="server" Visible="False"></asp:TextBox>
                        </td>
                        <td nowrap="nowrap">
                            <asp:Label ID="lblOptionColorLrg" runat="server" Text="Large Image Id:" 
                                Visible="False"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtOptionColorLrg" runat="server" Visible="False"></asp:TextBox>
                        </td>
                        <td>
                            <telerik:RadButton ID="btnOptionColorUpdate" runat="server" Visible="false" Text="Update"></telerik:RadButton>
                        </td>
                    </tr>
                    <tr>
                        <td nowrap="nowrap">
                            <asp:Label ID="lblOptionSize" runat="server" Visible="False" 
                                Text="Select a Size"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlOptionSize" runat="server" Visible="False">
                            </asp:DropDownList>
                        </td>
                        <td nowrap="nowrap">
                            <asp:Label ID="lblOptionSizeAdd" runat="server" Text="Add option" 
                                Visible="False"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtOptionSize" runat="server" Visible="False"></asp:TextBox>
                        </td>
                        <td>
                            <telerik:RadButton ID="btnOptionSizeAdd" runat="server" Visible="false" Text="Add"></telerik:RadButton>
                        </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblOptionWrap" runat="server" Visible="False" 
                                Text="Select Gift Wrap Option"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlOptionWrap" runat="server" Visible="False">
                            </asp:DropDownList>
                        </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lblOptionShip" runat="server" Visible="False" 
                                Text="Select Shipping Restriction"></asp:Label>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlOptionShip" runat="server" Visible="False">
                            </asp:DropDownList>
                        </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            <asp:Label ID="lblOptionHazMat" runat="server" Visible="False" Text="Haz Mat"></asp:Label>
                        </td>
                        <td>
                            <asp:ListBox ID="lstOptionHazMat" runat="server" Rows="3" Visible="False">
                            </asp:ListBox>
                        </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                        <td>
                             </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="4" style="WIDTH: 622px">
                 </td>
        </tr>
        <tr>
            <td colspan="5">
                <telerik:RadButton ID="btnSave" runat="server" Skin="Web20" CommandName="Update">
                </telerik:RadButton>
                <telerik:RadButton ID="btnCancel" runat="server" Skin="Web20" Text="Cancel" CommandName="Cancel">
                </telerik:RadButton>
            </td>
        </tr>
    </table>
<asp:Label ID="lblFields" runat="server"></asp:Label>
                            <br />
                        </formtemplate>
                    </editformsettings>
                    <PagerStyle AlwaysVisible="True" />
                    <CommandItemTemplate>
                        <div style="padding: 5px 5px;">
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# RadGrid1.EditIndexes.Count = 0 %>' >
                                <img style="border:0px;vertical-align:middle;" alt="" src="../images/AddRecord.gif" />Update Selected UPCs for this Product
                            </asp:LinkButton>  
                            <asp:LinkButton ID="LinkButton1"
                                runat="server" CommandName="DeleteSelected" Visible='<%# RadGrid1.EditIndexes.Count = 0 %>' Enabled="True" OnClientClick="javascript:return confirm('Delete all selected UPCs?')">
                                <img style="border:0px;vertical-align:middle;" alt="" src="../images/Delete.gif" />Delete Selected UPCs
                            </asp:LinkButton>   
                            <%-- <asp:LinkButton ID="DownloadPDF" runat="server" CommandName="ExportToPdf"/>
                                <asp:Image ID="Image1" runat="server" ImageUrl="../images/PDF.gif" AlternateText="Export to PDF"/>--%> 
                            <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid">
                                <img style="border:0px;vertical-align:middle;" alt="" src="../images/Refresh.gif" align="right" />Refresh
                            </asp:LinkButton>
                        </div>
                    </CommandItemTemplate>
                </mastertableview>
                <filtermenu enableimagesprites="False"></filtermenu>
            </telerik:RadGrid>
 and the code behind:
Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
    If (TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode) Then
        With oldUPCinfo
            .UPCno = Session("upc")
            .ProductCd = Session("ProductCd")
            .StartDt = Session("UStartDt")
            .EndDt = Session("UEndDt")
        End With
        Session("OTC") = New ArrayList
        Dim myProduct As New WebCatVB.product
        oldUPCinfo = myProduct.GetProductUPC(oldUPCinfo)
        Dim editFormItem As GridEditFormItem = CType(e.Item, GridEditFormItem)
        Dim ddlRtnCodes As DropDownList = CType(editFormItem.FindControl("ddlRtnCodes"), DropDownList)
        Dim ddlUPCStatus As DropDownList = CType(editFormItem.FindControl("ddlUPCStatus"), DropDownList)
        Dim chkOverweight As CheckBox = CType(editFormItem.FindControl("chkOverweight"), CheckBox)
        Dim chbDropShip As CheckBox = CType(editFormItem.FindControl("chbDropShip"), CheckBox)
        Dim chbWebEx As CheckBox = CType(editFormItem.FindControl("chbWebEx"), CheckBox)
        Dim rblOverweight As RadioButtonList = CType(editFormItem.FindControl("rblOverweight"), RadioButtonList)
        Dim rblDropShip As RadioButtonList = CType(editFormItem.FindControl("rblDropShip"), RadioButtonList)
        Dim rblWebEx As RadioButtonList = CType(editFormItem.FindControl("rblWebEx"), RadioButtonList)
        If Session("ActionCd") = "Insert" Then
            CType(editFormItem.FindControl("btnSave"), RadButton).Text = "Save Selected UPCs"
        Else
            CType(editFormItem.FindControl("btnSave"), RadButton).Text = "Save UPC"
        End If
        Dim miUPC As New WebCatVB.ProductUPC
        Dim product As New WebCatVB.ProductObject
        Dim companyInfo As New WebCatVB.companyStructure
        Dim myUPClist As DataSet
        Dim upcRow As DataRow
        Dim strCC As String = ""
        If Session("ActionCd") = "Edit" Then
            chkOverweight.Visible = True
            chbDropShip.Visible = True
            chbWebEx.Visible = True
            rblOverweight.Visible = False
            rblDropShip.Visible = False
            rblWebEx.Visible = False
        ElseIf Session("ActionCd") = "Insert" Then
            chkOverweight.Visible = False
            chbDropShip.Visible = False
            chbWebEx.Visible = False
            rblOverweight.Visible = True
            rblDropShip.Visible = True
            rblWebEx.Visible = True
        End If
        'get product comment
        product = myProduct.GetProduct(Session("productCd"))
        If Len(myProduct.GetError()) > 0 Then
            displayError(myProduct.GetError())
            Exit Sub
        Else
            CType(editFormItem.FindControl("txtUPCComment"), TextBox).Text = product.commentTxt
        End If
        If Session("UPC") <> "" Then
            'get mainframe UPC info
            myUPClist = companyInfo.getUPCS(Session("upc"))
            With oldUPCinfo
                CType(editFormItem.FindControl("dtStartDate"), RadDatePicker).SelectedDate = .StartDt
                If .EndDt = "12/31/9999" Then
                    CType(editFormItem.FindControl("dtEndDate"), RadDatePicker).Clear()
                Else
                    CType(editFormItem.FindControl("dtEndDate"), RadDatePicker).SelectedDate = .EndDt
                End If
                'txtStartDt.SelectedDate = .StartDt
                'If .EndDt = "12/31/9999" Then
                '    txtEndDt.Clear()
                'Else
                '    txtEndDt.SelectedDate = .EndDt
                'End If
                CType(editFormItem.FindControl("txtWebDesc"), Label).Text = .upcName
                ddlUPCStatus.SelectedValue = Trim(.ActiveFg)
                CType(editFormItem.FindControl("txtWeight"), TextBox).Text = .Weight
                CType(editFormItem.FindControl("txtFatCost"), TextBox).Text = .fatCost
                If .fatFg = "Y" Then
                    chkOverweight.Checked = True
                Else
                    chkOverweight.Checked = False
                End If
                CType(editFormItem.FindControl("txtSafetyNum"), TextBox).Text = .safetyStockNo
                If .preOrderdt = "" Then
                    CType(editFormItem.FindControl("txtpreorderdt"), RadDatePicker).Clear()
                Else
                    CType(editFormItem.FindControl("txtpreorderdt"), RadDatePicker).SelectedDate = .preOrderdt
                End If
                CType(editFormItem.FindControl("txtBackOrder"), TextBox).Text = .backOrderTimeFrame
                If .dropShipFlg = "Y" Then
                    chbDropShip.Checked = True
                Else
                    chbDropShip.Checked = False
                End If
                If .webExclusiveFlg = "Y" Then
                    chbWebEx.Checked = True
                Else
                    chbWebEx.Checked = False
                End If
                CType(editFormItem.FindControl("txtSHF"), TextBox).Text = .SHF
            End With
            For Each upcRow In myUPClist.Tables("UPClist").Rows
                CType(editFormItem.FindControl("LabelUPC11"), Label).Visible = True
                CType(editFormItem.FindControl("lblSSNdc"), Label).Text = upcRow("upcDc")
                CType(editFormItem.FindControl("lblColor"), Label).Text = "Color - " + upcRow("colorDc")
                CType(editFormItem.FindControl("lblSize"), Label).Text = "Size - " + upcRow("sizeDc")
                If IsDBNull(upcRow("CLR_CDE")) = True Then
                    strCC = ""
                Else
                    strCC = upcRow("CLR_CDE")
                End If
            Next
            'GET COLOR FAMILY BASED ON THE COLOR CODE
            If strCC <> "" Then
                CType(editFormItem.FindControl("lblColorFamily"), Label).Text = "Color Family - " + getColorFamily(strCC)
            End If
        Else
            ddlStatus.Items.Insert(0, "")
        End If
        populateReturnCodes(oldUPCinfo.dropShipFlg, ddlRtnCodes)
        If oldUPCinfo.ReturnCode IsNot Nothing Then
            ddlRtnCodes.SelectedValue = Trim(oldUPCinfo.ReturnCode)
        Else
            ddlRtnCodes.SelectedValue = 0
        End If
        getControls(editFormItem)
    End If
End Sub
Sub populateReturnCodes(ByVal strDS As String, ByVal ddlRtnCodes As DropDownList)
    Dim mySearch As New WebCatVB.product
    Dim dsResults As New DataSet
    dsResults = mySearch.getUPCReturnCodes(strDS)
    If Session("ActionCd") = "Insert" Then
        Dim newRow As DataRow = dsResults.Tables("Codes").NewRow()
        newRow("ENTRY2_TXT") = 0
        newRow("ENTRY_DESC") = ""
        dsResults.Tables("Codes").Rows.Add(newRow)
    End If
    ddlRtnCodes.DataSource = dsResults
    ddlRtnCodes.DataValueField = "ENTRY2_TXT"
    ddlRtnCodes.DataTextField = "ENTRY_DESC"
    ddlRtnCodes.DataBind()
End Sub
Private Function getColorFamily(ByVal strCC As Integer) As String
    Dim strCF As String = ""
    Select Case strCC
        Case 1 To 99
            strCF = "Black"
        Case 100 To 199
            strCF = "White"
     End Select
    Return strCF
End Function
Sub getControls(ByVal editFormItem As GridEditFormItem)
    Dim myOptions As New WebCatVB.options
    Dim myOptionSelect As New WebCatVB.product
    Dim dvOptions As New DataView
    Dim dvOptionTypes As New DataView
    Dim dsOptionSelect As New DataSet
    Dim optRow As DataRow
    'Decide which page to join or not join with the product options
    If Session("currentPage") = "WebCategory_UPCSearch" Then
        dvOptions = myOptions.getOptionTypes(False, , "where Active_Flg = 'A' and DISPLAY_AS_ATTRIB='Y' ")
    Else
        dvOptions = myOptions.getOptionTypes(True, Session("ProductCd"), "where Active_Flg = 'A' and DISPLAY_AS_ATTRIB='Y'")
    End If
    If Len(myOptions.GetError()) > 0 Then
        displayError(myOptions.GetError())
        Exit Sub
    End If
    For Each row As DataRowView In dvOptions
        Dim OptionName As String = row.Item("OptionTypeName")
        If row.Item("SwatchFg").ToString() = "Y" Then
            dvOptionTypes = myOptions.getOptions(row.Item("OptionTypeCd").ToString(), " where OPTION_TYPE_CDE = " & row.Item("OptionTypeCd").ToString() & " and swatch_product_cde = " & Session("ProductCd"), "order by OPTION_NME")
        Else
            dvOptionTypes = myOptions.getOptions(row.Item("OptionTypeCd").ToString(), " where OPTION_TYPE_CDE = " & row.Item("OptionTypeCd").ToString() & " and swatch_product_cde = 0", "order by OPTION_NME")
        End If
        dsOptionSelect = myOptionSelect.GetUPCoptions(Session("UPC"), (row.Item("OptionTypeCd").ToString()), Session("ProductCd"))
        Select Case OptionName
            Case "Color"
                CType(editFormItem.FindControl("lblOptionColor"), Label).Visible = True
                loadDropDown(CType(editFormItem.FindControl("ddlOptionColor"), DropDownList), dsOptionSelect, dvOptionTypes)
            Case "Size"
                CType(editFormItem.FindControl("lblOptionSize"), Label).Visible = True
                loadDropDown(CType(editFormItem.FindControl("ddlOptionSize"), DropDownList), dsOptionSelect, dvOptionTypes)
            Case "Gift Wrap"
                CType(editFormItem.FindControl("lblOptionWrap"), Label).Visible = True
                loadDropDown(CType(editFormItem.FindControl("ddlOptionWrap"), DropDownList), dsOptionSelect, dvOptionTypes)
            Case "Shipping Restrictions"
                CType(editFormItem.FindControl("lblOptionShip"), Label).Visible = True
                loadDropDown(CType(editFormItem.FindControl("ddlOptionShip"), DropDownList), dsOptionSelect, dvOptionTypes)
            Case "Haz Mat"
                CType(editFormItem.FindControl("lblOptionHazMat"), Label).Visible = True
                'lblOptionHazMat.Visible = True
                Dim lstOptionHazMat As ListBox = CType(editFormItem.FindControl("lstOptionHazMat"), ListBox)
                lstOptionHazMat.Visible = True
                lstOptionHazMat.DataSource = dvOptionTypes
                lstOptionHazMat.DataValueField = "Option_Cde"
                lstOptionHazMat.DataTextField = "Option_Nme"
                lstOptionHazMat.DataBind()
                If dsOptionSelect.Tables("upcOptions") IsNot Nothing Then
                    For Each optRow In dsOptionSelect.Tables("upcOptions").Rows
                        For x As Integer = 0 To lstOptionHazMat.Items.Count - 1
                            If lstOptionHazMat.Items(x).Value = optRow("OptCd") Then
                                lstOptionHazMat.Items(x).Selected = True
                                'Add to array
                                'lblUpdate.Text = lblUpdate.Text & optRow("OptCd") & ","
                            End If
                        Next
                    Next
                End If
        End Select
    Next
End Sub
Sub loadDropDown(ByVal ddl As DropDownList, ByVal dsOptionSelect As DataSet, ByVal dvOptionTypes As DataView)
    Dim optRow As DataRow
    ddl.Visible = True
    ddl.DataSource = dvOptionTypes
    ddl.DataValueField = "Option_Cde"
    ddl.DataTextField = "Option_Nme"
    ddl.DataBind()
    If dsOptionSelect.Tables("upcOptions") IsNot Nothing Then
        For Each optRow In dsOptionSelect.Tables("upcOptions").Rows
            For x As Integer = 0 To ddl.Items.Count - 1
                If ddl.Items(x).Value = optRow("OptCd") Then
                    ddl.Items(x).Selected = True
                    'Add to array
                    'lblUpdate.Text = lblUpdate.Text & optRow("OptCd") & ","
                End If
            Next
        Next
    End If
End Sub

It seems like performance gets a lot worse when the method getControls() is initally called which does not make sense becuase it is not called upon closing the form.

Any hints or tips would be greatly appreciated.

Thanks,
Casey
Casey
Top achievements
Rank 1
 answered on 21 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?