Include a DropDown in RadToolBarDropDown - html

So I'm using Telerik's gui system and would like to insert a dropdown inside another one but I don't know how to do that.
This is what I've got so far
<telerik:RadToolBarDropDown runat="server" ToolTip="DropDown1" ImageUrl="~/Images/test.png">
<Buttons>
<telerik:RadToolBarButton runat="server" Text="Click me!" Value="TOGGLE_WALLS" CheckOnClick="true" ImageUrl="~/Images/checkmark.png"/>
</Buttons>
</telerik:RadToolBarDropDown>
More or less, a dropdown inside a dropdown. Is it possible? Do Telerik support this?

You can use an item template to nest a DropDownList or ComboBox in the RadToolBarDropDown:
<telerik:RadToolBarDropDown>
<Buttons>
<telerik:RadToolBarButton>
<ItemTemplate>
<telerik:RadDropDownList ID="RadDropDownList1" runat="server">
</telerik:RadDropDownList>
</ItemTemplate>
</telerik:RadToolBarButton>
</Buttons>
</telerik:RadToolBarDropDown>

Related

<a href> tag in TextBox in GridView

This is not a pretty application by any stretch. It's only meant for a select few to use in the office and does not require street appeal. With that said...
I have a gridview with the following template column:
<asp:TemplateField HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblAction" runat="server" Text='<%#(Eval("Action"))%>'
ToolTip="Action to be Taken"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtAction" runat="server"
TextMode="MultiLine" Width="450px" Height="100px" ValidationGroup="UpdateFU"
Text='<%#Eval("Action")%>'
CssClass="RequiredText" ToolTip="Follow-Up Action">
</asp:TextBox>
<asp:RequiredFieldValidator ID="rfv_txtAction" runat="server"
ControlToValidate="txtAction" ErrorMessage="FollowUp Action is Required"
Text="*" ValidationGroup="UpdateFU">
</asp:RequiredFieldValidator>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtAction" runat="server"
TextMode="MultiLine" Width="250px"
ValidationGroup="UpdateFU"
CssClass="RequiredText"
ToolTip="Follow-Up Action">
</asp:TextBox>
<asp:RequiredFieldValidator ID="rfv_txtAction" runat="server"
ControlToValidate="txtAction" ErrorMessage="FollowUp Action is Required"
Text="*" ValidationGroup="AddFU">
</asp:RequiredFieldValidator>
</FooterTemplate>
</asp:TemplateField>
For the example that is causing me trouble, the data in the field that is bound to this column is: **Testing with a link. Google**
The label in the ItemTemplate displays as I expect it to. The regular text is not hyperlinked and the hyperlink text is. Please see the included image:
ItemTemplate
When my row is in Edit mode, it also displays in the TextBox as I would suspect. Please see the included image: EditItemTemplate
When I attempt to Save or Cancel the record, the gridview does not recognize that the command button was clicked. It just sits there. If I remove the text that references the tag (leaving from my example, **Testing with a link.**), it works beautifully. The only problem being that I can't save any text in the textbox with my link.
Any help is greatly appreciated.
I think you are using UpdatePanel around your GridView. That is why you are missing exceptions if you are not checking the browser console. And that exception could very well be A potentially dangerous Request.Form value was detected from the client
Fixes for that here
A potentially dangerous Request.Form value was detected from the client
A potentially dangerous Request.Form value was detected from the client
https://www.codeproject.com/Tips/297679/A-potentially-dangerous-Request-Form-value-was-det
https://www.aspsnippets.com/Articles/ASPNet-Error-A-potentially-dangerous-RequestForm-value-was-detected-from-the-client.aspx

How to apply a bootstrap dropdown to asp.net dropdownlist control

I have dropdownlist controls which are populated from database. I want to apply bootstrap dropdownlist effect to it. How can I do it. I tried form-control but only the dropdown control changes and it is not like a BS dropdown, the list is the same as the one in asp.net.
The second image is what I want. and the first one is I get when I apply form control
Code:
<asp:DropDownList ID="ddlCType" runat="server" CssClass="form-control" DataSourceID="SqlDataSource1" DataTextField="Comp_Type" DataValueField="Type_ID" AutoPostBack="True" OnDataBound="DDLCTypeDataBound" Style="width: 400px">
It seems the bootstrap 3 is not able to pick 'form-control' from the rendered html from asp.net engine. So here are the options.
Option 1 : Assign the class during page load.
<script>
$().ready(function(){
$('#<%=ddlCType.ClientID%>').addClass("form-control");
});
</script>
Option 2 : : Use bootstrap-select plugin.
<asp:DropDownList ID="ddlCType" runat="server" CssClass="selectpicker" DataSourceID="SqlDataSource1" DataTextField="Comp_Type" DataValueField="Type_ID" AutoPostBack="True" OnDataBound="DDLCTypeDataBound" Style="width: 400px">
<script>
$().ready(function(){
$('#<%=ddlCType.ClientID%>').selectpicker();
});
</script>
Example : http://jsfiddle.net/DinoMyte/wd1z0zmg/8/

Opening a drop-down menu popup on a div using Bootstrap

Is there a way to toggle a drop-down on a div using twitter-bootstrap?
I currently have a bunch of divs on my page in the form of square menu items. If a square menu item div is clicked I would like a drop-down to show similar to the 'Button dropdowns' example on the bootstrap website.
CODE:
The code below is using an asp.net repeater. Basically everything in the ItemTemplate is dynamically generated on the server so you can look at it as a for-loop to generate my primary navigation items. I would like to make it so when one of these primary navigation items is clicked that a sub-menu shows. I don't care if it uses a popover or a drop-down, but I need something to show sub-items. Please disregard any templating syntax.
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<ul class="primaryNav">
</HeaderTemplate>
<ItemTemplate>
<li class="primary-nav-item">
<asp:HyperLink ID="navItem" runat="server" CssClass="mainNav-item-tile" NavigateUrl='<%# Eval("NavUrl") %>'>
<img width="64" height="64" src='<%# Eval("ImgSrc") %>' class="primary-nav-item-tile-img" />
<span><%# Eval("Title") %></span>
</asp:HyperLink>
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>

Unable to get selected option from a select field with a repeater (ASP.net / Sitecore)

I am working with an ASP repeater to get the elements from a Sitecore multi-list field (see code below). When the form is submitted, I can't pull the value of the selected option. Trying to add an ID and runat="server" to the element breaks the code because the repeater also has runat="server".
I'm very new to ASP, but it seems there has to be an option to pull the value of a selected field in a form.
This is the code:
<asp:Repeater ID="rptSubjectSelect" runat="server" OnItemDataBound="rptSubject_ItemDataBound">
<HeaderTemplate>
<select data-id="select" class="dropdown-component--select">
</HeaderTemplate>
<ItemTemplate>
<option value="<%# ((Sitecore.Data.Items.Item)Container.DataItem)["TextSubject"].ToString() %>"><%# ((Sitecore.Data.Items.Item)Container.DataItem)["TextSubject"].ToString() %></option>
</ItemTemplate>
<FooterTemplate>
</select>
</FooterTemplate>
</asp:Repeater>
I'd recommend that instead of using a repeater this way (to manually build an HTML select input), use an ASP dropdown control.

GridView Centering Issues

How can I center the text of the rows of an <asp:GridView /> that gets populated at run-time?
I have tried RowStyle-HorizontalAlign="Center" and similar things that I have found in this site to no avail.
Similarly, I cannot center a GridView inside a div—that is, <div><asp:GridView /></div>—to save my life.
Am I using a bunch of deprecated functions or what? Also, Chrome is my default browser.
I am aware that a thousand questions in the gist of mine have been asked before, but all that I have tried are either years old or are not working.
Thanks in advance!
Are you using bound columns or autogenerated? If you're binding them in your markup, something like this should work fine (this is an actual example from something of mine):
<asp:TemplateField HeaderText="External Id" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
<EditItemTemplate>
<asp:TextBox ID="txtExternalId" runat="server" Text='<%#Bind("ExternalId")%>'></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtNewExternalId" runat="server" Width="100%" />
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="lblExternalId" runat="server" Text='<%#Bind("ExternalId")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>