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

[Solved] Radcombo box in usercontrol used as grideditform

5 Answers 170 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Nasiem
Top achievements
Rank 1
Nasiem asked on 24 May 2009, 04:23 AM
Hi
I a have a usercontrol that i'm using as an editform for a radgrid. Within the usercontrol there are more than one radcombobox . Two of these combo boxes are country and locations combos. The locations combo depends on the countries combo.  When the selection in the countries combo box change a different set of locations should load in the locations combo.  I wanted to achieve that using the client side events for the combos. I tried to use the code below which is from one of the demos on Telerik website which is using the OnClientSelectedIndexChanging and OnClientItemsRequested events. What is happning in my case is that whenever I set the client side events on these two combos all combos including these two combos stop responding. The dropdowns stop working and don’t expand.  I can't find what is causing this problem Please help me???

This is the client side code I’m using

<script type="text/javascript">

    //global variables for the countries Combo

    var locationsCombo;

    function pageLoad() {

        // initialize the global variables

        // in this event all client objects

        // are already created and initialized

 

        locationsCombo = $find("<%= RadComboLocation.ClientID %>");

    }

    function LoadLocations(combo, eventArqs) {

        var item = eventArqs.get_item();

 

        locationsCombo.set_text("Loading...");

        // this will fire the ItemsRequested event of the

        // locations combobox passing the countryID as a parameter

        locationsCombo.requestItems(item.get_value(), false);

    }

 

    function ItemsLoaded(combo, eventArqs) {

        if (combo.get_items().get_count() > 0) {

            // pre-select the first item

            combo.set_text(combo.get_items().getItem(0).get_text());

            combo.get_items().getItem(0).highlight();

        }

        combo.showDropDown();

    }

</script>  

This is the code for both combos on the ascx pag

<telerik:RadComboBox ID="RadComboCountry" runat="server" AppendDataBoundItems="True"

                        BorderStyle="None" CssClass="DropdownControlGridFormEditor" EnableScreenBoundaryDetection="False"

                        ListTextField="Text" ListValueField="Code" Skin="Outlook" OnClientSelectedIndexChanging="LoadLocations"

                        OnItemsRequested="RadComboCountry_ItemsRequested">

                        <CollapseAnimation Duration="200" Type="OutQuint" />

                    </telerik:RadComboBox>

<telerik:RadComboBox ID="RadComboLocation" runat="server" BorderStyle="None" CssClass="DropdownControlGridFormEditor"

                        DropDownWidth="150px" EnableScreenBoundaryDetection="False" ListTextField="Text"

                        ListValueField="Code" Skin="Outlook" OnClientItemsRequested="ItemsLoaded" OnItemsRequested="RadComboLocation_ItemsRequested">

                        <CollapseAnimation Duration="200" Type="OutQuint" />

                    </telerik:RadComboBox>

And this is the code in the code behind page

protected void RadComboCountry_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)

        {

           try{

            SFSUserControl.myUtil.BindCombos(RadComboCountry, "Country", true);

           }

           catch (Exception ex)

           {

               throw new Exception("RadComboCountry_ItemsRequested Error on " + Request.ServerVariables["Script_Name"].ToString() + "" + ex.Message);

           }

        }

 

        protected void RadComboLocation_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)

        {

            try{

                if (SFSUserControl.myUtil.LocationItemExists("Location" + e.Text) == true)

                {

                    SFSUserControl.myUtil.BindCombos(RadComboLocation, "Location" + e.Text, true);

                }

                else

                {

                    RadComboLocation.SelectedValue = "None";

                    RadComboLocation.Enabled = false;

                }

               

             }

            catch (Exception ex)

            {

                throw new Exception("RadComboLocation_ItemsRequested Error on " + Request.ServerVariables["Script_Name"].ToString() + "" + ex.Message);

            }

        }

 

5 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 26 May 2009, 01:42 PM
Hi Nasiem ,

I suggest you use unique names for the javascript functions for each user control as described here.

Best regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ravi Keshwani
Top achievements
Rank 1
answered on 03 Aug 2009, 05:38 AM
Hi Team,

 I have the same problem that radcombos in the user controls have stopped firing the server events. I am facing this issue after adding radajaxmanager on the webpage.

I am having related combos say country and state. when I remove the event 

 

OnClientSelectedIndexChanged="LoadStates"  then the country combo is filled with values.

 



Please help me out.
0
Simon
Telerik team
answered on 05 Aug 2009, 10:33 AM
Hi Ravi Keshwani,

Do you receive any JavaScript errors when the Country ComboBox does not load Items?

If not, could you please send us a runnable page/project which exhibit the issue? We will investigate it and will provide a solution or a workaround.

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
0
Ravi Keshwani
Top achievements
Rank 1
answered on 07 Aug 2009, 04:26 AM
Hi Simon,

       I have added the JS code that was in UserControl under RadScriptBlocK and it is now working. I am having another issue whose workaround was not provided any where. The issue is as below...

I have RadGrid With UserControl used for insertion and editing.
Next I added Jquery (Standard Plugins Not of Telerik provided Plugins) for validating the textboxes(asp) in usercontrol
Jquery validation  was working fine until I added RadAjaxManager on the page from which the usercontrol was loaded.

Issue: Jquery Stopped working when I added RadAjaxManager in the page. 

The Code of ascx is as below.

<%

@ Control Language="C#" AutoEventWireup="true" EnableTheming="true" CodeBehind="ClientAccountControl.ascx.cs" Inherits="ePlannerPro2._0.UserControls.ClientAccountControl" %>

 

<%

@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

 

<%

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

 

 

<

 

style type="text/css">

 

 

.wizBar

{

background-color:White;

border-bottom:1px solid #587698;

border-right:1px solid #587698;

border-left:1px solid #E2F1FF;

border-top:1px solid #E2F1FF;

}

.wizBar tr td{

border-collapse:separate !important;

border-top:1px solid #587698;

border-left:1px solid #587698;

border-color:#E2F1FF;

 

}

.divHead {

background-color:#000080;

color:White;

font-weight:bold;

font-size:medium;

cursor: pointer;

 

text-align: center;

 

width:100%;

display: block;

height:4%;

top:135px;

 

 

}

.divSearchGrid

{

border-collapse:separate !important;

border-top:1px solid #587698;

border-left:1px solid #587698;

}

.divSearchGrid tbody tr th

{

background-color:#ADCBE7;

border-bottom:1px solid #587698;

border-right:1px solid #587698;

border-left:1px solid #E2F1FF;

border-top:1px solid #E2F1FF;

 

}

.divSearchGrid tbody tr td

{

border:1px;

border-right:1px solid #000000;

border-bottom:1px solid #000000;

background-color:#ffffff;

 

 

}

.divSearchGrid tbody tr.selected td

{

background-color:#e0e0e0;

}

.Mandatory

{

height: 25px;

color:Red;

 

}

.CenterTable

{

vertical-align:middle;

margin-left:0%;

margin-top:0%;

}

.grayhead

{

background-color:#D7E6F3;

border-bottom:1px solid #9EBEDB;

/*display:block; */

padding:1px;

border-top:1px solid #FFFFFF;

height:25px;

line-height:25px;

font-weight:bold;

font-size:medium;

}

.WaterMarkClass

{

color:Gray;

font-size:smaller;

}

.textarea

{

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 11px;

font-style:normal;

Width:137px;

height:52px;

}

.button

{

background-color:White;

border:Solid 1px #507CD1;

font-family: Verdana;

font-size: 11px;

font-style:normal;

color: Black;

 

height:20px;

}

</

 

style>

 

<

 

script type="text/javascript">

 

 

function LoadStates(combo, eventArqs)

 

{

 

var item = eventArqs.get_item();

 

 

//alert(item);

 

 

var StateCombo= $find("<%= RadComboState.ClientID %>");

 

 

var CountryCombo=$find("<%= RadComboCountry.ClientID %>");

 

 

//alert(StateCombo);

 

StateCombo.set_text(

"Loading...");

 

 

// this will fire the ItemsRequested event of the

 

 

// cities combobox passing the countryID as a parameter

 

 

// alert(item.get_value());

 

StateCombo.requestItems(item.get_value(),

false);

 

}

 

function ItemsLoaded(combo, eventArqs)

 

{

 

if (combo.get_items().get_count() > 0)

 

{

 

// pre-select the first item

 

combo.set_text(combo.get_items().getItem(0).get_text());

combo.get_items().getItem(0).highlight();

}

combo.showDropDown();

}

 

jQuery.validator.addMethod(

 

"selectNone",

 

 

function(value, element) {

 

 

 

if (element.value == "-1")

 

{

 

return false;

 

}

 

else return true;

 

},

 

"&nbsp;&nbsp;<img src='../../Images/ModalDialogAlert.gif' />"

 

 

);

 

$(document).ready

(

 

 

 

 

function() {

 

$(

"input[name$='btnInsert']").click(function()

 

{

 

Validate();

});

$(

"input[name$='btnUpdate']").click(function()

 

{

 

Validate();

});

$(

"input[name$='btnCancel']").click(function()

 

{

 

cancelValidation();

});

 

 

 

}

);

 

 

function cancelValidation()

 

{

 

 

 

 

 

return true;

 

 

}

 

 

 

 

 

function Validate()

 

{

 

//alert("Before");

 

 

//alert(document.getElementById('<%=txtWebSite.ClientID %>').value.length);

 

 

if(document.getElementById('<%=txtWebSite.ClientID %>').value.length<=8)

 

{

document.getElementById(

'<%=txtWebSite.ClientID %>').value="";

 

}

document.getElementById(

'<%=MessageRow.ClientID %>').style.visibility='hidden';

 

 

$(

"#aspnetForm").validate

 

(

{

rules:

{

 

<%=txtCompName.UniqueID %>:

"required",

 

<%=txtWebSite.UniqueID %>:

{

 

url:

true

 

},

<%=txtEmail.UniqueID%>:

{

required:

true,

 

email:

true

 

},

<%=txtContactPersonEmail.UniqueID%>:

{

 

email:

true

 

},

<%=drpCompanyType.UniqueID%>:

{

selectNone:

true

 

}

,

<%=drpCompanyType.UniqueID%>:

{

selectNone:

true

 

}

,

<%=txtPhone.UniqueID%>:

{

required:

true

 

}

 

 

},

messages:

{

<%=txtCompName.UniqueID%>:

{

required:

"&nbsp;&nbsp;<img src='../../Images/ModalDialogAlert.gif' />"

 

},

<%=txtWebSite.UniqueID%>:

{

url:

"&nbsp;&nbsp;<img src='../../Images/ModalDialogAlert.gif' />"

 

},

<%=txtEmail.UniqueID%>:

{

required:

"&nbsp;&nbsp;<img src='../../Images/ModalDialogAlert.gif' />",

 

email:

"&nbsp;&nbsp;<img src='../../Images/ModalDialogAlert.gif' />"

 

},

<%=txtContactPersonEmail.UniqueID%>:

{

email:

"&nbsp;&nbsp;<img src='../../Images/ModalDialogAlert.gif' />"

 

},

 

<%=drpCompanyType.UniqueID%>:

{

selectNone:

"&nbsp;&nbsp;<img src='../../Images/ModalDialogAlert.gif' />"

 

}

,

<%=txtPhone.UniqueID%>:

{

required:

"&nbsp;&nbsp;<img src='../../Images/ModalDialogAlert.gif' />"

 

}

 

 

},

invalidHandler:

function(form, validator)

 

{

 

document.getElementById(

'<%=MessageRow.ClientID %>').style.visibility='visible';

 

 

}

 

}

);

 

}

 

 

 

 

</script>

 

 

 

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

 

hexColor = [

"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];

 

 

 

function mOver(btnid) {

 

btnid.style.backgroundColor =

"#FFCC80";

 

}

 

 

function mOut(btnid) {

 

btnid.style.backgroundColor =

"White";

 

}

 

// End -->

 

</

 

script>

 

<

 

table id="Table2" class="wizBar" cellspacing="1" cellpadding="1" width="100%" rules="none"

 

 

>

 

 

<tr class="divHead" >

 

 

<td colspan="2">Insert/Update Client Company Details</td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="2" class="grayhead" >Company Information:</b></td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

 

<table id="Table3" class="wizBar" cellspacing="0" cellpadding="1" width="100%" border="0">

 

 

<tr runat="server" id="MessageRow" style="visibility:hidden;" class="Mandatory" >

 

 

 

<td align="center" colspan="4" > <em> Please Enter Valid Values in appropriate format in the field boxes with

 

 

<img src='../../Images/ModalDialogAlert.gif' id="ErrorImage" runat="server"/>&nbsp; Sign.

 

 

&nbsp;(Take help of example shown in greyed-out text in the field boxes). </em>

 

 

</td>

 

 

 

</tr>

 

 

<tr>

 

 

<td style="text-align:right;"><em class="Mandatory" >* </em>Company Name&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtCompName" MaxLength="255" runat="server"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.Name") %>' Width="212px"

 

 

CssClass="textbox"></asp:textbox>

 

 

</td>

 

 

<td style="text-align:right;" >

 

WebSite

&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtWebSite" runat="server" MaxLength="255"

 

 

Width="212px"></asp:textbox>

 

 

<cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1"

 

 

runat="server" TargetControlID="txtWebSite" WatermarkCssClass="WaterMarkClass"

 

 

WatermarkText="http://www.Myweb.com">

 

 

</cc1:TextBoxWatermarkExtender>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td style="text-align:right;"><em class="Mandatory" >* </em>Email&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtEmail" runat="server" MaxLength="255"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.Email" ) %>' Width="212px"

 

 

CssClass="textbox"></asp:textbox>

 

 

 

 

<cc1:TextBoxWatermarkExtender ID="txtEmail_TextBoxWatermarkExtender"

 

 

runat="server" TargetControlID="txtEmail" WatermarkCssClass="WaterMarkClass"

 

 

WatermarkText="Eg.Bob@MyMail.Com" >

 

 

</cc1:TextBoxWatermarkExtender>

 

 

 

</td>

 

 

<td style="text-align:right;">

 

 

<em class="Mandatory">* </em>Company Type&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:DropDownList ID="drpCompanyType" runat="server" Width="216px"

 

 

CssClass="textbox">

 

 

</asp:DropDownList>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td style="text-align:right;"><em class="Mandatory" >* </em>Phone&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtPhone" runat="server" MaxLength="25"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.Phone" ) %>' Width="212px"

 

 

CssClass="textbox"></asp:textbox>

 

 

</td>

 

 

<td style="text-align:right;">

 

Fax

&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtFax" runat="server" MaxLength="50"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.Fax" ) %>' Width="212px"></asp:textbox>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td style="text-align:right;">Address1&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtAddress1" runat="server"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.Address1" ) %>'

 

 

Width="212px" MaxLength="255" CssClass="textbox" ></asp:textbox>

 

 

</td>

 

 

<td style="text-align:right;">

 

Address2

&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtAddress2" runat="server"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.Address2" ) %>'

 

 

Width="212px" MaxLength="255" CssClass="textbox" ></asp:textbox>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td style="text-align:right;">City&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtCity" runat="server" MaxLength="255"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.City" ) %>' Width="212px"

 

 

CssClass="textbox"></asp:textbox>

 

 

</td>

 

 

<td style="text-align:right;">

 

Country

&nbsp;&nbsp; </td>

 

 

<td >

 

 

<telerik:RadComboBox ID="RadComboCountry" Runat="server" EnableEmbeddedSkins="false"

 

 

OnClientSelectedIndexChanging="LoadStates"

 

 

OnItemsRequested="RadComboCountry_ItemsRequested" Skin="EppOutlookSkin"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.Country" ) %>'

 

 

MarkFirstMatch="True" Height="200px" ZIndex="9001" CssClass="textbox" >

 

 

 

</telerik:RadComboBox>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td style="text-align:right;" >State&nbsp;&nbsp; </td>

 

 

<td >

 

 

<telerik:RadComboBox ID="RadComboState" Runat="server"

 

 

OnClientItemsRequested="ItemsLoaded"

 

 

OnItemsRequested="RadComboState_ItemsRequested" EnableEmbeddedSkins="false" Skin="EppOutlookSkin"

 

 

Text='<%# DataBinder.Eval(Container, "DataItem.State" ) %>'

 

 

MarkFirstMatch="True" Height="200px" ZIndex="9000" CssClass="textbox" >

 

 

 

 

</telerik:RadComboBox>

 

 

</td>

 

 

<td style="text-align:right;">

 

ZipCode

</td>

 

 

<td >

 

 

<asp:TextBox id="txtZipCode" runat="server" MaxLength="50"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.ZipCode" ) %>' Width="212px"

 

 

CssClass="textbox"></asp:textbox>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td style="text-align:right;" >Active&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:RadioButton ID="rdbYes" Checked="true" runat="server" Text="Yes" GroupName="Active" />

 

 

&nbsp;<asp:RadioButton ID="rdbNo" runat="server" Text="No" GroupName="Active" />

 

 

</td>

 

 

<td style="text-align:right;">

 

 

&nbsp;</td>

 

 

<td >

 

 

&nbsp;</td>

 

 

</tr>

 

 

<tr>

 

 

<td style="text-align:right;" colspan="4" >&nbsp;</td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="4" class="grayhead" >Contact Person Details:</td>

 

 

</tr>

 

 

<tr>

 

 

<td colspan="4">&nbsp;</td>

 

 

</tr>

 

 

<tr>

 

 

<td style="text-align:right;">Name&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtContactPersonName" runat="server" MaxLength="255"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.ContactPersonName" ) %>'

 

 

Width="212px"></asp:textbox>

 

 

</td>

 

 

<td style="text-align:right;">Designation&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtContactPersonDesig" runat="server" MaxLength="255"

 

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.ContactPersonDesignation" ) %>'

 

 

Width="212px" CssClass="textbox"></asp:textbox>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td style="text-align:right;" >Email&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtContactPersonEmail" runat="server" MaxLength="255"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.ContactPersonEmail" ) %>'

 

 

Width="212px" CssClass="textbox"></asp:textbox>

 

 

<cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender2"

 

 

runat="server" TargetControlID="txtContactPersonEmail" WatermarkCssClass="WaterMarkClass"

 

 

WatermarkText="Eg.Bob@MyMail.Com">

 

 

</cc1:TextBoxWatermarkExtender>

 

 

</td>

 

 

<td style="text-align:right;">Phone&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtContactPersonPhone" runat="server" MaxLength="255"

 

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.ContactPersonPhone" ) %>'

 

 

Width="212px" CssClass="textbox"></asp:TextBox>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td style="text-align:right;" >Cell Phone&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtContactPersonCell" runat="server" MaxLength="255"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.ContactCell" ) %>'

 

 

Width="212px"></asp:TextBox>

 

 

 

</td>

 

 

<td style="text-align:right;" >Remarks&nbsp;&nbsp; </td>

 

 

<td >

 

 

<asp:TextBox id="txtRemarks" runat="server" MaxLength="255"

 

 

Text='<%# DataBinder.Eval( Container, "DataItem.Remarks" ) %>'

 

 

TextMode="MultiLine" Width="212px" Font-Names="Arial"

 

 

CssClass="textarea" ></asp:TextBox>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td align="right" colspan="2">

 

 

<asp:button id="btnUpdate" text="Update" runat="server" CommandName="Update"

 

 

Visible='<%# !(DataItem is Telerik.Web.UI.GridInsertionObject) %>'

 

 

CssClass="button" onmouseover="javascript:mOver(this)" onmouseout="javascript:mOut(this)"></asp:button>

 

 

&nbsp; <asp:button id="btnInsert" text="Save" runat="server"

 

 

CommandName="PerformInsert" onmouseover="javascript:mOver(this)" onmouseout="javascript:mOut(this)"

 

 

Visible='<%# DataItem is Telerik.Web.UI.GridInsertionObject %>'

 

 

CssClass="button"></asp:button>

 

 

&nbsp;

 

 

<asp:button id="btnCancel" text="Cancel" UseSubmitBehavior="false" onmouseover="javascript:mOver(this)" onmouseout="javascript:mOut(this)"

 

 

runat="server" commandname="Cancel" CssClass="button"></asp:button></td>

 

 

</tr>

 

 

</table>

 

 

 

 

 



The Code of aspx is as below: 

<%

@ Page Language="C#" Title="::Client Account Management::" MasterPageFile="~/UI/ePP2Admin.Master"

 

 

AutoEventWireup="true" CodeBehind="ClientAccount.aspx.cs" Inherits="ePlannerPro2._0.ClientAccount" %>

 

<%

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

 

<%

@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

 

<

 

asp:Content ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

 

 

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

 

 

 

<script type="text/javascript">

 

 

var popUp;

 

 

function PopUpShowing(sender, eventArgs)

 

{

 

// alert("In Pop");

 

popUp = eventArgs.get_popUp();

popUp.style.left =

"300px";

 

popUp.style.top =

"100px";

 

}

 

</script>

 

 

</telerik:RadScriptBlock>

 

 

<div>

 

 

 

<div class="divHead">

 

Client Account Management

 

</div>

 

 

<div>

 

Export To:

<asp:DropDownList ID="ddlExport" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlExport_SelectedIndexChanged">

 

 

<asp:ListItem Selected="True">-- Select Format --</asp:ListItem>

 

 

<asp:ListItem>Excel</asp:ListItem>

 

 

<asp:ListItem>CSV</asp:ListItem>

 

 

<asp:ListItem>Word</asp:ListItem>

 

 

<asp:ListItem>Pdf</asp:ListItem>

 

 

</asp:DropDownList>

 

 

&nbsp; &nbsp;

 

 

<div id="divPaperSize" runat="server" visible="false">

 

Paper size:

&nbsp;&nbsp;

 

 

<asp:DropDownList ID="ddlPaperSize" runat="server" AutoPostBack="True"

 

 

onselectedindexchanged="ddlPaperSize_SelectedIndexChanged" >

 

 

<asp:ListItem Selected="True">-- Select Papersize --</asp:ListItem>

 

 

<asp:ListItem >Letter</asp:ListItem>

 

 

<asp:ListItem>Legal</asp:ListItem>

 

 

<asp:ListItem>Executive</asp:ListItem>

 

 

<asp:ListItem>A4</asp:ListItem>

 

 

<asp:ListItem>A5</asp:ListItem>

 

 

</asp:DropDownList>

 

 

</div>

 

 

</div>

 

 

 

 

<div>

 

 

 

<telerik:RadGrid ID="RadGrid1" Width="99.9%" runat="server" AllowFilteringByColumn="True"

 

 

AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"

 

 

ShowGroupPanel="True" AllowMultiRowSelection="True" PagerStyle-AlwaysVisible="true"

 

 

GroupingSettings-CaseSensitive="false"

 

 

onneeddatasource="RadGrid1_NeedDataSource"

 

 

oninsertcommand="RadGrid1_InsertCommand"

 

 

OnUpdateCommand="RadGrid1_UpdateCommand"

 

 

OnDeleteCommand="RadGrid1_DeleteCommand"

 

 

OnItemDataBound="RadGrid1_ItemDataBound"

 

 

OnEditCommand="RadGrid1_OnEditCommand"

 

 

ItemStyle-Wrap="true" GridLines="None"

 

 

onexcelmlexportrowcreated="RadGrid1_ExcelMLExportRowCreated"

 

 

onexcelmlexportstylescreated="RadGrid1_ExcelMLExportStylesCreated" onitemcreated="RadGrid1_ItemCreated"

 

 

>

 

 

 

<HeaderContextMenu EnableEmbeddedSkins="False"></HeaderContextMenu>

 

 

 

<ItemStyle Wrap="True"></ItemStyle>

 

 

 

<PagerStyle AlwaysVisible="True" ShowPagerText="true" Mode="NextPrevAndNumeric" />

 

 

 

<MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="Id"

 

 

ItemStyle-Wrap="true" EditMode="PopUp" EditFormSettings-EditFormType="WebUserControl" TableLayout="Auto" >

 

 

 

<RowIndicatorColumn>

 

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn>

 

 

 

</ExpandCollapseColumn>

 

 

<CommandItemSettings AddNewRecordText="Add New Client" />

 

 

<Columns>

 

 

 

 

 

<telerik:GridEditCommandColumn HeaderText="Edit" HeaderStyle-Width="40px" ButtonType="ImageButton"

 

 

Reorderable="False" UniqueName="Edit"

 

 

ItemStyle-BorderStyle="None">

 

 

 

<ItemStyle BorderStyle="None"></ItemStyle>

 

 

</telerik:GridEditCommandColumn>

 

 

<telerik:GridBoundColumn DataField="Id" ReadOnly="True" UniqueName="SelId"

 

 

Display="false" AllowFiltering="False">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Name" HeaderStyle-Width="200px" HeaderText="Company" AllowFiltering="true"

 

 

UniqueName="Name" ShowSortIcon="False" >

 

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn UniqueName="mail"

 

 

DataField="Email" HeaderText="Email" AllowFiltering="true" HeaderStyle-Width="180px" ItemStyle-Wrap="true" >

 

 

 

<ItemStyle Wrap="True"></ItemStyle>

 

 

</telerik:GridBoundColumn >

 

 

 

<telerik:GridBoundColumn DataField="WebSite" HeaderStyle-Width="160px" HeaderText="WebSite"

 

 

UniqueName="Web" AllowFiltering="true" ItemStyle-Wrap="true" >

 

 

 

<ItemStyle Wrap="True"></ItemStyle>

 

 

</telerik:GridBoundColumn>

 

 

 

 

<telerik:GridBoundColumn DataField="Phone" HeaderStyle-Width="110px" HeaderText="Phone"

 

 

UniqueName="PhoneNo" AllowFiltering="true" >

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Address1" HeaderText="Address1"

 

 

UniqueName="AddressOne" AllowFiltering="false" Display="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Address2" HeaderText="Address2"

 

 

UniqueName="AddressTwo" AllowFiltering="false" Display="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="City" HeaderStyle-Width="100px" HeaderText="City"

 

 

UniqueName="Cit" AllowFiltering="true" ItemStyle-Wrap="true" Resizable="true" Display="false" >

 

<

 

HeaderStyle Width="100px"></HeaderStyle>

 

 

<ItemStyle Wrap="True" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="State" HeaderStyle-Width="100px" HeaderText="State"

 

 

UniqueName="Stat" AllowFiltering="true" Display="false" >

 

<

 

HeaderStyle Width="100px"></HeaderStyle>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Country" HeaderStyle-Width="100px" HeaderText="Country"

 

 

UniqueName="Cntry" AllowFiltering="true" Display="false">

 

<

 

HeaderStyle Width="100px"></HeaderStyle>

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn Display="false" DataField="Fax" HeaderText="Fax" AllowFiltering="false" UniqueName="Faxe">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn Display="false" DataField="ZipCode" HeaderText="ZipCode" AllowFiltering="false" UniqueName="Zip">

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ContactPersonName" HeaderStyle-Width="180px"

 

 

HeaderText="Contact Person Name" Display="false" UniqueName="ContactPersonNam" AllowFiltering="true" >

 

<

 

HeaderStyle Width="180px"></HeaderStyle>

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ContactPersonEmail" HeaderStyle-Width="150px"

 

 

HeaderText="Contact Person Email" Display="false" UniqueName="ContactPersonmail" AllowFiltering="true" >

 

<

 

HeaderStyle Width="150px"></HeaderStyle>

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ContactPersonDesignation" HeaderText="Contact Person Designation"

 

 

UniqueName="ContactPersonDesig" AllowFiltering="false" Display="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CompanyType" HeaderText="CompanyType"

 

 

UniqueName="CompanyTyp" AllowFiltering="true" Display="true" HeaderStyle-Width="210px" >

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ActiveStatus" HeaderText="Active"

 

 

UniqueName="Status" AllowFiltering="false" Display="true" HeaderStyle-Width="66px" >

 

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Remarks" HeaderText="Remarks"

 

 

UniqueName="Remark" AllowFiltering="false" Display="false" >

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CountryId" HeaderText="CountryId"

 

 

UniqueName="selCountryId" AllowFiltering="false" Display="false" >

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ContactCell" HeaderStyle-Width="180px"

 

 

HeaderText="Contact Person Name" Display="false" UniqueName="ContactPersonCell" AllowFiltering="true" >

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ContactPersonPhone" HeaderStyle-Width="180px"

 

 

HeaderText="Contact Person Name" Display="false" UniqueName="ContactPersonPhone" AllowFiltering="true" >

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

<EditFormSettings FormTableStyle-GridLines="None" UserControlName="UserControls/ClientAccountControl.ascx"

 

 

EditFormType="WebUserControl" PopUpSettings-Height="70%" PopUpSettings-Width="60%"

 

 

PopUpSettings-ZIndex="8999" PopUpSettings-Modal="true" FormMainTableStyle-HorizontalAlign="Center" >

 

 

<EditColumn ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" UniqueName="ClientUserControl" HeaderText="Insert/Update Client Details">

 

 

 

<HeaderStyle VerticalAlign="Middle"></HeaderStyle>

 

 

<ItemStyle HorizontalAlign="Center"></ItemStyle>

 

 

 

</EditColumn>

 

 

 

</EditFormSettings>

 

 

 

<ItemStyle Wrap="True" />

 

 

 

 

 

 

</MasterTableView>

 

 

<GroupingSettings CaseSensitive="False" />

 

 

 

<ClientSettings AllowColumnHide="true" AllowColumnsReorder="True" AllowDragToGroup="True"

 

 

ReorderColumnsOnClient="True" ColumnsReorderMethod="Reorder" >

 

 

<ClientEvents OnPopUpShowing="PopUpShowing" />

 

 

<Selecting AllowRowSelect="True" />

 

 

<Resizing ClipCellContentOnResize="false" AllowColumnResize="true" ResizeGridOnColumnResize="true" />

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" ScrollHeight="100%" />

 

 

</ClientSettings>

 

 

<FilterMenu EnableEmbeddedSkins="False" ExpandAnimation-Type="Linear" >

 

 

<

 

ExpandAnimation Type="Linear"></ExpandAnimation>

 

 

 

</FilterMenu>

 

 

</telerik:RadGrid>

 

 

 

</div>

 

 

<div id="divMessage" class="ShowMessage" runat="server" >

 

 

 

</div>

 

 

 

<%

-- <div style="vertical-align:middle; margin-left:40%;">

 

<asp:Button id="chkboxTemplateButton" runat="server" Text="Delete Selected Clients" onclick="chkboxTemplateButton_Click" />

</div> --

 

%>

 

 

 

<%

-- <asp:Panel ID="Panel1" runat="server">

 

<asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick" />

</asp:Panel> --

 

%>

 

 

 

 

</div>

 

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" RestoreOriginalRenderDelegate="true" EnableAJAX="true">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="RadGrid1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadGrid1" />

 

 

<telerik:AjaxUpdatedControl ControlID="divMessage" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Transparency="10" InitialDelayTime="0"

 

 

runat="server" BackgroundPosition="Center" EnableEmbeddedSkins="true" Skin="Outlook" >

 

 

 

<!--<asp:Image id="Image1" runat="server" ImageUrl="~/Images/busy.gif"/>-->

 

 

</telerik:RadAjaxLoadingPanel>

 

</

 

asp:Content>

 

0
Veselin Vasilev
Telerik team
answered on 11 Aug 2009, 12:30 PM
Hi Ravi Keshwani,

This code is very long and it is impossible to find where the problem is. Please open a support ticket and attach a sample running project there. We will do the rest.

Thanks

Regards,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
ComboBox
Asked by
Nasiem
Top achievements
Rank 1
Answers by
Yana
Telerik team
Ravi Keshwani
Top achievements
Rank 1
Simon
Telerik team
Veselin Vasilev
Telerik team
Share this question
or