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

Showing a panel dynamicly then fill a combobox that is inside the panel

1 Answer 73 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
casa51
Top achievements
Rank 2
casa51 asked on 21 Oct 2010, 09:04 AM
Hello !
I'm a beginner with Telerik and ASP.NET.
I would like to do something I know it is possible but I can't understand how it works.

I work with VB.NET. I have a page with code behind.
In my page, the first time it is displayed, I want to show only
 - a telerik:RadTextBox
 - and an asp:ImageButton

What I would like to do is :
When the user write some text in the radtextbox then click on the ImageButton, I want to execute in the code behind of my page, some

code with an sql query and then, if with the sql query I find in my databases the value the user has written in the radtextbox, I

would like to show a panel (just change its property VISIBLE=FALSE to TRUE) and then to fill a telerik:RadComboBox that is situated

inside the panel that is now visible.
If the sql query can't find the value, I do not show the panel and I just show an error message on the page (with a label).


I have tried so many things but I can't understand how to do this.
Thank you for your help.

This is my code in the page with the controls :
(the panel i want to change the property VISIBLE is the one with the ID="PanelMineListe" - the textbox the user uses to write the

first value is the one with the ID="RadTextBoxMine" the he clicks on the imagebutton with te id="BtImgMineValider")


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ajax-essais.aspx.vb" Inherits="ajax_essais" %>
<!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>Essais</title>
</head>
<body>
 <form id="form1" runat="server">
 <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
  <asp:Panel ID="PanelRechMINE" runat="server" DefaultButton="BtImgMineValider"
           style="width:440px; padding-left:81px; height:100px; padding-top:20px; float:left;">


    <div style="float:left; position:relative; width:420px;">
      <div style="float:left; position:relative; padding-right:6px; height:28px;">
        <telerik:RadTextBox ID="RadTextBoxMine" runat="server" CssClass="BoxesOmbrees"
        EmptyMessage="Votre type Mine ici.." ValidationGroup="RechMine"
        Skin="Windows7" Width="190px"></telerik:RadTextBox>
       </div>
       <div style="float:left; position:relative; padding-right:6px;  height:28px;">
        <asp:ImageButton ID="BtImgMineValider" runat="server" Visible="true"
          ImageUrl="~/photos-francepiecesauto/commun/BtTrouver_r1_c1.png" ValidationGroup="RechMine"
                     title="Lancer une recherche.." />
       </div>
       <div style="float:left; position:relative; height:28px; font-size:10px; color:#ff0000; padding-top:6px;">
          <asp:RequiredFieldValidator ID="RequiredFieldValidatorMine1" runat="server" ControlToValidate="RadTextBoxMine"

ErrorMessage="* Type Mine requis." Display="Dynamic" ValidationGroup="RechMine" />
       </div>
    </div>



    <asp:Panel ID="PanelMineErrors1" runat="server" Visible="false" style="float:left; position:relative; width:420px; font-size:10px;

color:#ff0000;">
    <asp:Label ID="LabelMineErrors1" runat="server" />
    </asp:Panel>
    


    <asp:Panel ID="PanelMineListe" runat="server" DefaultButton="ImageButtonMineValid2" Visible="false" style="float:left;

position:relative; width:420px;">
       <div style="float:left; position:relative; padding-right:6px; width:300px; height:28px;">
             <telerik:RadComboBox ID="RadComboBoxMineListe" runat="server" MaxHeight="200px" Width="296px"
                  ValidationGroup="RechMine2" EmptyMessage="Choisissez un vĂ©hicule..." />
       </div>
       <div style="float:left; position:relative; height:28px; font-size:10px; color:#ff0000;">
          <asp:ImageButton ID="ImageButtonMineValid2" runat="server" Visible="true"
          ImageUrl="~/photos-francepiecesauto/commun/BtTrouver2_r1_c1.png" ValidationGroup="RechMine2"
                     title="Afficher le catalogue.." ToolTip="Afficher le catalogue.." />
          <asp:RequiredFieldValidator ID="RequiredFieldValidatorMine2" runat="server" style="color:#ff0000;"
                  ControlToValidate="RadComboBoxMineListe" ErrorMessage=" *" Display="Dynamic" ValidationGroup="RechMine2" />
       </div>
     </asp:Panel>




  </asp:Panel>
 </form>
</body>
</html>

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 27 Oct 2010, 09:12 AM
Hi,

Note that the desired functionality could be achieved the same way you will do this with asp TextBox and DropDown control. There is no specificity in Telerik controls that may lead to any different actions.
Additionally I would suggest you to use the TextBox onkeypress event and use some specific Web Service or Page Method for the validation you need.


Greetings,
Maria Ilieva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Ajax
Asked by
casa51
Top achievements
Rank 2
Answers by
Maria Ilieva
Telerik team
Share this question
or