Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
1.9K+ views
Hi,

I have managed to show only month and year using RadDatePicker.
<telerik:RadDatePicker ID="radEndDatePicker" runat="server" Skin="Hay" Width="208px" AutoPostBack="true" OnSelectedDateChanged="radEndDatePicker_SelectedDateChanged">
                                            <DateInput ID="DateInput2" DateFormat="MMMM yyyy" runat="server" Enabled="true">
                                            </DateInput>
                                            <Calendar ID="Calendar2" runat="server">
                                                <FastNavigationSettings TodayButtonCaption="Current Month" OkButtonCaption="     OK    "/>
                                            </Calendar>
                                            <ClientEvents OnDateSelected="OnEndDateSelected" />
                                        </telerik:RadDatePicker>

Please help on following items:
1. I need a way to rearrange the months.
Currently months are rendered as shown in the attachment here. But I need to order months to be shown as :
Jan         Jul
Feb        Aug
Mar        Sep
Apr        Oct
May       Nov
Jun        Dec

I tried Orientation property of Calender but it didnt work.

2. I need to hide backward and forward buttons shown for year.
3. All three buttons showing Current Month, OK and Cancel are different, how can I adjust the height to make it all look aligned?
Please help asap.

Thanks.
Maria Ilieva
Telerik team
 answered on 27 Jan 2015
1 answer
275 views
Hi 

I have autogenerated columns showing dates as radgrid columns for a particular month 

eg 

                    01-Jan-15     02-Jan-15   03-Jan-15
xyz
abc
123

I should be able to click on the dates and refresh the data

Please help 

Thanks 
Raja
Eyup
Telerik team
 answered on 27 Jan 2015
2 answers
182 views
Hello,

I am having problem with radgrid on ie 11 and firefox 35.0. I had a radgrid that allowed user to double click and it will open radwindow. It is working fine on chrome. But nothing happened when user double click on row in ie and firefox. I found the below javascript error when I tried to debug.

SCRIPT28: Out of stack space
File: Telerik.Web.UI.WebResource.axd, Line: 11584, Column: 1

SCRIPT28: Out of stack space
File: Telerik.Web.UI.WebResource.axd, Line: 11580, Column: 52

But  it is  working fine when I use compatibility view on ie. To open radwindow user can also click once on row and click edit button outside of radgrid. This function is working fine. Only double click on row is not working. Kindly help me on this issues. 

I am using telerik version 2014.3.1209.40.

Thank you.
Best regards,
Ei Wai
Ei Wai
Top achievements
Rank 1
 answered on 27 Jan 2015
3 answers
578 views
Hi,

I am using the AjaxControlToolkit AutoCompleteExtender inside an ASP.NET AJAX RadGrid.  It works fine with the following code:

<script type="text/javascript" language="javascript">
    function GetDogID(source, eventArgs) {
        var DogIDTxt = document.getElementById('<%=DogIDTxt.ClientID%>');
        DogIDTxt.value = eventArgs.get_value();
    }
</script>
<telerik:GridTemplateColumn DataField="trialCode" HeaderText="trialCode"
            SortExpression="trialCode" UniqueName="trialCode">
            <EditItemTemplate>
                <asp:TextBox ID="trialCodeTextBox" runat="server" autocomplete="off" onKeyPress="KeyPress()"></asp:TextBox>
 <cc1:AutoCompleteExtender ID="trialCodeTextBox_AutoCompleteExtender" runat="server"
            DelimiterCharacters="" Enabled="True"
            ServicePath="/assets/webservice/DogList.asmx" TargetControlID="trialCodeTextBox"
            ServiceMethod="GetCompletionList" MinimumPrefixLength="2"
            CompletionSetCount="20" CompletionInterval="0" OnClientItemSelected="GetDogID"
        >
        </cc1:AutoCompleteExtender>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="trialCodeLabel" runat="server" Text='<%# Eval("trialCode") %>'></asp:Label>
            </ItemTemplate>
        </telerik:GridTemplateColumn>

I use a web service to pull a list of values from a database and all is well.

However...

I am using the OnClientItemSelected method (relatively new to AutoCompleteExtender so that I am able to pull back a value pair from the web service: 1.) the text value (which I'm displaying as 'autocomplete' in the RadGrid textbox while in edit mode and 2.) a primary key ID value of the item that i'm placing on a label control somewhere else on the page for now while i'm trying to figure out how to get it inside the RadGrid for use in updating.

What I need to do is be able to submit the update (or add a new record) from the RadGrid and use the primary key value on the page and NOT the text value pulled from the autocomplete.

The user needs to be able to select from a 'friendly' text-based list of about 3,000 items (hence, the need for autocomplete).  Then, once selected, the primary key (from the value pair that was returned from the web service) needs to be the value that the RadGrid inserts when making the update---not the text value as there could be duplicates.

Is this possible? 

Chris

Here's the web service i'm using:

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<System.Web.Script.Services.ScriptService()> _
Public Class DogList
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer) As String()
        Dim connString As String = ConfigurationManager.AppSettings("DataConnect2")
        Dim conn As New SqlConnection(connString)
        Dim mycommand As New SqlCommand
        Dim rs As SqlDataReader
        Dim items As New List(Of String)

        'we add the prefixText into our SQL query to retrieve the options
        'for our autocomplete
        Dim strsql As String = "SELECT registrationNumber, dogName + ' - #' + registrationNumber As 'TheDog' FROM Dogs WHERE dogName LIKE '" & Replace(prefixText, "'", "''") & "%' ORDER BY dogName ASC"
        mycommand.Connection = conn
        mycommand.CommandText = strsql

        Try
            conn.Open()
            rs = mycommand.ExecuteReader
            If rs.HasRows Then

                'we loop through the results adding each result to our list of
                'items
                Do While rs.Read
                    Dim thevalues As String = AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(rs("TheDog").ToString(), rs("registrationNumber").ToString())
                    items.Add(thevalues)
                Loop

            End If

        Catch ex As Exception
            items.Add(ex.ToString)
            ' this will show the exception in the autocomplete list if
            ' there are any errors
        Finally
            mycommand.Dispose()
            conn.Close()
            conn.Dispose()

        End Try
        Return items.ToArray ' we return our list of items as an array

    End Function




Suzy
Top achievements
Rank 2
 answered on 27 Jan 2015
3 answers
663 views
I am trying to use a control which will only allow users to select the Month and Year. BUT, I need to also not allow them to choose future dates based on todays date. I  am working in vb.net and had found this example, but cannot get it to work in vb. http://birenpanigrahi.blogspot.com/2013/11/radmonthyearpicker-validation-restrict.html

Any help would be greatly appreciated. I have also tried to use a RadDatePicker which I can restrict the future date based on todays date as the date changes, but I do not want the days to display for selection. If there is a way to only allow RadDatePicker to show Month and Year in the popup instead of Day, Months and Years, I would take that as well.

Thank you.
Vasil
Telerik team
 answered on 27 Jan 2015
2 answers
306 views
I'm trying to set the background color of the selected text area (ie: displayed when the drop down is closed) on the RadDropDownTree programmatically.

The screen has multiple RadDropDownTree controls, each of which the client can configure to be mandatory or optional, and when mandatory the client can also select for these to be displayed in a different color.   

Setting the dropdowntree.BackColor is not working (setting dropdowntree.EmbeddedTree.BackColor sets the drop down background which is not what we want).

I can set the area I need the background color applied to in the css with
.RadDropDownTree_WebBlue .rddtInner .rddtFakeInput
{
    background-image: none !important;
    background-color: White;
}

but need to do this on a control-by-control basis from the code behind.

Can you advise how I can go about this?
Nigel
Top achievements
Rank 1
 answered on 26 Jan 2015
4 answers
309 views
How remove the default toolbar in telerik:GridHTMLEditorColumn?
I just want to use my own buttons I create server side....
Kjell
Top achievements
Rank 1
Iron
Iron
 answered on 26 Jan 2015
5 answers
549 views
Hi Team,

I have a grid and it has some rows in it. I am implementing batch editing for this grid. I am using the DLL Version of 2014.3.1216.45

I need to implement duplicate record checking for this grid.

we have compartment index column in the grid. When the user clicks on add new record and he enter one for compartment index and second time also if he enter one for the compartment index and click on save changes button that time we need to check the duplicate record validation.


currently this duplicate checking I am doing it on the "OnBatchEditCellValueChanging" event of the grid.
But I need this implementation  when I click on save changes button.

Please see my code below.

<script type="text/javascript">

function valueChanging(sender, args) {

if (args.get_columnUniqueName() == "CompNo") {
var tableView = sender.get_masterTableView();
var batchManager = sender.get_batchEditingManager();
var items = tableView.get_dataItems();
var newValue = args.get_editorValue();
for (var i = 0; i < items.length; i++) {
var idCell = items[i].get_cell("CompNo");
var id = batchManager.getCellValue(idCell);
if (args.get_row() != items[i].get_element() && id == newValue) {
radconfirm(transMessages.SDP_ALERT_WHILE_UPDATE_LOAD_DETAIL, confirmCallBackFn);
}
}
}
}
</script>
<telerik:RadGrid ID="CompartmentLevelLoadRadGrid" runat="server" AutoGenerateColumns="false" CssClass="TransferGridPanel"
Height="233px" Width="475px" OnItemDataBound="CompartmentLevelLoadRadGrid_ItemDataBound" OnNeedDataSource="CompartmentLevelLoadingRadGrid_NeedDataSource"
OnBatchEditCommand="CompartmentLevelLoadRadGrid_BatchEditCommand" OnItemCreated="CompartmentLevelLoadRadGrid_ItemCreated">

<MasterTableView ShowHeadersWhenNoRecords="true" CommandItemDisplay="Top" EditMode="Batch" DataKeyNames="CompartmentIndex">
<CommandItemSettings ShowRefreshButton="false" AddNewRecordText="Add LineItem" />
<BatchEditingSettings EditType="Cell" />

<Columns>
<telerik:GridTemplateColumn HeaderText="Comp No." HeaderStyle-Width="30px" UniqueName="CompNo" DataField="CompartmentIndex">
<ItemTemplate>
<%# Eval("CompartmentIndex") %>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox runat="server" ID="ddlCompartment" OnLoad="ddlLoadCompartments" Width="50px" EmptyMessage="-Select-">
</telerik:RadComboBox>
<asp:RequiredFieldValidator ID="compartmentRequiredFieldValidator"
ControlToValidate="ddlCompartment" ErrorMessage="Compartment Required" runat="server" Display="Dynamic">
</asp:RequiredFieldValidator>
</EditItemTemplate>
</telerik:GridTemplateColumn>

<telerik:GridTemplateColumn HeaderText="PriorTo Load" HeaderStyle-Width="30px" UniqueName="PriorToLoad" DataField="PTL">
<ItemTemplate>
<%# Eval("PTL") %>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadNumerictextbox runat="server" ID="txtPTL" Width="50px" NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator="" MinValue="0" MaxValue="999999999">
</telerik:RadNumerictextbox>
<asp:RequiredFieldValidator ID="PTLRequiredFieldValidator"
ControlToValidate="txtPTL" ErrorMessage="PTL is Required" runat="server" Display="Dynamic">
</asp:RequiredFieldValidator>
</EditItemTemplate>
</telerik:GridTemplateColumn>

<telerik:GridTemplateColumn HeaderText="Planned Product" HeaderStyle-Width="50px" UniqueName="PlannedLoadProd" DataField="PlannedProductName" ReadOnly="true" InsertVisiblityMode="AlwaysVisible">
<ItemTemplate>
<%# Eval("PlannedProductName") %>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox runat="server" ID="ddlPlannedProduct" OnLoad="ddlPlannedProductLoad" Width="70px" EmptyMessage="-Select-">
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="ActualProductName" HeaderText="Actual Product" UniqueName="ActualLoadProd" HeaderStyle-Width="50px" >
<ItemTemplate>
<%# Eval("ActualProductName") %>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox runat="server" ID="ddlActualProduct" OnLoad="ddlActualProductLoad" Width="70px">
</telerik:RadComboBox>
<asp:RequiredFieldValidator ID="actualProductValidator"
ControlToValidate="ddlActualProduct" ErrorMessage="ActualProd is Required" runat="server" Display="Dynamic">
</asp:RequiredFieldValidator>
</EditItemTemplate>
</telerik:GridTemplateColumn>

<telerik:GridTemplateColumn DataField="PlannedQuantity" HeaderText="Planned Quantity" UniqueName="PlannedLoadQty" HeaderStyle-Width="50px" ReadOnly="true" InsertVisiblityMode="AlwaysVisible">
<ItemTemplate>
<%# Eval("PlannedQuantity") %>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadNumerictextbox runat="server" ID="txtPlannedQuantity" Width="60px" NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator="" MinValue="0" MaxValue="999999999">
</telerik:RadNumerictextbox>
</EditItemTemplate>
</telerik:GridTemplateColumn>

<telerik:GridTemplateColumn DataField="ActualQuantity" HeaderText="Actual Quantity" UniqueName="ActualLoadQty" HeaderStyle-Width="50px">
<ItemTemplate>
<%# Eval("ActualQuantity") %>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadNumerictextbox runat="server" ID="txtActualQuantity" Width="60px" NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator="" MinValue="0" MaxValue="999999999">
</telerik:RadNumerictextbox>
<asp:RequiredFieldValidator ID="actualQuantityValidator"
ControlToValidate="txtActualQuantity" ErrorMessage="ActualQty is Required" runat="server" Display="Dynamic">
</asp:RequiredFieldValidator>
</EditItemTemplate>
</telerik:GridTemplateColumn>

</Columns>
</MasterTableView>
<ClientSettings>
<ClientEvents OnBatchEditCellValueChanging="valueChanging" />
</ClientSettings>

</telerik:RadGrid>         
                    
                    
Regards,
Sudhakar.
        
 


    


          
Angel Petrov
Telerik team
 answered on 26 Jan 2015
1 answer
248 views
So here is what I have today.  A menu that the user allows to open, inside of this I want them to be able to be able to search for an item, display some simple information about what was searched for.  If they want to see the full record there will be a link to send them to that record.  My issue is when I use the searchbox, the moment I select something it causes the menu to close.  If I open up the menu again, everything is there.  Here is my code thus far:

<asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>

<telerik:RadMenu runat="server" ID="RadMenu1" Skin="Default" EnableShadows="true" BackColor="Green" ClickToOpen="true">
<Items>
<telerik:RadMenuItem PostBack="false" ImageUrl="/includes/images/menuSearch.png">
<ContentTemplate>
<div id="CatWrapper" class="Wrapper" style="width: 635px; height: 600px;">
<div style="width: 425px;">
SEARCH FOR ASSET
</div>

<telerik:RadSearchBox runat="server" ID="RadSearchBox1"
CssClass="searchBox" Skin="Silk"
Width="460" DropDownSettings-Height="300"
DataSourceID="sqlSearch"
DataTextField="description"
DataValueField="assetID"
DataKeyNames="asset_num,location,cost"
EmptyMessage="Search By Description"
Filter="StartsWith"
MaxResultCount="20"
OnSearch="RadSearchBox1_Search">
</telerik:RadSearchBox>

<div>
<asp:Label runat="server" ID="lblAsset" />
</div>
</div>

<asp:SqlDataSource ID="sqlSearch" runat="server" ConnectionString="<%$ ConnectionStrings:dbAll %>"
SelectCommand="SELECT * FROM assetMain"></asp:SqlDataSource>

</ContentTemplate>
</telerik:RadMenuItem>
</Items>
</telerik:RadMenu>

</ContentTemplate>
</asp:UpdatePanel>
Ivan Danchev
Telerik team
 answered on 26 Jan 2015
1 answer
200 views
How do I style the dragged item when using drag-and-drop with a RadTreeList? I am currently doing this by setting the OnItemDragging client event to call a Javascript function, then having that function call args.get_draggedContainer(), then setting the classname for the result, but it seems like there should be a simpler way. Is there a property I can set that will control the CSS class of a dragged item?
Eyup
Telerik team
 answered on 26 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?