.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Sharon Maxwell
Post New Web Links

styling dropdownlist problem

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net
 

Dear All,

im facing a problem while styling my ddl, what i did is:

<div><asp ropDownList ID="DropDownList1" runat="server" style="background-color:Transparent;" Width="100%">
    </asp: dropDownList></div>

<div class="stlGradient">
<asp ropDownList ID="DropDownList1" runat="server" style="background-color:Transparent;border:none;" Width="100%"></asp: dropDownList>
</div>

the DIV style is having a bg image repeated X.

now this worked on Firefox
on google Chrome: the border gone but the background still white
on IE 7: nothing happend

thanks for helping.




View Complete Post


More Related Resource Links

jQuery: Styling DropDownList Alternating Items (Rows)

  
In the following example, I will show how you can style any asp:dropdownlist very easily.

The example demonstrates how you can change alternating row items background color, using the fadeTo() to add a nice touch in the dropdownlist. You can change alt rows with a couple lines.

Weird problem in Detailsview - Dropdownlist in

  

Hi,

I'm new in this forum and I really hope you'll be able to help me.

I converted a field in the detailsview into a template field and put a dropdownlist in the <InsertItemTemplate> and it worked great. This is the code I put:

<InsertItemTemplate><asp:DropDownList runat="server" DataSourceID="sdsGenresPossible" DataTextField="Genre"  DataValueField="Index" SelectedValue='<%# Bind("Genre") %>' ></asp:DropDownList></InsertItemTemplate>


Now, I tried to do the same thing for the <EditItemTemplate> . This is the code I put there:

<EditItemTemplate><asp:DropDownList runat="server" DataSourceID="sdsGenresPossible" DataTextField="Genre" DataValueField="Index" SelectedValue='<%# Bind("Genre") %>' ></asp:DropDownList></EditItemTemplate>  

When I change the DV properties I do see that a dropdownlist was  added but when I run the program and click on "Edit" in the DV nothing happens (however when I click on "Insert" it works fine).

This is the Select command for the data source I used:

<asp:SqlDataSource runat="server"
          

ASP.Net MVC Dropdownlist and selected value problem

  
I was able to create a dropdownlist for my MVC project, but the value is not selected as  selected value on the dropdownlist. It just shows whole county list from the first.The value is from database. I tried find it from previous post, but it was quite confusing. Please, suggest me for any idea. Controller Code public ActionResult Edit(int i) {      var items = new SelectList(db.MST_COUNTRies.ToList(), "COUNTRY_ID", "COUNTRY_NM");      ViewData["MST_COUNTRies"] = items; } View Code <p>     <%= Html.DropDownList("COUNTRY_ID", (SelectList)ViewData["MST_COUNTRies"])%> </P>I was able to create a dropdownlist for my MVC project, but the value is not selected as  selected value on the dropdownlist. It just shows whole county list from the first.The value is from database. I tried find it from previous post, but it was quite confusing. Please, suggest me for any idea.Controller Codepublic ActionResult Edit(int i){     var items = new SelectList(db.MST_COUNTRies.ToList(), "COUNTRY_ID", "COUNTRY_NM");     ViewData["MST_COUNTRies"] = items;}View Code<p>    <%= Html.DropDownList("COUNTRY_ID", (SelectList)ViewData["MST_COUNTRies"])%></P>

Hover State styling problem...

  
Here is a link to a screenshot of the off state... http://www.spasticgoat.com/shareshot.jpg when I hover over one of them, it activates a blue gradient background image in the tabs, which I can't get rid of! I've been trying to just use: background-image: none; and then assign a background color to the hover state, but it's not happening.   Any ideas?

Problem Binding DropdownList in a gridView to a datasource

  
I have a Dropdownlist in an itemTemplate in a gridview. My gridView binds to dataTable1 (from which the selected value for dropdown comes from) and dropDown binds to dataTable2 (i need to get DataValueField and DataTextField from here).<asp:TemplateField HeaderText="Category"> <ItemTemplate> <asp:DropDownList ID="Cat" runat="server" SelectedValue='<%#Bind("CATEGORY") %>' > </asp:DropDownList> </ItemTemplate> <FooterStyle BorderStyle="None" /> <HeaderStyle BorderStyle="None" /> <ItemStyle BorderStyle="None" /> </asp:TemplateField>How do I do that? thanks in advance!

Problem binding data to DropDownList in DetailsView

  
Hi guys. I have a slight issue I awas trying to fix for 2-3 days, but nothing I try works. The scenario: DetailsView control in edit mode, I pass parameters to the SqlDataSourceProducts (edit.aspx?id=2) and the data source selects the appropriate data and fills in the DetailsView form. Except two drop down lists. These two DDLs (DDL2 and DDL3) are dependent on the previous DDL (DDL1) in the DetailsView. Thanks to PeteNet, when the selected value of the DDL1 changes, DDL2 and 3 change their lists and get bound to the database. The problem is: when I edit something from the database, DDL2 and 3 appear empty and when I update any other field and leave these, they get blanked in the database.  My goal is to set the selected value of DDL2 and 3 to the values in the database WHERE ID = QueryStringField="id". I can go for not binding the data unless the field is changed, but does not sound professional and user friendly. code: The SqlDataSource used to select the parameters from the table and populate the DetailsView <asp:SqlDataSource ID="SqlDataSourceProduct" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT ID, wm_number, upc, check_digit, unit, price_unit, brand, category, shelves, type, cooking, storage, packaging, origin, nutriti

dropdownlist selected value problem

  
i have dropdownlist<%= Html.DropDownListFor(model => model.SchoolDistrict,Model.sSchoolDistrict) %>To Poulate this value i have below code in controllerslist = new SelectList(list, "ID", "Name", selected);but what ever selected value i pass didnot shown in ddl

dropdownlist - css - problem chrome

  

<div>
      <span>
          <asp:Label ID="Label18" runat="server" Text="Vrsta kreditne kartice"></asp:Label></span><span
class="formw"><asp:DropDownList ID="DropDownList2" Selected="True" width="200px" runat="server">
              <asp:ListItem>Visa</asp:ListItem>
              <asp:ListItem>MasterCard</asp:ListItem>
              <asp:ListItem>Diners Club Card</asp:ListItem>
              </asp:DropDownList>
          </span>
    </div>


div.row {
  clear: both;
  padding-top: 5px;
  }

div.row span.label {
  float: left;
  width: 175px;
  text-align: left;
  color:White;
  }

div.row span.formw {
  float: left;
  width: 500px;
  text-align: left;
/*  margin:0 0 0 10px;*/

  } 

I have a

Postback Problem using Lightbox with DropDownList

  

Hi all,

I have two sites: "Default.aspx" and "mySubsite.aspx". In "Default.aspx" I have a hyperlink to open a lightbox window, which works perfectly.

Here is the code for it:

<asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
<ContentTemplate>
<a href="mySubsite.aspx" class="lbOn">Open Lightbox Window</a>
</ContentTemplate>
</asp:UpdatePanel>


When the lightbox window opens("mySubsite.aspx.cs") I placed two drop down lists ( parent child use) . First DDL contains all the parent names and the second DDL returns the subname to the corresponding parent name. So basically I select a parent item and get the right subname for it.

Code for it looks this way.

protected void Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{
DDLParent.DataSource = data_string;
DDLParent.DataBind();
}

}

protected void DDLParent_SelectedIndexChanged(object sender, EventArgs e)

Dropdownlist problem

  

I have a dropdownlist and a method to handle its selectedIndexChanged event.  When I change the dropdown's selected index and click on a submit button, the selectedIndexChanged event fires as expected.  If I click the again a same selected item second time, the event doesn't fire.

 

what what was reason I am not getting.. almost 5 hrs spend .. different diffrent ways likse set to selected index set 0 etc.. still it's not getting.

 

Pls give answers quick


Gridview Dropdownlist databinding problem

  

I am using gridview, in ItemTemplate  I am using dropdownlist which has the hard-coded value, I want to get updated value of dropdownlist from database, but whenever I use EVAL, it throws the following error:


 'ddl' has a SelectedValue which is invalid because it does not exist in the list of items.

Parameter name: value


I am using the following code:

<asp:TemplateField HeaderText="Status"  >
                  <ItemTemplate>
                      <asp:DropDownList ID="ddl" runat="server" SelectedValue='<%# Bind("Status")%>' >
      

[Problem] MVC DropDownList Cascading Partial View

  

Hi, i'm trying to implement a cascading dropdownlist inside a partial view.

this is the code:

js function


function dropDownListCascade() {
    $('#idTipoAntecedente').change(function () {
        $.ajaxSetup({ cache: false });
        var selectedItem = $(this).val();
        if (selectedItem == "" || selectedItem == 0) {
            $("#idAntecedente").attr('disabled', 'enabled');

GridView EditItemTemplate DropDownList Problem

  

I'm creating a GridView that displays the details of an order.  One of the columns shows which Location the order went to.  All the information is correctly displayed and is based on a single SQL query (SqlDataSource1). 

When they edit the item, I have another SQL query (SqlDataSource2)  that correctly pulls a list of all the customer's locations and populates a DropDownList.  The issue I'm having is trying to set the SelectedValue of the DropDownList to the Location value, which is pulled in the first SQL query.

Here's what I've been working with so far... 

<asp:TemplateField>
   <ItemTemplate

GridView EditItemTemplate DropDownList Problem

  

I'm creating a GridView that displays the details of an order.  One of the columns shows which Location the order went to.  All the information is correctly displayed and is based on a single SQL query (SqlDataSource1). 

When they edit the item, I have another SQL query (SqlDataSource2)  that correctly pulls a list of all the customer's locations and populates a DropDownList.  The issue I'm having is trying to set the SelectedValue of the DropDownList to the Location value, which is pulled in the first SQL query.

Here's what I've been working with so far... 

<asp:TemplateField>
   <ItemTemplate

dynamic dropdownlist problem !

  

hi ,

I have dynamic dropdownlist .. and I need to get values when submit !

so what i can write ?

I tryed : foreach(DropDownList ddl in Page.Form.Controls) .. didnt work !!

I work with C#


Link Button & DropDownList Control problem in BlackBerry

  

Hi,

 I have an Mobile web application. In my application i have Link Button control and Drop Down list control. These controls are not working in BlackBerry devices. Does any come across this problem? Can you give me better solution for this?

Iam thinking to implement javascript for DropDownList control? is this the right way to overcome the problem.

I tested in BlackBerry Bold 9000 Device emulator.

 


Problem to group radio button across gridview rows

  
In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend