Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
50 views
I am receiving records from a web service that are displayed in a
RadGrid. I need to mark certain records as selected based on the
existence of matching records in a database table. The records in
the table were produced from the web service at one time and contain
only matching records. The records are matched via the "AccDesc"
DataKeyNames. Any suggestions would be appreciated.

<
radControls:RadGrid ID="AccessoriesGrd" runat="server" Width="780px" AllowMultiRowSelection="true" Visible="true">
<MasterTableView DataKeyNames="AccDesc, Retail, TradeIn" AutoGenerateColumns="false" EnableHeaderContextMenu="true">
<Columns
<radControls:GridClientSelectColumn HeaderText="Select" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="55px" UniqueName="SelectColumn" ItemStyle-VerticalAlign="Top" />
<radControls:GridBoundColumn DataField="AccDesc" AllowSorting="true" HeaderText="Description" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="350px" ItemStyle-VerticalAlign="Top" />
<radControls:GridTemplateColumn HeaderText="Retail" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="55px" SortExpression="Retail" ItemStyle-HorizontalAlign="Right" ItemStyle-VerticalAlign="Top">
<ItemTemplate>
<%#Consumers.StandardFunctions.FormatCurrency(Eval("Retail"))%>
</ItemTemplate>
</radControls:GridTemplateColumn
<radControls:GridTemplateColumn HeaderText="Trade-In" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="55px" SortExpression="TradeIn" ItemStyle-HorizontalAlign="Right" ItemStyle-VerticalAlign="Top">
<ItemTemplate>
<%#Consumers.StandardFunctions.FormatCurrency(Eval("TradeIn"))%>
</ItemTemplate>
</radControls:GridTemplateColumn
</Columns>                  
</MasterTableView>
<ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="true" ColumnsReorderMethod="Reorder">
<Selecting AllowRowSelect="true" />
</ClientSettings>
</radControls:RadGrid>

 

Mira
Telerik team
 answered on 07 Mar 2011
1 answer
75 views

Hello

I'm having a bit of a problem with an AJAX update from within a RadTree, I've had a look around the forums and can't find a proper answer to my prolem although I have stumbled across a couple of posts that given me a couple of ideas. Anyway, here is my problem, I hope someone can help.

What I'm effectivly trying to do is differentiate between clicking on a node in a RadTreeVew (to update the main panel) and dragging a node in a RadTreeView (to update a graph) during an AJAX update, unfortuately it seems that the EventName property of the RadAjaxManager AjaxSetting does not work as mentioned in this post (http://www.telerik.com/community/forums/aspnet-ajax/ajax/ajax-manager-event-filter.aspx)  reading on on this post Nicholas Walker (10th post) suggests a workaround in which you use the OnClientNodeClicked and OnClientNodeDropped properties of the RadTreeView to fire some JavaScript which modifies(?) the RadAjaxManager. I can get one or the other to work and I'm not really sure how the JavaScript fits in, ideally for one or the other, I want to disable the opposite manager update but I'm not sure how this could be done with javascript, or whether it could be done at all.
 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
     <AjaxSettings>
         <telerik:AjaxSetting AjaxControlID="radTree" EventName="onTreeViewNodeDrop">
             <UpdatedControls>
                 <telerik:AjaxUpdatedControl ControlID="divWatchMeasureChart1" LoadingPanelID="RadAjaxLoadingPanel1" />
                 <telerik:AjaxUpdatedControl ControlID="lbMeasureName" />
             </UpdatedControls>
         </telerik:AjaxSetting>
         <telerik:AjaxSetting AjaxControlID="radTree" EventName="onTreeViewNodeClicked">
             <UpdatedControls>
                 <telerik:AjaxUpdatedControl ControlID="mainRight" LoadingPanelID="RadAjaxLoadingPanel1"/>
             </UpdatedControls>
         </telerik:AjaxSetting>
     </AjaxSettings>
</telerik:RadAjaxManager>
   
<div class="treeHolder">
  <telerik:RadTreeView ID="radTree" Runat="server" Skin="Windows7" 
     onclientnodedatabound="OnClientNodeDataBoundHandler" 
     onnodeclick="radTree_NodeClick" EnableDragAndDrop="True"
     OnNodeDrop="RadTreeView1_NodeDrop" OnClientNodeClicked="onTreeViewNodeClicked" OnClientNodeDropped="onTreeViewNodeDrop">
     <WebServiceSettings Path="~\Controls\WebController.aspx" Method="GetChildren" />
  </telerik:RadTreeView>
<div>
  
<telerik:RadScriptBlock runat="server">
<script language="javascript">
    function OnClientNodeDataBoundHandler(sender, e) {
        var node = e.get_node();
        node.set_toolTip(node.get_attributes().getAttribute("ToolTip"));
    }
  
    function onTreeViewNodeClicked(sender, eventArgs) 
    {
        var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
        if (ajaxManager != null) 
        {
            var settings = ajaxManager.get_ajaxSettings();
            for (setting in settings) 
            {
                var initiatingControl = settings[setting].InitControlID;
                var controls = settings[setting].UpdatedControls;
                if (initiatingControl == '<%= radTree.ClientID %>') {
  
                    for (control in controls) 
                    {
                        if (controls[control].ControlID != "mainRight")
                        {//disable all other updates perhaps?
                        }
                    }
                }
  
            }
  
            ajaxManager.set_ajaxSettings(settings);
        }
    }
  
  
    function onTreeViewNodeDrop(sender, eventArgs) 
    {
        var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
        if (ajaxManager != null) {
            var settings = ajaxManager.get_ajaxSettings();
            for (setting in settings) {
                var initiatingControl = settings[setting].InitControlID;
                var controls = settings[setting].UpdatedControls;
                if (initiatingControl == '<%= radTree.ClientID %>') {
                    for (control in controls) 
                    {
                        if (controls[control].ControlID != "CntrlViewOverview1_divWatchMeasureChart1") 
                        {//disable all other updates perhaps?
                        }
                    }
                }
  
            }
  
            ajaxManager.set_ajaxSettings(settings);
        }
    }
  
</script>
</telerik:RadScriptBlock>

This whole issue seems to be a bit of an oversight as it would seem sensible that you would want to react to a drag differently to a click, hopefully someone will have an answer to this and eny my multi-day efforts in getting this working. Thank you.
Iana Tsolova
Telerik team
 answered on 07 Mar 2011
1 answer
73 views
I am using a grid of which the SaveScrollPosition="True" so that the position is saved during AJAX postbacks.  I have however implemented a custom client-side script to handle scrolling when the bottom and top of the grid is reached (based on http://www.telerik.com/help/aspnet-ajax/grdvirtualscrollpaging.html) so that paging is "automated".  

The issue is now that when I reach the bottom of the grid and the AJAX request is fulfilled then the position is still at the bottom of the grid.  I want it to be at the top of the grid and visa-versa when I reach the top of the grid.

I have looked and tested all the scenarios proposed in the demos and sample that I could find, but must be missing something. I believe I must use ScrollTop, but cannot find a proper description of how to implement such a client-side script when the SaveScrollPosition is enabled.

Any help would be highly appreciated.

Regards,
Ray 
Tsvetina
Telerik team
 answered on 07 Mar 2011
6 answers
319 views
I am tasked with developing some funcitonality that will allow users to create snippets of web content. The snippets will contain standard html formatting elements and images. It seems that Rad Editor can accomplish a great deal of what I'm trying to do. I do have some questions about inserting images in the content, though.

1) The images are going to be stored in a central directory on the server, but not necessarily in the application folder structure. I assume its possible to set the loacation of the images folder anywhere on the server by using a virtual directory in the application, and this will allow the images dialog to function. Is there any way to specify the location of the image directory on a networked server, as opposed to the same server as the web application?

2) Because the applicaiton will contain a virtual directory, the specified url for an image will work, even if the image is in a directory which isn't in the application folder structure. However, in some cases we don't want the image urls to reference the web application and its domain. We have created a separate domain which points to the images folder... something like http://imagesrv.com/images/someimage.jpg. When an image is inserted in the editor using the images dialog, is there a way to specify that the  url should be an absolute url based on this pattern http://imagesrv.com/images/ + imageFileName as opposed to the default url which is used by the editor? As a side note, can the same be done when inserting links to files as opposed to images?
Rumen
Telerik team
 answered on 07 Mar 2011
6 answers
96 views

Hi,

I am using Radgrid to display/retrieve/update data in an Access database.

Although I am able to delete and addd records, I cannot update.

There are no errors being displayed....I update the field(s) and press OK to accept the changes...but the new changes are not saved..the listing shows again the previous record/field...

As I said, no errors are shown after pressing ok.

Here is the code below (not all, but I assume is where the problem might be?)

II have not changed or added anything manual to the code.

Thank you in advance

<asp:AccessDataSource ID="AccessDataSource1" runat="server" 
            DataFile="~/App_Data/Registro_Planchas_be.mdb"
            DeleteCommand="DELETE FROM [Tabla Registro Planchas] WHERE [Nº] = ?" 
            InsertCommand="INSERT INTO [Tabla Registro Planchas] ([FECHA], [REFERENCIA], [PROVEEDOR], [REFERENCIA PEDIDO], [MAQUINA], [MARCA], [MEDIDA], [TROQUEL], [DISEÑO]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)" 
            SelectCommand="SELECT * FROM [Tabla Registro Planchas]" 
            UpdateCommand="UPDATE [Tabla Registro Planchas] SET [FECHA] = ?, [REFERENCIA] = ?, [PROVEEDOR] = ?, [REFERENCIA PEDIDO] = ?, [MAQUINA] = ?, [MARCA] = ?, [MEDIDA] = ?, [TROQUEL] = ?, [DISEÑO] = ? WHERE [Nº] = ?">
            <DeleteParameters>
                <asp:Parameter Name="Nº" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="FECHA" Type="DateTime" />
                <asp:Parameter Name="REFERENCIA" Type="String" />
                <asp:Parameter Name="PROVEEDOR" Type="String" />
                <asp:Parameter Name="REFERENCIA_PEDIDO" Type="String" />
                <asp:Parameter Name="MAQUINA" Type="String" />
                <asp:Parameter Name="MARCA" Type="String" />
                <asp:Parameter Name="MEDIDA" Type="String" />
                <asp:Parameter Name="TROQUEL" Type="String" />
                <asp:Parameter Name="DISEÑO" Type="String" />                
            </UpdateParameters>    <br>            </UpdateParameters>

Tsvetina
Telerik team
 answered on 07 Mar 2011
4 answers
137 views
Hi,

I have a RadPanel that has 3 radpanelitems, and for each of these panelitems i have a validation group that checks if all inputs on each panelitem is correct, if they are i want the user to hit a Next button that does the validation, so far all good.

If the validation goes trough in the first panelitem it does a postback and all values is lost, i only want it to validate and then enable and expand the second panelitem clientside, is this possible?

Dimitar Terziev
Telerik team
 answered on 07 Mar 2011
1 answer
93 views
<script type="text/javascript">
//<![CDATA[
  
        function mergeFileUploaded(sender, args) {
        <%= Page.GetPostBackEventReference(LB_doUploadData)%>;
    }
  
            function mergeUplOK(sender, eventArgs) {
                $telerik.$(".mergeuplErr")
                .html('');
            }
            function mergeValidationFailed(sender, eventArgs) {
                $telerik.$(".mergeuplErr")
                .html('<%= GetTranslation("invalidmergefile") %>');
                sender.deleteFileInputAt(0);
            }
     //]]> 
    </script>
  
                    <telerik:RadAsyncUpload ID="RadAsyncUpload_Data" HttpHandlerUrl="~/uploadHandler.ashx"
                        runat="server" MaxFileInputsCount="1" AllowedFileExtensions="csv,xls,xlsx,tsv"
                        OnClientFilesUploaded="mergeFileUploaded" OnClientFileUploading="mergeUplOK" OnClientValidationFailed="mergeValidationFailed" />
                    <div id="uplErr" class="mergeuplErr"></div>
When Silverlight is enabled and both OnClientValidationFailed and OnClientFilesUploaded are defined it seems that it fires the OnClientFilesUploaded even when the Validation failed. When Flash it works as expected. Have I missed anything?
Genady Sergeev
Telerik team
 answered on 07 Mar 2011
1 answer
132 views
Dear forum users

I'm fairly new to the RadControls but I'm learning fast. I've created a rather simple form application which retrieves data from a SQL source and displays this data in a RadGrid. Unfortunately I'm running into following problem: when I try to insert a new row into the gridview using InsertItem this row is not showing up in the gridview. I hope you will be able to help me. Just some background info:

- The RadGrid uses the NeedDataSource event 
- See the screen cap for more info

Thanks in advance!

PS: The two rows displayed in the screen cap are comming from the SQL source. I however removed the data because of privacy issues.
Princy
Top achievements
Rank 2
 answered on 07 Mar 2011
1 answer
58 views

Hi There

I'm having real problems with the  RENT A CAR DEMO.  I have just installed the very latest version of the TELERIK ultimate collection, I tried running the rent a car DEMO but got an error regarding the 
Telerik.OpenAccess, Version=2010.2.714.1, Culture=neutral, PublicKeyToken=7CE17EEAF1D59342"

So I changed the webconfic to :
Telerik.OpenAccess, Version=2010.3.1125.1, Culture=neutral, PublicKeyToken=7CE17EEAF1D59342"/>

I also chaged all the DLL's in the BIn file to the most recent versions open acces version, asnd did the automatix upgrade wich was prompted by Visual Studio 2010..

BUT...... NOW I GET THE ERROR BELOW...  PLease Tell me what I am supposed to do..  thanks so much

Stu

erver Error in '/Telerik.CarRental.Web' Application.
Could not load file or assembly 'Telerik.OpenAccess, Version=2010.2.714.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Telerik.OpenAccess, Version=2010.2.714.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
 
Source Error:
 
Line 190:            cmbCarsSearch.Items.Add(new RadComboBoxItem(make, make));
Line 191:        }
Line 192:    }
Line 193:
Line 194:    protected void cmbCarsSearch_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
 
 
Source File: c:\Users\Stuart Cook\Documents\Visual Studio 2010\WebSites\CarRental-Origional\CarRental\Telerik.CarRental.Web\DailySchedule.aspx.cs    Line: 192
 
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Telerik.OpenAccess, Version=2010.2.714.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342' could not be loaded.

Telerik.OpenAccess, Version=2010.3.1125.1, Culture=neutral, PublicKeyToken=7CE17EEAF1D59342"/></assemblies></compilation>
Veronica
Telerik team
 answered on 07 Mar 2011
3 answers
100 views
I have a RadGrid where one of the columns binds to a date/time value.  I use a GirdDataBound column and it binds correctly on the server.  Using the same source for the data, this fails when I try to bind on the client.  It shows the first record, then just stops. The lines that follow in the Javascript function do not execute.

I removed the DataFormatString and it worked. 

To work around this, I changed the column to a string and formatted it before sending it out to be bound.

I know I'll trip on this again some day (probably soon), so I'd like to get a resolution.

Thanks.
Tsvetina
Telerik team
 answered on 07 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?