Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
59 views
We were using this code to set a value in the editor from a custom dialog:

Telerik.Web.UI.Editor.CommandList["BackgroundImage"] = function (commandName, editor, commandArgs) {
        var argument = Telerik.Web.UI.Editor.CommandList._getLinkArgument(editor);
        Telerik.Web.UI.Editor.CommandList._getDialogArguments(argument, "A", editor, commandName);
        var callbackFunction = Telerik.Web.UI.Editor.CommandList.getCallbackFunction(commandArgs, function (sender, args) {
            if (!args) {
                //alert("No args!");
                return false;
            }
 
            var selectedItem = args.get_value();
 
            var path = args.value.getAttribute("src", 2);
            var style = editor.get_contentArea().style;
            style.backgroundImage = 'url(' + path + ')';
            document.getElementById('<%=hdnBackgroundImage.ClientID %>').value = path;
 
        });
        editor.showDialog("backgroundImageManager", argument, callbackFunction);
        return false;
    };

We upgraded to the latest Rad tools and now get an error on "args.value.getAttribute is not a function".

What can we change to get that path value from the dialog?
Ianko
Telerik team
 answered on 03 Apr 2014
3 answers
158 views
Hi All

I've a radgrid displaying a list of customers. In the grid, I have a command button that's supposed to open a popup editor to add new customers. For some reason, the popup does not open. It shows a small flicker and nothing happens. Strangely enough, if I go into the database, manually add a customer record and refresh the grid, I'm able to open the editor.

Any help is most welcome!

Here is the grid definition in my ascx:
========================================
<telerik:RadGrid ID="CustomerList" runat="server"
    GroupingEnabled="False" ShowStatusBar="True" OnPreRender="CustomerList_PreRender"
    DataSourceID="CustomerDataSource"
    OnItemCommand="CustomerList_ItemCommand" OnItemDataBound="CustomerList_ItemDataBound"
    OnInsertCommand="CustomerList_InsertCommand" OnItemInserted="CustomerList_ItemInserted"
    OnItemEvent="CustomerList_ItemEvent" >
 
    <MasterTableView DataKeyNames="CustomerId" DataSourceID="CustomerDataSource" 
        AllowPaging="true" AutoGenerateColumns="False"
        GridLines="None" EditMode="PopUp" ShowFooter="True"
        InsertItemDisplay="Bottom" CommandItemDisplay="TopAndBottom" >
        <CommandItemSettings  AddNewRecordText="Add Customer" />
        <Columns>
            <telerik:GridBoundColumn DataField="CustomerId" DataType="System.Int32" FilterControlAltText="Filter CustomerId column" HeaderText="CustomerId" ReadOnly="True" SortExpression="CustomerId" UniqueName="CustomerId">
                <ColumnValidationSettings>
                    <ModelErrorMessage Text="" />
                </ColumnValidationSettings>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="CustomerName" FilterControlAltText="Filter CustomerName column" HeaderText="CustomerName" SortExpression="CustomerName" UniqueName="CustomerName">
                <ColumnValidationSettings>
                    <ModelErrorMessage Text="" />
                </ColumnValidationSettings>
            </telerik:GridBoundColumn>
 
 
            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
                <ItemStyle Width="20px" Font-Underline="true" />
            </telerik:GridEditCommandColumn>
 
        </Columns>
        <NoRecordsTemplate>
            No customers have been created yet.
        </NoRecordsTemplate>
        <EditFormSettings EditFormType="WebUserControl" CaptionDataField="CustomerName"
            UserControlName="~/UserControls/CustomerEditor.ascx"
            >
            <EditColumn UniqueName="EditCommandColumn" HeaderButtonType="TextButton">
            </EditColumn>
            <PopUpSettings ScrollBars="None" Width="581"/>
        </EditFormSettings>
        <PagerStyle Mode="NextPrevAndNumeric" Position="Bottom" />
    </MasterTableView>
</telerik:RadGrid>
Viktor Tachev
Telerik team
 answered on 03 Apr 2014
1 answer
66 views
Hi All,
I am completely new to AJAX.
This is the first program I have come across and I must say I am confused..

Few of my queries are below:

I wrote below code in a notepad and saved as html. But I don't know where to place the "ajax_info.txt" file. It dint work when I placed it in the same folder as the .html file
Also I don't understand and which response are we collecting through xmlhttp.responseText. Because its only on the next line (xmlhttp.open("GET","ajax_info.txt",true) that we actually mention the url/path to which we are trying to connect. So whom are we trying to get response from in : xmlhttp.open("GET","ajax_info.txt",true

I know its tooooo basic but just cant get a hold of it.



<!DOCTYPE html>
<html>
<head>
<script>
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","ajax_info.txt",true);
xmlhttp.send();
}
</script>
</head>
<body><div id="myDiv"><h2>Let AJAX change this text</h2></div>
<button type="button" onclick="loadXMLDoc()">Change Content</button></body>
</html>
Konstantin Dikov
Telerik team
 answered on 03 Apr 2014
6 answers
162 views
I have a master page with many pages and usercontrols.

I have made great use of RadAjaxManager & proxies on my pages and user controls, however, there are a few events in the master page itself.  Since we can only have a single RadAjaxManager on a given rendered page, I cannot place a RadAjaxManager on the master page or I will have to move up all the RadAjaxManager and the OnAjaxRequest events up as well, which is not doable.  Further, the OnAjaxRequest needs to be placed in the Manager and not the proxy, which further makes moving to a single manager on the master page not achievable.

How can I leverage a RadAjaxLoadingPanel on the master page for it's events based on this scenario

Thanks in advance 
Daniel
Top achievements
Rank 1
 answered on 03 Apr 2014
0 answers
73 views
Hi
I use DataAccess 2014 in my project. In Controller everythning is ok but when I want show data in view I get this error:

Compiler Error Message: CS0012: The type 'Telerik.OpenAccess.SPI.dataobjects.PersistenceCapable' is defined in an assembly that is not referenced. You must add a reference to assembly 'Telerik.OpenAccess, Version=2014.1.225.2, Culture=neutral, PublicKeyToken=######'.

I added <assemblies> in web.config but can't solve my problem.
Saeid
Top achievements
Rank 1
 asked on 03 Apr 2014
1 answer
155 views
I have a radcombobox CheckBoxes="True" and AutoPostBack="True" because I need server side code to execute after the user makes her selections. However, the postback is occurring every time a user checks a box and then it closes the combobox. The user wants the combobox to stay open and I don't want the postback to occur until the user is finished and clicks off of the combobox. I am experimenting with using the combobox's OnClientBlur event and then doing a postback like this:                 __doPostBack(objName, "ItemChecked"); But I'm struggling to get it to work and not confident that's the right path.
Princy
Top achievements
Rank 2
 answered on 03 Apr 2014
2 answers
64 views
Hi, i tried this snipet 

function getItemIndexHierarchical() {
var grid = $find("<%=RadGrid1.ClientID %>");
var masterTableView = grid.get_masterTableView();
var dataItems = masterTableView.get_dataItems();
alert(dataItems[0].get_itemIndexHierarchical());
}

And it throws javascript exception ; 

Jayesh Goyani
Top achievements
Rank 2
 answered on 03 Apr 2014
6 answers
599 views
Hi,

Why is it not possible to hide the label during edit mode?
For instance, in the following code, "lblInvoiceDetailID" is not hidden even when visible property is set to false in edit mode....



<telerik:GridTemplateColumn DataField="InvoiceDetailID" HeaderText="InvoiceDetailID" UniqueName="InvoiceDetailID" Display="False">
                        <ItemTemplate>
                            <asp:Label ID="lblInvoiceDetailID" runat="server" Text='<%# Bind("InvoiceDetailID") %>'  Visible="false"> </asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtInvoiceDetailID" Text='<%# Bind("InvoiceDetailID") %>'  runat="server" ReadOnly="true" Visible="false"></asp:TextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>

Any help is highly appreciated.

Many thanks.

Milan G
Princy
Top achievements
Rank 2
 answered on 03 Apr 2014
2 answers
113 views
Hi,

We are using telerik grid where we display data entered by our users. We  have set fixed column widths and enabled  wrap.

What  happens is if there is a word w/o space it does not wrap,  rather it gets cut while being displayed.

What  is the solution  for this - e.g. any grid tools wraps data automatically 


Thanks 

Anand
Fabio
Top achievements
Rank 1
 answered on 02 Apr 2014
12 answers
229 views
Hi,

i am facing a really trival problem but i am not able to sort this out. I am sure, anyone of you guys can give me a clue!
I have a dock zone that contains 4 docks.
On the initial load all dock are collapsed.
There are some other controls on that page that expand one of the described docks for showing information.

My issue is really simple. At one time, i want to have just one dock expanded. So if another controls expands i.e. dock2, all other docks shall be collpased.

At the moment i am trying the figure this out by using the OnClientComment event to do the necessary stuff, but with no avail.

Thanks a lot..
Marc
Slav
Telerik team
 answered on 02 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?