Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
899 views
I had added a RequiredFieldValidator to dropdownlist that make sure user had selected value before insert to db. but the checking is not working that will not prompt error message.

<telerik:RadDropDownList ID="rdl_bu" runat="server" DataSourceID="LDS_BU" DefaultMessage="Please select..."
 DataValueField="BU_ID" DataTextField="BU_name" AutoPostBack="true" >
</telerik:RadDropDownList>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="rdl_bu"
         InitialValue="Please Select..." ErrorMessage="Please select a Business Unit."></asp:RequiredFieldValidator>
Attila Antal
Telerik team
 answered on 11 Mar 2019
3 answers
122 views

Attempting to use an XmlDataSource to populate the values in a dropdown list control in a GridTemplateColumn edit and insert templates.

Searched over:
 1 - using ASP datasources: https://docs.telerik.com/devtools/aspnet-ajax/controls/combobox/data-binding/binding-to-asp-datasource-components
 2 - using inline XML in an XmlDataSource: http://www.java2s.com/Code/ASP/XML/UsingInlineXMLDatainanXmlDataSourceControl.htm
 3 - fixing the 'GridInsertionObject does not contain a property named 'X' ' error: https://weblogs.asp.net/kencox/fixing-the-telerik-webcontrols-gridinsertionobject-does-not-contain-a-property-error
 4- Populating a dropdownlist in a datagrid template column: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/Common/radcombobox-in-radgrid
 
 * Yes, the links above reference the combobox control, presumably the dropdown list functions the same way.
 
 Goal: Populate a DropDown list using an XmlDataSource and inline XML
 
 Problem: it does not work.
 Looking for the proper format of the inline XML to get this to work.
  Links 1 and 4 say that the XML file has to be formatted as <items><item>, but this causes an error when inline stating that 'items' is invalid'
  Links 2 say to use <Data><items><item>, which doesn't throw an error but doesn't load
  Using the method from Link 3 to set the default values, I avoid the GridInsertObject error, but the defaulted value is not bound.

<telerik:GridTemplateColumn HeaderText="Wpn Qual" DefaultInsertValue="M">
    <ItemTemplate><%#DataBinder.Eval(Container.DataItem,"WPN_QUAL_BADGE") %></ItemTemplate>
    <EditItemTemplate>
        <telerik:RadDropDownList runat="server" ID="ddlWpnQual" DataTextField="Text" DataValueField="Value" DataSourceID="xmlWpnQual"
            SelectedValue='<%#Bind("WPN_QUAL_BADGE") %>' ></telerik:RadDropDownList>
    </EditItemTemplate>
    <InsertItemTemplate>
        <telerik:RadDropDownList runat="server" ID="ddlWpnQual" DataTextField="Text" DataValueField="Value" DataSourceID="xmlWpnQual"
            SelectedValue='<%#Bind("WPN_QUAL_BADGE") %>' ></telerik:RadDropDownList>
    </InsertItemTemplate>
</telerik:GridTemplateColumn>

 

<asp:XmlDataSource ID="xmlWpnQual" runat="server" XPath="Data/Items" >
    <Data>
        <Items>
            <Item Text="-- Select --" Value="" />
            <Item Text="Marksman" Value="M" />
            <Item Text="SharpShooter" Value="S" />
            <Item Text="Expert" Value="E" />
        </Items>
    </Data>
</asp:XmlDataSource>

 

And yes, I can manually create the items via markup in each instance of the dropdownlist... I would prefer to use a scalable approach in this specific instance.

 

 

Eric R | Senior Technical Support Engineer
Telerik team
 answered on 20 Feb 2019
4 answers
610 views

Hi

For my dropdownlist, everything works fine except the arrow is not showing up. png files are there in ...Styles/Default folder. Is there another file that would be missing in my project, something like ...kendo.all.min.js or whatever...

Marin Bratanov
Telerik team
 answered on 20 Feb 2019
2 answers
97 views

I have a web form master page that has a menu across the top, then I have 3 RAD Dropdown lists.

When I access the menu, the menu items are displaying BEHIND the drop down lists, not in front of them.

I am using "default" code from Microsoft for the contents of the master page, and I added the telerik items to that page.

Here is a snippet of the code:

I know it probably has something to do with CSS, but I am not sure where to look?

<form id="form1" runat="server">
    <div class="page">
        <div class="header">
            <div class="title">
                <h1>GLISA Score Entry and Report Processor</h1>
            </div>
            <div class="clear hideSkiplink">
                <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
                </asp:Menu>
            </div>
        </div>
        <div class="main">
            <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
            </telerik:RadStyleSheetManager>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <Scripts>
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
                </Scripts>
            </telerik:RadScriptManager>
            <telerik:RadDropDownList
                AppendDataBoundItems="true"
                AutoPostBack="true"
                Width="300px"
                ID="ddl_Season"
                runat="server"
                SelectedText="Please select Season"
                DataSourceID="dsSeasonName"
                DataTextField="SeasonName"
                DataValueField="ID">

 

Marin Bratanov
Telerik team
 answered on 25 Jan 2019
2 answers
65 views

I created a new project, and added a RadDropDownList to the form. I went into the configuration of the DDL, and tried to add a new datasource to an accdb database.

I clicked <new data source>, selected SQL database as the type, named the source and clicked OK.

On the Choose data connection page, I selected new connection. In the next page, i selected Microsoft Access Database File, and the always use this selection checkbox was checked.

I clicked continue.

In the Add connection dialog, I clicked browse for my database file name, and selected the ACCDB. This database has no log in, so i cleared out the UserName of Admin.

At this point, no matter what I do - either click test connection or click OK, VS2017 crashes with no error, just "Microsoft Visual Studio 2017 has stopped working".

I have tried this multiple times with the same result.

Can someone help please?

Jerry

Rumen
Telerik team
 answered on 15 Jan 2019
1 answer
97 views

I have an array of items of possible CSV fields that when the page load i need it to auto populate with the correct field name of the CSV, 

<div id="divRadGridCsvImport_Wrapper" class="RadGridWrapper">
                    <telerik:RadGrid EnableLinqExpressions="False" ID="radgridCsvMapping" runat="server" AutoGenerateColumns="false" AllowPaging="False" AllowSorting="False" GridLines="None" Width="500">
                        <ClientSettings EnableRowHoverStyle="true"></ClientSettings>


                        <MasterTableView>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="CSV Field">
                                    <ItemTemplate>
                                        <asp:Label ID="CSVfield" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.CSVfield")%>'></asp:Label>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Sample Data">
                                    <ItemTemplate>
                                        <asp:Label ID="SampleData" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.CSVfield")%>'></asp:Label>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="System Field">
                                    <ItemTemplate>
                                        <asp:DropDownList CssClass="inputfields" ID="dropDownColumnName" onchange="FieldMappingsOnChange(this)" runat="server" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                
                            
                            </Columns>
                            <NoRecordsTemplate>
                                <div>
                                    <asp:Literal ID="litNoRecords" runat="server" Text="No Records" />
                                </div>
                            </NoRecordsTemplate>
                        </MasterTableView>
                    </telerik:RadGrid>
                </div>

See in the image loaded, i'm trying to make it easier for users so if a match to the field with our field names is closer i.e. same names or close to as possible, it will load these when the page loads. then the user can change and fill in the ones that couldn't be automatically populated. I think Load On Demand may work, but before i try this, i'd like to know if it can be done or what others are doing.

 

Thanks

Vessy
Telerik team
 answered on 09 Jan 2019
1 answer
246 views

I have a requirement to dynamically build a table on server side and fill it with either textbox(for entering strings) or textbox with a small drop down next to it to enter numbers and unit of measure.  My problem is that if I add both text and drop down to the same cell drop down overlaps text box for few pixels and is not aligned with other controls in rows above.normal text box size is 200(from CSS) and short is 150(from CSS). List box width is set to 50, so I expect controls to be aligned, but they are not. Screen shot attached.  How this can be fixed?

Here is my code :

CSS:

.myLabelCss {
            color: Red !important;
            width: 20px !important;
        }

        .myLabelCssDD {
            color: Red !important;
            width: 10px !important;
        }

        .CustomClass {
            width: 200px !important;
        }

        .CustomClass .riSingle .riTextBox {
                width: 200px !important;
            }

            .CustomClassShort{
            width: 150px !important;
        }

Table declaration

<asp:Table ID="tblParms" runat="server" Font-Names="Arial"        ForeColor="Black"  CellSpacing="10" BorderColor="Black" Width="100%"
                                                    EnableViewState="False" BorderStyle="None"   meta:resourcekey="tblParmsResource1">  </asp:Table>

 

VB code:

Private Sub buildControls()
        Dim tRow As New TableRow()
        tRow.ID = "MyRow1"
        Dim tCell As New TableCell()
        ' cell 1, label
        tCell.Text = "MyLabel1"
        tCell.VerticalAlign = VerticalAlign.Top
        tCell.Width = New Unit("30%")
        tRow.Cells.Add(tCell)
        'cell 2, controls
        tCell = New TableCell()
        tCell.VerticalAlign = VerticalAlign.Top
        tCell.HorizontalAlign = HorizontalAlign.Left
        tCell.Width = New Unit("30%")
        Dim txtBox = New RadTextBox()
        txtBox.ID = "MyText1"
        txtBox.CssClass = "CustomClassShort"
        txtBox.Label = "*"
        txtBox.LabelCssClass = "myLabelCss"
        txtBox.MaxLength = 15
        tCell.Controls.Add(txtBox)
        Dim ddUOMList As RadDropDownList = New RadDropDownList
        ddUOMList.ID = "MyList1"
        ddUOMList.Width = 50
        ddUOMList.CausesValidation = False
        Dim UOMItem As New DropDownListItem()
        UOMItem.Text = "A"
        UOMItem.Value = "A"
        ddUOMList.Items.Add(UOMItem)
        UOMItem = New DropDownListItem()
        UOMItem.Text = "mA"
        UOMItem.Value = "mA"
        ddUOMList.Items.Add(UOMItem)
        tCell.Controls.Add(ddUOMList)
        tRow.Cells.Add(tCell)
        tblParms.Rows.Add(tRow)
        tRow = New TableRow()
        tRow.ID = "MyRow2"
        tCell = New TableCell()
        ' cell 1, label
        tCell.Text = "MyLabel2"
        tCell.VerticalAlign = VerticalAlign.Top
        tCell.Width = New Unit("30%")
        tRow.Cells.Add(tCell)
        'cell 2, controls
        tCell = New TableCell()
        tCell.VerticalAlign = VerticalAlign.Top
        tCell.HorizontalAlign = HorizontalAlign.Left
        tCell.Width = New Unit("30%")
        txtBox = New RadTextBox()
        txtBox.ID = "MyText2"
        txtBox.CssClass = "CustomClass"
        txtBox.Label = "*"
        txtBox.LabelCssClass = "myLabelCss"
        txtBox.MaxLength = 15
        tCell.Controls.Add(txtBox)
        tRow.Cells.Add(tCell)
        tblParms.Rows.Add(tRow)
    End Sub

 

Marin Bratanov
Telerik team
 answered on 23 Dec 2018
4 answers
1.1K+ views
I have a RadGrid with an update function and an EditItemTemplate.
In here I have a RadDropDownList which is populated by a SQLDataSource.

My issue is: when a user clicks Edit on a row and the dropdown is displayed, how do I have the dropdown select the row's value from the list?

Similar to how the textbox is populated with:

Text='<%# Bind( "Notes") %>

What is the equivalent for dropdown?
My dropdown:
<telerik:RadDropDownList ID="rddlLocations" runat="server" DataSourceID="GetLocationsSqlDataSource" DataTextField="Location" DataValueField="ID"></telerik:RadDropDownList>

Attila Antal
Telerik team
 answered on 28 Nov 2018
1 answer
94 views

I am using a dropdownlist on a mobile browser, the page moves when i try to scroll through the items.

I can't use my finger to scroll. It's a long page.

<telerik:RadDropDownList ID="ddlState" runat="server" DropDownHeight="300" Width="260px" Skin="Silk" RenderMode="Lightweight">
 </telerik:RadDropDownList>

Marin Bratanov
Telerik team
 answered on 24 Aug 2018
11 answers
1.8K+ views
I am trying to get the value of selected item from a RadDropDownList using the below code snippet:
ddlEntType= '<%= rddlEnterprise.ClientID %>

but it is giving me "undefined" as the result.

Can you please provide the solution for this?
Tsvetomir
Telerik team
 answered on 08 Aug 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?