Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
185 views
Hi forum

I have created a RadGrid with automatically generated CRUD functions.

If i view a aspx file with the RadGrid in it works, however when i place it in a backend page onyl the delete and refresh works

It is the same code so can only assume something in the sitefinity backend is braking the functions

heres the code:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="newsArticleAdmin.ascx.cs" Inherits="SitefinityWebApp.Modules.newsArticles.admin.newsArticleAdmin" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
 
<div style="clear:both;"></div>
<div id="adminContents">
 
<h2>News Articles</h2>
<p>These articles appear on the home page</p>
<br />
 
 
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
</telerik:RadScriptManager>
 
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
 
                <telerik:AjaxUpdatedControl ControlID="SqlDataSource1" />
 
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
 
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True"
        AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
        AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" CellSpacing="0"
        DataSourceID="SqlDataSource1" GridLines="None" Skin="Telerik">
 
 
<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="TopAndBottom"
            DataKeyNames="fld_blogPostId" DataSourceID="SqlDataSource1"
            EditMode="InPlace">
<CommandItemSettings ExportToPdfText="Export to PDF"
        AddNewRecordText="Add new article"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
</RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridBoundColumn DataField="fld_blogPostId" DataType="System.Int32"
            FilterControlAltText="Filter fld_blogPostId column" HeaderText="fld_blogPostId"
            ReadOnly="True" SortExpression="fld_blogPostId" UniqueName="fld_blogPostId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="fld_blogTitle"
            FilterControlAltText="Filter fld_blogTitle column" HeaderText="fld_blogTitle"
            SortExpression="fld_blogTitle" UniqueName="fld_blogTitle">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="fld_blogContents"
            FilterControlAltText="Filter fld_blogContents column"
            HeaderText="fld_blogContents" SortExpression="fld_blogContents"
            UniqueName="fld_blogContents">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="fld_blogDate"
            FilterControlAltText="Filter fld_blogDate column" HeaderText="fld_blogDate"
            SortExpression="fld_blogDate" UniqueName="fld_blogDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="fld_blogImage"
            FilterControlAltText="Filter fld_blogImage column" HeaderText="fld_blogImage"
            SortExpression="fld_blogImage" UniqueName="fld_blogImage">
        </telerik:GridBoundColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
 
        <StatusBarSettings LoadingText="Loading articles..."
            ReadyText="Articles ready" />
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
    </telerik:RadGrid>
 
 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:NewsArticlesConnectionString %>"
        DeleteCommand="DELETE FROM [tbl_newsArticles] WHERE [fld_blogPostId] = @fld_blogPostId"
        InsertCommand="INSERT INTO [tbl_newsArticles] ([fld_blogTitle], [fld_blogContents], [fld_blogDate],
[fld_blogImage]) VALUES(@fld_blogTitle, @fld_blogContents, @fld_blogDate, @fld_blogImage)"
        SelectCommand="SELECT * FROM tbl_newsArticles"
        UpdateCommand="UPDATE [tbl_newsArticles] SET [fld_blogTitle] = @fld_blogTitle, [fld_blogContents] = @fld_blogContents,
[fld_blogDate] = @fld_blogDate, [fld_blogImage] = @fld_blogImage WHERE fld_blogPostId = @fld_blogPostId">
        <DeleteParameters>
            <asp:Parameter Name="fld_blogPostId" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="fld_blogTitle" />
            <asp:Parameter Name="fld_blogContents" />
            <asp:Parameter Name="fld_blogDate" />
            <asp:Parameter Name="fld_blogImage" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="fld_blogTitle" />
            <asp:Parameter Name="fld_blogContents" />
            <asp:Parameter Name="fld_blogDate" />
            <asp:Parameter Name="fld_blogImage" />
            <asp:Parameter Name="fld_blogPostId" />
        </UpdateParameters>
    </asp:SqlDataSource>
 
  
</div>

Any help very muchappreciated

Andrew
Bloommedia
Top achievements
Rank 1
 asked on 29 Sep 2011
1 answer
146 views
Hi, i have a problem on a RadFileExplorer in the tree view when i have many elements and
need to scroll to navigate to certain node, then when i click in this node, the scroll
backs to its initial position.

I have a javascript function asociated to onTreeNodeClicking and i get the srollTop a this moment, i save in a hidden field , but
i dont know where apply this scroll value, to recover scroll. after postback from node clicking.

thanks in advance.
Plamen
Telerik team
 answered on 29 Sep 2011
1 answer
96 views
Hi.
Tell me, please, how can i get value of property "DataTextField" of RadContextMenu control on the client-side?
aspUser
Top achievements
Rank 1
 answered on 29 Sep 2011
1 answer
171 views
Hi,

I have the following javascript method to create a RadWindow.

function ShowModalWindow(cLinkName, args, width, height) 
{
    var oWnd = radopen(cLinkName, "ModalDialog");
      
    if(oWnd != null)
    {
        if (width != null)
            oWnd.SetSize(width, height);
  
        oWnd.Center();
  
        var arg = new Object();                    
        //Using an Object as a argument is convenient as it allows setting many properties.   
        arg.descriptionValue = args;
          
        oWnd.Argument = arg;
    }
    radWindow = oWnd;
}

The problem is that I have a page with a lot of graphs. If the button that calls the above javascript is clicked before the page is done loading then oWnd is null and the size does not get set. The window still opens correctly but the size is something like 50x50 instead of 800x600.

Is there a simple or preferred way to handle this?
Marin Bratanov
Telerik team
 answered on 29 Sep 2011
1 answer
81 views
Hello Telerik,

I have RadRating inside my grid,my item count is 1.i need a condition like only out of the say 10 fields that are showing only 3 needs to be set as rated,if the 4th one is rated,then it sholud show a message "you cant select more than 3".

Thanks,
aRviN.!!
Shinu
Top achievements
Rank 2
 answered on 29 Sep 2011
8 answers
298 views
Hi,

This control is actually a control I have wanted for a while. I use the WinForms ListView control a lot which provides a lightweight but pretty useful control; this seems to map qiute well to the ListView, without requiring the weight of a grid.

I have a question which may be a suggestion. Is it possible to add my own buttons alongside the Move Up/Down/Delete buttons? One of my items in my list needs to be set to "default". This would ideally be via a button within the listbox control itself, complemented by a styled entry - eg. in bold.

Is this possible?
Genady Sergeev
Telerik team
 answered on 29 Sep 2011
3 answers
408 views
Hey guys. We've recently purchased and started using these aptly named Rad controls and so far everything has been amazing. Especially after coming from the Infragistics controls we had been using.

We've found one peculiar issue however, and it has to do with the Filter context menus on the RadGrid.

In IE(8+ tested) and Opera(11.5) when you tab to the filter button and hit enter, the context menu shows near the button (as would be expected). In Firefox(3+) Chrome and Safari however it pops up in the top left corner of the screen instead. While not a deal breaker it is sort of jarring.

Is this behaviour intentional? Is there a way to work around it?
Any assistance would be appreciated, Thanks.
Pavlina
Telerik team
 answered on 29 Sep 2011
1 answer
98 views

Hi,

I have a RadToolBar and I am specifying ToolTips for each of the RadToolBarButtons via implicit resources in the markup. The tooltips are displaying correctly but I'm interested in displaying the ToolTips for longer (as they would if you could specify the AutoCloseDelay property). I've popped a bit of the ToolBar markup into the post.

Any ideas would be appreciated.

<telerik:RadToolBar ID="barActions" runat="server" onbuttonclick="barActions_ButtonClick" Width="100%">
  <Items>
    <telerik:RadToolBarButton Value="New" PostBack="false" CausesValidation="false" meta:resourcekey="ToolBarNew"  />
  </Items>
</telerik:RadToolBar>

Many thanks,
Ben
Dimitar Terziev
Telerik team
 answered on 29 Sep 2011
0 answers
99 views
hi,

I have a when displaying menu Item for 3 rd child label..

RootItems are generated from Page_Load..
Code Snippet Below............
==================================================
SqlDataAdapter sda = new SqlDataAdapter("SELECT CAM_CGID,CAM_CNAM FROM E_CAT_MST WHERE CAM_CLVL=1", conn);
        DataTable dt = new DataTable();
        sda.Fill(dt);
        RadMenu1.DataSource = dt;
        RadMenu1.DataTextField = "CAM_CNAM";
        RadMenu1.DataValueField = "CAM_CGID";
         RadMenu1.DataBind();

===================================================
===============At the 2nd label the item  is loaded from Webservice====================
<Script>
 function itemPopulating(sender, eventArgs) {
        var item = eventArgs.get_item();
        var context = eventArgs.get_context();
        context["CAM_CPID"] = item.get_value();
             
    }
</Script>
==================================
===============Telerik Menu=======================
<telerik:RadMenu ID="RadMenu1" runat="server" 
            OnClientItemPopulating="itemPopulating" Flow="Vertical" Height="500" EnableRootItemScroll="true"
            DefaultGroupSettings-Height="300" EnableRoundedCorners="true" 
            EnableShadows="true">
             <WebServiceSettings Path="WebService2.asmx" Method="WebServiceMethodName" UseHttpGet="false"  />
    <LoadingStatusTemplate>
        <asp:Image runat="server" ID="LoadingImage" ImageUrl="~/ajax-loader.gif" ToolTip="Loading..."
            Width="15px" Height="15px" ImageAlign="Left"/>
    </LoadingStatusTemplate> 
=======================================================================
==============================Webservice Code==============================
 public RadMenuItemData[] WebServiceMethodName(RadMenuItemData item, object context)
    {
        DataTable productCategories = GetProductCategories(item.Value);
        List<RadMenuItemData> result = new List<RadMenuItemData>();
        foreach (DataRow row in productCategories.Rows)
        {
            RadMenuItemData itemData = new RadMenuItemData();
            itemData.Text = row["CAM_CNAM"].ToString();
            itemData.Value = row["CAM_CGID"].ToString();
        
                itemData.ExpandMode = MenuItemExpandMode.WebService;
                  result.Add(itemData);
        }
        return result.ToArray();
    }

   public DataTable GetProductCategories(string value)
    {
        DataTable dt = new DataTable();
        SqlDataAdapter sda = new SqlDataAdapter("SELECT CAM_CNAM,CAM_CGID  FROM E_CAT_MST WHERE  CAM_CLVL <> 1               AND CAM_CPID=" + value, conn);
        return dt;
    }
=========================================================================

Above is the total code snippet..It is working fine for 2nd label..But in 3rd Label menu item is collapsed..

Pls help....
Pritam
Top achievements
Rank 1
 asked on 29 Sep 2011
1 answer
91 views
I just upgraded from the previous to the latest version of the controls (ASP.NET 4) and I suddenly found that the tab strip doesn't work right in IE.  If I have five tabs and I am in tab one, the content of the other four tabs is sitting below the content for tab one: I can scroll down to see it.

Any ideas what happened?

It goes away if I set "RenderSelectedPageOnly=true" on the MultiPage but I don't want to do that.

BTW, I am loading this via Ajax inside a RadPanel...  but it all worked in the previous version.
Dimitar Terziev
Telerik team
 answered on 29 Sep 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?