Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
86 views
I am having issues with the back button when using the combo box.

In Chome when I select item one, click off the combo box, then select item one and two, click off the combo box and then hit the browser back button, it shows one in the text but one and two checked.

In IE, with the same steps, it shows one is checked but one and two as the selected text.

How would you suggest having the back button return the combo box return to the previous state where the checked items and selected text match - either in the example or with an update panel?

Thanks in advance for any help.

Here is the code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="del.aspx.cs" Inherits="del" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
     
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager" runat="server"></telerik:RadScriptManager>
        <div>                
             
            <telerik:RadComboBox ID ="ddlCounty" runat="server" DataSourceID="LDS" OnSelectedIndexChanged="ddlCounty_SelectedIndexChanged" DataTextField="name" DataValueField="value" CheckBoxes="true" AutoPostBack="true" EnableViewState="true"></telerik:RadComboBox>
            <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">LinkButton</asp:LinkButton><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
                                       
             
        </div>
        <asp:linqdatasource runat="server" id="LDS" OnSelecting="Selecting_LDS" OnSelected="OnSelecting_LDS"></asp:linqdatasource>
    </form>
</body>
 
</html>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Threading;
using System.IO;
 
public partial class del : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
     
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
    }
 
    protected void Selecting_LDS(object sender, LinqDataSourceSelectEventArgs e)
    {
        var l = new List<Object>()
        {
            new {value = 1, name = "one"},
            new {value = 2, name = "two"},
            new {value=3, name = "three"}
        };
 
        e.Result = l;
    }
 
 
    protected void ddlCounty_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
    {
        string[] result = (from i in ddlCounty.CheckedItems
                            select i.Value).ToArray<string>();
        Label1.Text = string.Join("-", result);
       
    }
    protected void OnSelecting_LDS(object sender, LinqDataSourceStatusEventArgs e)
    {
    }
}
Dimitar Terziev
Telerik team
 answered on 01 Mar 2013
4 answers
486 views
I have a radcombobox in a grid.. .And after the onSelectedIndexChanged event is fired on the client side I would like to hide the combobox...

function onSelectedIndexChanged(sender, eventArgs) {
          var selectedItem = eventArgs.get_item();
                 // I do some stuff with the selected item...
        //  Now I would like to hide this radcombobox in the radgrid row...
 
          sender.set_visible(false);   // This did not work...
}
This is the GridTemplateColumn the control resides in:
<telerik:GridTemplateColumn HeaderText="Actions" UniqueName="Actions" AllowFiltering="false"
                      Visible="true">
                      <ItemTemplate>
                          <asp:Label ID="ActionLabel" runat="server" Text="" Visible="false" />
                       <telerik:RadComboBox ID="RadComboBoxActions" runat="server" EmptyMessage="Select Action..."
                              AutoPostBack="true" Width="155px" OnClientSelectedIndexChanged="onSelectedIndexChanged" />
                      </ItemTemplate>
                      <ItemStyle Width="155px" />
                  </telerik:GridTemplateColumn>
Wired_Nerve
Top achievements
Rank 2
 answered on 01 Mar 2013
1 answer
107 views
I am working on a grid that functions very similarly to the demo Client Edit with Batch Server Update:
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/clienteditbatchupdates/defaultcs.aspx

Everything works fine in IE, but in firefox I get the error:

Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 0

http://localhost/wps16/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a7263e9c6-5962-41bc-b839-88b704bfcf0d%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2012.3.1308.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a847349a7-61ac-4c43-803e-aa1cc5b6cced%3a16e4e7cd%3af7645509%3a24ee1bba%3a2003d0b8%3ae330518b%3a1e771326%3ac8618e41%3af46195d3%3aaa288e2d%3ab7778d6c%3aed16cbdc%3ae085fe68%3ac08e9f8a%3a1bb784d4%3a58366029
Line 15

This occurs during the ProcessChanges(). The break point at the beginning of RadAjaxManager1_AjaxRequest() is never reached so i assume it fails somewhere during the transfer of information. The strange part is if i place a break point in ProcessChanges() and RadAjaxManager1_AjaxRequest() and step through line by line everything works. I am not sure if it is the grid or the rad ajax manager causing the problem. Are there any suggestions to what is happening and how to avoid it?
Maria Ilieva
Telerik team
 answered on 01 Mar 2013
2 answers
136 views
How can I add validation to my asyncupload control for the current version of Telerick Q3 2012 SP1?  I've tried the following but it is not working with the current version.  I very well could be doing something wrong.  Any thoughts on how to make this work?  Here is the code that I'm using, followed by the error I'm getting.  I'm in VS 2012 and using DotNet 4.5.

<script type="text/javascript">
    Telerik.Web.UI.RadAsyncUpload.prototype.getUploadedFiles = function() {
        var files = [];
 
        $telerik.$(".ruUploadSuccess", this.get_element()).each(function(index, value) {
            files[index] = $telerik.$(value).text();
        });
 
        return files;
    }
 
    function validateUpload(sender, args) {
        var upload = $("RadAsyncUpload1");
        args.IsValid = upload.getUploadedFiles().length != 0;
    }
 
</script>

<asp:CustomValidator runat="server" ID="CustomValidator" ClientValidationFunction="validateUpload"
        ErrorMessage="Select at least a single file">
    </asp:CustomValidator>



Here is the error:

Microsoft JScript runtime error:  Object doesn't support this property or method.

Thanks,

shawn

Shawn
Top achievements
Rank 1
 answered on 01 Mar 2013
2 answers
87 views
Hi all,
I am manually binding a RadGrid to an IList of custom objects using the NeedsDataSource event handler.....working great as long as i have a singleton property for each column that i want to display. Where i am a little confused is how to deal with a Function that returns a list of other values.

In my case, the custom object being bound to has a Function that returns a Dictionary<int,double>.....often only 1 entry, but sometimes up to 3.

What I want to have is a column that displays all the keyvalue pairs, with some formatting.

So, if the custom object had properties like this:
ID =  1
Name = "Object1 Name"
Balances = <1,100>, <2,200>, <3,300>

I would want 3 columns in my grid to look sort of like this:

ID      Name                               Balances
---------------------------------------------------------------------
1        Object1 Name                   ID: 1 contributed $100
                                                 ID: 2 contributed $200
                                                 ID: 3 contributed $300

I am sure it shouldn't be too hard, but i am not really sure how to do it.

Any advice would be greatly appreciated.

Paul


Paul
Top achievements
Rank 1
 answered on 01 Mar 2013
6 answers
166 views
I've cookbooked a couple of tooltip popups based on your demos.   These appear when I hover over one cell of the RadGrid. The original one was based on http://www.telerik.com/community/code-library/aspnet-ajax/grid/integrating-radtooltipmanager-with-radgrid.aspx.  This was enough for a simple display grid with no filtering or paging.  

When I tried to implement a similar scheme on my far more complex main grid, the popup started displaying data for the wrong record.
This was solved by adding the  RadToolTipManager1.TargetControls.Clear() call to the ItemCommand.  This is fired for the Filter, Page, Sort, and RebindGrid commands.

Everything is working as desired now except for one matter.  

This grid is a standard header/detail arrangement.  If I expand any of the details, the popup stops working.

Suggestions?

Boris
Top achievements
Rank 1
 answered on 01 Mar 2013
1 answer
67 views

I'm new to telerik controls.

I'm using following code to Update my controls asyncronously.

Below is my code:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID =  "RadAjaxLoadingPanel1">

    <AjaxSettings>
        <telerik:AjaxSetting EventName="OnSelectedIndexChanged" AjaxControlID="grd_optnandprcng">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Req_items"></telerik:AjaxUpdatedControl>                    
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>


as my code shows, i just want to update control Req_items (rad gridview) only on OnSelectedIndexChanged event of grd_optnandprcng (rad gridview).

But its not working. Its updating control on every event of radgridview.

Anyone have any idea to resolve this issue. Thanks.

Kostadin
Telerik team
 answered on 01 Mar 2013
2 answers
87 views
When the user clicks the 'New Row' button from the grid's command bar, I'd like to create the row, put it in edit mode, and set focus to the new row's first field.

I've gotten the new row created and put in edit mode but I cannot get it to put the cursor in the edit controls for the row (I have to click inside them to get it started, from that point Tab gets me from field to field and Enter commits as expected).  Is there an example out there on how to do this that I've missed?
J
Top achievements
Rank 1
 answered on 01 Mar 2013
1 answer
67 views
Using SQLDataSource, so please provide a solution with this rather than an alternative unless it cannot be done. Thanks

TableA and TableB from the same database

My "ItemsRequested" for the combobox has this string setup and it works fine.

Dim sql as string = "SELECT TOP 10 B.serialnumber,  A,column, B,Column FROM DB.dbo.TableA A, DB.dbo.TableB B Where B.column LIKE'" + e.Text + "%' and B.column!='CL' order by B.column"

My problem is on the "ItemBound" method.

e.Item.Text = e.Item.Attributes("column") + ", "+e.Item.Attributes("column") + ", " +e.Item.Attributes("column")

The column name has to be the colum from TableB.  In other words  B.Colmn.
Putting in B.Column of course won't work as follows...
e.Item.Text = e.Item.Attributes("B.serialnumber") + ", "+e.Item.Attributes("column") + ", " +e.Item.Attributes("column")

So with this join involved how do a pull this information specifically from the joined table column? B.Column

Thanks!
Hristo Valyavicharski
Telerik team
 answered on 01 Mar 2013
1 answer
198 views
Is it possible for the CaptionDataField to contain more than one field?  

I had thought to set up the CaptionFormatString with something like "This is {0} of {1}" with the CaptionDataField = "Field1, Field2" but this crashes the grid everytime.

(Both of the fields I tried to use are defined in the DetailTables GridTableView DataKeyNames.)
Jayesh Goyani
Top achievements
Rank 2
 answered on 01 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?