Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
184 views
Hello,

My RadGrid is defined with several GridDropDownColumn. The GridDropDownColumns are linked to an ObjectDatasource.
<telerik:GridDropDownColumn DataField="MondayId" DataSourceID="oOdsPoste" HeaderText="Monday"
                               ListTextField="Code" ListValueField="Id" UniqueName="Monday">
                           </telerik:GridDropDownColumn>


Is there a way to retrieve all the data of the ObjectDataSource in the ItemDataBound Event of the RadGrid?

Thanks,Steven

Iana Tsolova
Telerik team
 answered on 07 Mar 2011
1 answer
120 views

Hi,
I am working on a page which shows hirarchical records through RadTreeList control. Everything looks fine except records with parent id which didnt exists in list. Not sure if this is a limitation of RadTreeList control or if there is any flag which allow to display these kind of records.

I have many records in the table with parent id which didn't exists in the table but we still want to show those records in TreeList control.

To explain the issue, there is test page. As you can see in result, first record ("Appetizers") is not rendering on the page as parent id "Y", didn't exists in list.

Thank you in advance for your help.

Default.aspx

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>
<telerik:RadTreeList ID="RadTreeList1" runat="server" OnNeedDataSource="RadTreeList1_NeedDataSource"
    ParentDataKeyNames="ParentID" DataKeyNames="ID" AllowPaging="true" PageSize="5"
    AutoGenerateColumns="false" AllowSorting="true">
    <Columns>
        <telerik:TreeListBoundColumn DataField="ID" UniqueName="ID" HeaderText="Category ID" />
        <telerik:TreeListTemplateColumn DataField="ProductName" UniqueName="ProductName" HeaderText="Product">
            <ItemTemplate>
                <%# Eval("ProductName")%>
            </ItemTemplate>
            <HeaderStyle Width="300px" />
        </telerik:TreeListTemplateColumn>
        <telerik:TreeListBoundColumn DataField="ParentID" UniqueName="ParentID" HeaderText="Parent Category ID" />
    </Columns>
</telerik:RadTreeList>

Default.aspx.cs
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void RadTreeList1_NeedDataSource(object sender, TreeListNeedDataSourceEventArgs e)
    {
        RadTreeList1.DataSource = MyData.GetData();
    }
}
public class MyData
{
    public static List<MyItem> GetData()
    {
        List<MyItem> list = new List<MyItem>();
        list.Add(new MyItem("A", "Appetizers", "Y"));
        list.Add(new MyItem("B", "Beverages", ""));
        list.Add(new MyItem("C", "Cheese", ""));
        return list;
    }
}
public class MyItem
{
    public string ID { get; set; }
    public string ProductName { get; set; }
    public string ParentID { get; set; }
    public MyItem(string id, string productName, string parentID)
    {
        ID = id;
        ProductName = productName;
        ParentID = parentID;
    }
}
Veli
Telerik team
 answered on 07 Mar 2011
1 answer
210 views
The control is enforcing the min and max when using the spin buttons, however, I can type in values that are below the minimum and then click button to postback.

From what I can tell from the UI, it looks like the control shows the alert that the input is wrong, but the postback continues.

Any ideas on how to block the postback?

Thanks.
Martin
Telerik team
 answered on 07 Mar 2011
6 answers
216 views
Hi all,

I set width="100%"in the aspx
And  would like to know its width in pixel after data is filled.
I tried myRadGrid.width, but it just show 100% 
Could someone help me?

Thanks.

Andy.  
Vasil
Telerik team
 answered on 07 Mar 2011
1 answer
41 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
66 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
68 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
283 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
89 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
129 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?