I do not want the vertical scrollbar to appear for the dropdown list. I want to show all the items. How do I do that ?
size attribute doesn't work.
code design:
<asp:DropDownList ID="ddlTables" CssClass="labels" runat="server" AutoPostBack="true"
AppendDataBoundItems="true" Width="230px"
OnSelectedIndexChanged="ddlTables_SelectedIndexChanged">
<asp:ListItem Text="--Select--" Value="0" />
</asp:DropDownList>
The Scrollbar is there because you have too many items or too few height. Assuming you want to keep all the items there, you need to set this.size attribute to a value which will show all of the items without scrolling:
<asp:DropDownList ID="ddlTables"
CssClass="labels"
runat="server"
AutoPostBack="true"
AppendDataBoundItems="true"
Width="230"
onMouseOver="this.size=50;"
onMouseOut="this.size=1;"
OnSelectedIndexChanged="ddlTables_SelectedIndexChanged">
<asp:ListItem Text="--Select--" Value="0" />
</asp:DropDownList>
Related
I have a Drop down field, however List Items seem to be ignored. This is for an aspx project I am working on in Visual studio. Am I missing something? My code:
<form runat="server">
<asp:TextBox CssClass="form-control" ID ="dateField" runat="server" placeholder="Date (DD/MM/YYYY)"></asp:TextBox><br/>
<asp:DropDownList CssClass="form-control" runat="server" placeholder=""> </asp:DropDownList>
<asp:ListItem Text="General Waste" Value="General Waste"></asp:ListItem>
</form>
You have closed the DropDownList tag before the ListItem. ListItem should be IN the DropDownList.
<form runat="server">
<asp:TextBox CssClass="form-control" ID ="dateField" runat="server" placeholder="Date (DD/MM/YYYY)"></asp:TextBox><br/>
<asp:DropDownList CssClass="form-control" runat="server" placeholder="">
<asp:ListItem Text="General Waste" Value="General Waste"></asp:ListItem>
</asp:DropDownList>
</form>
So, the reason for my disturbance, I need to put these TextBoxes, Labels, Buttons in a pretty line among themselves.
For some of you this might be easy doing in CSS, so please help me :D
Any reference where I can read about it would be nice too.
Extra Info:
Website is based on ASP.NET
EDIT1:
<asp:RadioButtonList ID="radioListRight" runat="server" AutoPostBack="True" RepeatDirection="Horizontal" >
<asp:ListItem>Recht hinzufuegen</asp:ListItem>
<asp:ListItem>Recht entfernen</asp:ListItem>
</asp:RadioButtonList>
<asp:Label ID="LabelError" runat="server" Font-Bold="True" Font-Size="Large" ForeColor="Red"></asp:Label>
<br />
Projekt: <asp:DropDownList ID="comboProj" runat="server" AutoPostBack="True" Width="140px" Visible="False">
</asp:DropDownList><br />
Teilprojekt: <asp:DropDownList ID="ComboTP" runat="server" Width="136px" Visible="False">
</asp:DropDownList>
<asp:Button ID="btnAddTP" runat="server" Text="Hinzufügen" Visible="False" />
<br />
<asp:ListBox ID="ListBoxTP" runat="server" Height="164px" Width="422px" Visible="False"></asp:ListBox><br />
Art der Berechtigungen:
<asp:DropDownList ID="comboBerechtigungsArt" runat="server" Visible="False" AutoPostBack="True">
<asp:ListItem>Auswählen...</asp:ListItem>
<asp:ListItem Value="CHECK-IN / CHECK-OUT"></asp:ListItem>
<asp:ListItem>CHECK-OUT</asp:ListItem>
<asp:ListItem>CHECK-IN</asp:ListItem>
</asp:DropDownList><br />
Berechtigungen eintragen für <asp:TextBox ID="TextBoxUser" runat="server" Width="151px" placeholder="HendrikHeim" Visible="False"></asp:TextBox>
<asp:Button ID="btnAddUser" runat="server" Text="Hinzufügen" Visible="False" />
<br />
<asp:Label ID="labelEmail" runat="server" Text="EMail"></asp:Label>
Don't use tables, use CSS and 'div' nodes to wrap the content and the display style to put the data inline.
Use http://www.w3schools.com/
As a source for CSS
Tables will not flow correctly if the browser width is to narrow, putting into individual tags will allow the browser to style the layout correctly.
To put elements on the same row:
<div style="display:inline;width:80px;">content here</div>
<div style="display:inline;width:100px;">content here</div><br />
You can then fix the width of the columns by adding more styles, width etc.
If you are unfamiliar with CSS, then spend some time learning it.
I have two radio list controls having - 5 list item for rach radio list and "RepeatDirection="Horizontal". the issue is i would like to make same size for itemlist so that the UI looks properly.
<asp:RadioButtonList
ID="RadioButtonList1"
runat="server"
BorderWidth="2"
BorderColor="SaddleBrown"
BorderStyle="Dotted"
Font-Names="Comic Sans MS"
ForeColor="Snow"
BackColor="OrangeRed"
Width="400"
RepeatDirection="Horizontal"
>
<asp:ListItem Text="CornFlowerBlue"></asp:ListItem>
<asp:ListItem Text="Pink"></asp:ListItem>
<asp:ListItem Text="Orange"></asp:ListItem>
<asp:ListItem Text="DarkBlue"></asp:ListItem>
<asp:ListItem Text="DarkCyan"></asp:ListItem>
</asp:RadioButtonList>
<br />
<asp:RadioButtonList
ID="RadioButtonList2"
runat="server"
BorderWidth="2"
BorderColor="SaddleBrown"
BorderStyle="Dotted"
Font-Names="Comic Sans MS"
ForeColor="Snow"
BackColor="OrangeRed"
Width="400"
RepeatDirection="Horizontal"
>
<asp:ListItem Text="Red"></asp:ListItem>
<asp:ListItem Text="Pink"></asp:ListItem>
<asp:ListItem Text="Orange"></asp:ListItem>
<asp:ListItem Text="DarkBlue"></asp:ListItem>
<asp:ListItem Text="white"></asp:ListItem>
</asp:RadioButtonList>
asp:RadioButtonList Creates a table on DOM, Here you can easily handle this with CSS
Add this code to header style tag.
#RadioButtonList2 td, #RadioButtonList1 td { min-width: 140px;}
All respected members,
i am trying to insert a aspx page within iframe in html page as :
<iframe id="one" src="ElectLocoPerformance2.aspx" height="100%" width="100%" runat="server" scrolling="no" marginheight="0%" frameborder="0" /> </p>
Pgae is displaying well, however, AJAX popup calender is not visible fully as some part are hiddin behind the iframe. Although dropdown list are visible fully.
My aspx code is as under:
<body bgcolor="#ffffcc">
<form id="form1" runat="server">
<ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajax:ToolkitScriptManager>
<table class="style3">
<tr>
<td class="style38">
<strong>Trains lost Punctuality (Territorial)</strong></td>
<td class="style43">
From Date</td>
<td class="style22">
<asp:TextBox ID="txtstrdt" runat="server" Contenteditable="false" Width="90px"/>
<ajax:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtstrdt" Format="dd-MMM-yy" >
</ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="DateRequiredFieldValidator"
ControlToValidate="txtstrdt" ErrorMessage="Name"
Text="Can not be left blank" runat="server" Display="Dynamic"
ForeColor="Red" Font-Names="Tahoma" Font-Size="Small" />
</td>
<td class="style63">
<strong class="style66">To Date</strong></td>
<td class="style30">
<asp:TextBox ID="txtenddt" runat="server" Contenteditable="false" Width="90px"/>
<ajax:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtenddt" Format="dd-MMM-yy">
</ajax:CalendarExtender>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
ControlToValidate="txtenddt" ErrorMessage="Name"
Text="Can not be left blank" runat="server" Display="Dynamic"
ForeColor="Red" Font-Names="Tahoma" Font-Size="Small" /></td>
<td class="style61">
Territorial Railway</td>
<td class="style65">
<asp:DropDownList runat="server" id="txtrly" BorderColor="Black" Width="90px" Height="22px"
CssClass="style62" >
<asp:ListItem Value="">ALL</asp:ListItem>
<asp:ListItem Value="CR">CR</asp:ListItem>
<asp:ListItem Value="ER">ER</asp:ListItem>
<asp:ListItem Value="ECR">ECR</asp:ListItem>
<asp:ListItem Value="ECoR">ECoR</asp:ListItem>
<asp:ListItem Value="NR">NR</asp:ListItem>
<asp:ListItem Value="NCR">NCR</asp:ListItem>
<asp:ListItem Value="NER">NER</asp:ListItem>
<asp:ListItem Value="NFR">NFR</asp:ListItem>
<asp:ListItem Value="NWR">NWR</asp:ListItem>
<asp:ListItem Value="SR">SR</asp:ListItem>
<asp:ListItem Value="SCR">SCR</asp:ListItem>
<asp:ListItem Value="SER">SER</asp:ListItem>
<asp:ListItem Value="SECR">SECR</asp:ListItem>
<asp:ListItem Value="SWR">SWR</asp:ListItem>
<asp:ListItem Value="WR">WR</asp:ListItem>
<asp:ListItem Value="WCR">WCR</asp:ListItem>
</asp:DropDownList></td>
<td class="style60">
<strong>Owning Shed</strong></td>
<td class="style76">
<asp:DropDownList runat="server" id="txtshed" BorderColor="Black" Width="90px" Height="22px"
CssClass="style62" >
<asp:ListItem Value="">ALL</asp:ListItem>
<asp:ListItem Value="BSL">BSL</asp:ListItem>
<asp:ListItem Value="AQ">AQ</asp:ListItem>
<asp:ListItem Value="KYN">KYN</asp:ListItem>
<asp:ListItem Value="ASN">ASN</asp:ListItem>
<asp:ListItem Value="HWH">HWH</asp:ListItem>
<asp:ListItem Value="MGS">MGS</asp:ListItem>
<asp:ListItem Value="GMO">GMO</asp:ListItem>
<asp:ListItem Value="WAT">WAT</asp:ListItem>
<asp:ListItem Value="ANGL">ANGL</asp:ListItem>
<asp:ListItem Value="GZB">GZB</asp:ListItem>
<asp:ListItem Value="LDH">LDH</asp:ListItem>
<asp:ListItem Value="JHS">JHS</asp:ListItem>
<asp:ListItem Value="CNB">CNB</asp:ListItem>
<asp:ListItem Value="AJJ">AJJ</asp:ListItem>
<asp:ListItem Value="ED">ED</asp:ListItem>
<asp:ListItem Value="RPM">RPM</asp:ListItem>
<asp:ListItem Value="BZA">BZA</asp:ListItem>
<asp:ListItem Value="LGD">LGD</asp:ListItem>
<asp:ListItem Value="KZJ">KZJ</asp:ListItem>
<asp:ListItem Value="TATA">TATA</asp:ListItem>
<asp:ListItem Value="BNDM">BNDM</asp:ListItem>
<asp:ListItem Value="BKSC">BKSC</asp:ListItem>
<asp:ListItem Value="SRC">SRC</asp:ListItem>
<asp:ListItem Value="BIA">BIA</asp:ListItem>
<asp:ListItem Value="BRC">BRC</asp:ListItem>
<asp:ListItem Value="BL">BL</asp:ListItem>
<asp:ListItem Value="TKD">TKD</asp:ListItem>
<asp:ListItem Value="ET">ET</asp:ListItem>
<asp:ListItem Value="NKJ">NKJ</asp:ListItem>
</asp:DropDownList></td>
<td class="style72">
<asp:Button ID="btnSend" Text="GO" runat="server" onclick="btnSend_Click"/></td>
<td class="style64">
</td>
</table>
Is there any possibility to resolve this issue? please help.
Or suggest any method to put two or more submit buttons be placed in form teg for redirecting differnt pages based on date pickers.
Have you tried positioning the elements then setting the z-index property on the popup calendar?
<table>
<tr>
<td>
<div style="margin-left: 220px;">
<asp:Button ID="btn1" Text="Edit" CommandArgument='<%#Eval("UserID") %>'
CausesValidation="false" CommandName="Edit" Visible="false" runat="server" />
</td>
</div>
<td>
<div style="margin-left: 370px;">
<asp:Button ID="btn2" Visible="false" Text="Edit" CommandArgument='<%#Eval("UserID") %>'
CausesValidation="false" CommandName="Edit" runat="server" />
</div>
</td>
</tr>
</table>
The problem is when both buttons are made visible dynamically..the second button shifts right wards..how do I fix their position so they appear exactly where I want them ?
[edit]
Do I need to use span or something instead of those divs ? IS there an HTML property that lets u fix a position of an element on page ? How do u do it ? I hv been googling but nothing came up..plz help
[edit 2]
I just added position:fixed in style attribute in the two buttons..when I ran the code again..both buttons didn't even appear!
how do u do it if not even this way ?
[edit 3]
I removed the divs and set both "td's" align property to centre..now the edit buttons are both appearing on the left together :/
Set a fixed width on the columns.
Also you need to fix the ordering of your td and div tags
<table>
<tr>
<td width="200px">
<asp:Button ID="btn1" Text="Edit" CommandArgument='<%#Eval("UserID") %>' CausesValidation="false" CommandName="Edit" Visible="false" runat="server" />
</td>
<td width="200px">
<asp:Button ID="btn2" Visible="false" Text="Edit" CommandArgument='<%#Eval("UserID") %>' CausesValidation="false" CommandName="Edit" runat="server" />
</td>
</tr>
</table>
Will make the column 200px wide, just replace it with whatever width that suits your needs.
Edit:
And well you don't really need the div tags for what you are doing.