Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
157 views
I am trying to set SelectedIndex -1 with the objective that I don't any item in the RadCombo to be highlighted. Whilst the debugger passes the line the next statement says SelectedIndex 0.

How to make the RadCombo not to select any particular item automatically?
Princy
Top achievements
Rank 2
 answered on 16 Nov 2011
2 answers
172 views
Hi

I have a radgrid that uses in place editing (EditMode = InPlace). The radgrid also allows the user to click a button to turn on the filtering by column.

I don't want the edit row and search rows to both appear on the grid at the same time because it might confuse people as they both look similar.

I've been able to remove the filter row when the add new record button is pressed, but I can't seem to do the reverse? The filter button turns on filtering using the ItemCommand event, it's here that I want to turn off the edit row.

Can anyone advise me on how to do this please?

Thanks
Corina
Top achievements
Rank 1
 answered on 16 Nov 2011
1 answer
119 views
I had a requirement to set my description field to the uploaded filename. I used the additional field example supplied by Telerik.
Here is how I set that value:

<telerik:radupload id="RadUpload1" runat="server" onclientadded="addTitle" onclientfileselected="uploadFileSelected" />

<script type="text/javascript" language="javascript">
    function uploadFileSelected(sender, args) {
        var currentIndex = sender._currentIndex - 1;
        fileNameTextBox = $get('<%= RadUpload1.ClientID %>' + 'Desc' + currentIndex);
        var inputValue = args.get_fileInputField().value;
        var fileName = inputValue.substring(inputValue.lastIndexOf("\\") + 1);

        fileNameTextBox.value = fileName;
    }

    function addTitle(radUpload, args) {
        var curLiEl = args.get_row();
        var firstInput = curLiEl.getElementsByTagName("input")[0];

        //Create a simple HTML template.
        var table = document.createElement("table");
        table.className = 'AdditionalInputs';

        //A new row for a Title field
        row = table.insertRow(-1);
        cell = row.insertCell(-1);
        var input = CreateInput("Title", "text");
        input.className = "TextField";
        input.id = input.name = radUpload.getID(input.name);
        var label = CreateLabel("Title", input.id);
        cell.appendChild(label);
        cell = row.insertCell(-1);
        cell.appendChild(input);

        //A new row for a Description field
        row = table.insertRow(-1);
        cell = row.insertCell(-1);

        input = CreateInput("Desc", "text");
        input.className = "TextField";
        input.id = input.name = radUpload.getID(input.name);
        label = CreateLabel("Description", input.id);
        //label.innerHTML = firstInput.valueOf;
        cell.appendChild(label);
        cell = row.insertCell(-1);
        cell.appendChild(input);

        //Add a File label in front of the file input
        var fileInputSpan = curLiEl.getElementsByTagName("span")[0];
        var firstNode = curLiEl.childNodes[0];
        label = CreateLabel("File", radUpload.getID());
        curLiEl.insertBefore(label, firstNode);

        curLiEl.insertBefore(table, label);
    }
</script>

Peter Filipov
Telerik team
 answered on 16 Nov 2011
2 answers
117 views
Hi, I wonder id it's possible to do, achive the following:
Having a filledFilter(filledFilter.png) and saving settings want to save only the structure (cleanfilter.png).

Thanks.
VitorBarao
Top achievements
Rank 1
 answered on 16 Nov 2011
7 answers
222 views
I attached you a file!

by default - Localization-Add text is "Add"
i want to rename it to "Add New Attachment", but when i renamed it the width of this button is still the same?
how can I make this right?
Bozhidar
Telerik team
 answered on 16 Nov 2011
2 answers
86 views
Dir Telerik.

can someone  tell me where on this is site i can download the dll especially v. 2010.2.286.40
My object cannot reference them anymore

Regards
Stuart Hemming
Top achievements
Rank 2
 answered on 16 Nov 2011
2 answers
1.0K+ views
Hi,

How can I change DataBinder.Eval to Container.DataItem)["Value"] if grid is binding from data table.

<%#((System.Data.DataRowView)Container.DataItem)["Value"] %> is working fine in ItemTemplate but not in EditItemTemplate.


line of code which is not working.

 <EditItemTemplate>
<asp:TextBox ID="txtRestrictValue" runat="server" MaxLength="200" Text='<%#((System.Data.DataRowView)Container.DataItem)["Value"] %>'></asp:TextBox>
</EditItemTemplate>

it gives following error:
Unable to cast object of type 'Telerik.Web.UI.GridInsertionObject' to type 'System.Data.DataRowView'.

Warm Thnaks
Reyaz
Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Nov 2011
2 answers
121 views
I have a grid with a formtemplate. The formtemplate has 4 buttons: Save (CommandName="Update"), Cancel (CommandName="Cancel"), GoToStart (OnClick="btnGoToStart_Click"), PrintToPdf (OnClick="btnPrintToPdf_Click"). As you can see 2 of the buttons perform a grid command, and 2 of the buttons has their own click events. After clicking the Save button or Cancel button, the grid does exactly what's expected. But, if I click on Save, and then click on GoToStart or PrintToPdf buttons, they do not enter theis events, but acts like the Cancel button. What am I missing here?
Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Nov 2011
10 answers
358 views
Hi,

My field datatype is System.Decimal. When page culture is en-US, filtering is works but when page culture is tr-TR - decimalseperator is ',' (comma) - filtering is not working. I'm getting - ')' or operator expected - javascript error.

Why can this be, any suggestions?
Wiktor
Top achievements
Rank 1
 answered on 16 Nov 2011
6 answers
218 views
Hello,

I have a page where I am using tooltips to change items like this:

Contact E-mail: me@somewhere.com   change  <--clicking change brings up a tooltip with the textbox to change the e-mail address.

I have a conundrum.  Using the tooltip with RenderInPageRoot set to false, my tooltip will appear in the incorrect position, then "jump" up next to the element. This is due to the way my styles are defined, and unfortunately I cannot change them.  However, ajax postbacks work great in this scenario.

However, if I use RenderInPageRoot=true, the tooltip shows up perfectly next to the element, but then I get the behavior where Ajax will work on the first postback, not on the next, then again on the next.  So it alternates between partial and full postbacks.

Here is a snippet of the code:

<div class="block append-bottom-sm">
            <div class="span-6"> 
                <asp:Label ID="lblContactEmailTitle" runat="server" Text="Contact E-mail:" AssociatedControlID="lContactEmail" /> 
            </div>
            <div class="span-5"> 
                <asp:Label ID="lContactEmail" runat="server"></asp:Label> 
                <telerik:RadToolTip runat="server" ID="radttContactEmail" HideEvent="FromCode" Position="MiddleLeft" 
                    Width="250px" Height="70px" Animation="Slide" ShowEvent="OnClick"  ShowDelay="0"  RenderInPageRoot="true" 
                    RelativeTo="Element" TargetControlID="lbContactEmail"> 
 
                    <asp:Label ID="Label5" runat="server">Please enter your Contact Email:</asp:Label> 
                    <br /> 
                    <asp:TextBox ID="tbContactEmail" runat="server" ValidationGroup="ContactEmailValidationGroup"></asp:TextBox> 
                   <br /> 
                    <asp:RegularExpressionValidator  ID="revContactEmail" runat="server" ValidationGroup="ContactEmailValidationGroup" Display="Dynamic" 
                    ValidationExpression="^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$" 
                    ControlToValidate="tbContactEmail">The Contact Email must have a valid format.</asp:RegularExpressionValidator>                   
                     
                    <asp:LinkButton ID="lbContactEmailSave" runat="server" ValidationGroup="ContactEmailValidationGroup">Save</asp:LinkButton> 
                    <asp:LinkButton ID="lbContactEmailCancel" runat="server" ValidationGroup="" CausesValidation="false" OnClientClick="HideTooltip(); return false;">Cancel</asp:LinkButton> 
                </telerik:RadToolTip> 
            </div> 
            <div class="span-3"> 
                <asp:LinkButton ID="lbContactEmail" runat="server" OnClientClick="SetContactEmail();">Change</asp:LinkButton> 
            </div> 
        </div> 

Here is the AjaxManager setup (pnlContactInfo surrounds all the code that you see in the snippet above):
<telerik:RadAjaxLoadingPanel ID="radalp" runat="server" BackgroundPosition="Center" Skin="Default" /> 
        <telerik:RadAjaxManager ID="radam" runat="server" EnablePageHeadUpdate="false" DefaultLoadingPanelID="radalp" > 
            <AjaxSettings>                 
 
                <telerik:AjaxSetting AjaxControlID="lbContactEmailSave"> 
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="pnlContactInfo" /> 
                         
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
 
            </AjaxSettings> 
        </telerik:RadAjaxManager>  


Here is the javascript function that is called when the user clicks the "Change" button:

 function SetContactEmail() { 
        document.getElementById('<%=tbContactEmail.ClientID%>').value = document.getElementById('<%=lContactEmail.ClientID%>').innerHTML; 
        Page_ClientValidate('ContactEmailValidationGroup'); // Erase any message which may have been displayed the last time after a Cancel was clicked. 
    } 


And here is the code-behind that is happening on save:

 Private Sub lbContactEmailSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbContactEmailSave.Click 
        Dim VZID As String = hidVZID.Value 
        Dim newEmail As String = tbContactEmail.Text 
        Dim SQL As String = 'some sql here... 
        Dim myData As New clsData() 
        myData.ExecuteSQL(SQL, CommandType.Text) 
        lContactEmail.Text = newEmail 
    End Sub 


Any help would be greatly appreciated.

Thanks,
Gene

Marin Bratanov
Telerik team
 answered on 16 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?