Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
244 views
Hello again,

I need some help to know how i can get a property from the selectedItem of my Radgrid, so i can execute a delete on a table on my database...

I'm populating data from a stored procedure, using entity.

EscalonamentoFacturasEntities objectContx = new EscalonamentoFacturasEntities();
     RadGrid2.DataSource = objectContx.UsersAssignResume();
     RadGrid2.DataBind();

I need to when click a button "delete", get a property("UserName") from RadGrid2 selected Item, so i can use it like a parametter and execute a storeCommand like this:

objectContx.ExecuteStoreCommand(

 

"Delete from Table Where Table.UserName = @par");

 

Jayesh Goyani
Top achievements
Rank 2
 answered on 25 Aug 2011
1 answer
129 views
Hello experts,

I have an export button on my RadGrid but it's working bad...The idea was to export a specific collumn...After some changes at this moment when i click to export, my grid shows the list to export, instead of give me a .csv....Can you help?

aspx:
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowPaging="True"
    AllowSorting="True" AutoGenerateColumns="False" Width="97%" enableajax="True"
    AllowFilteringByColumn="True" ShowFooter="True" Skin="Black" OnItemCommand="RadGrid1_ItemCommand"
    OnGridExporting="RadGrid1_GridExporting" AllowMultiRowSelection="True" OnItemDataBound="RadGrid1_ItemDataBound">
    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
    <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnablePostBackOnRowClick="true">
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <MasterTableView DataKeyNames="SequencialNumber" Width="100%" CommandItemSettings-ShowExportToCsvButton="True"
        CommandItemSettings-ShowAddNewRecordButton="false" CommandItemDisplay="Top">
        <Columns>
            <telerik:GridBoundColumn DataField="SequencialNumber" HeaderText="SequencialNumber"
                UniqueName="SequencialNumber" SortExpression="SequencialNumber">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Priority" HeaderText="Priority" UniqueName="Priority"
                FilterControlAltText="Filter Priority column" SortExpression="Priority" DataType="System.Int32">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Process" HeaderText="Staging" UniqueName="Process"
                SortExpression="Process" FilterControlAltText="Filter Process column">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SupplierCode" HeaderText="SupplierCode" UniqueName="SupplierCode"
                SortExpression="SupplierCode" FilterControlAltText="Filter SupplierCode column">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="MessageStatus" HeaderText="MessageStatus" UniqueName="MessageStatus"
                SortExpression="MessageStatus" FilterControlAltText="Filter MessageStatus column">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="DocumentType" HeaderText="DocumentType" UniqueName="DocumentType"
                FilterControlAltText="Filter DocumentType column" SortExpression="DocumentType">
            </telerik:GridBoundColumn>
            <telerik:GridDateTimeColumn UniqueName="InvoiceCreationDate" DataField="InvoiceCreationDate"
                HeaderText="InvoiceCreationDate" FilterControlAltText="Filter InvoiceCreationDate column"
                SortExpression="InvoiceCreationDate">
                <FilterTemplate>
                    <telerik:RadDatePicker ID="RadDatePicker1" runat="server">
                    </telerik:RadDatePicker>
                </FilterTemplate>
            </telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn DataField="SupplierVatNumber" FilterControlAltText="Filter SupplierVatNumber column"
                HeaderText="SupplierVatNumber" SortExpression="SupplierVatNumber" UniqueName="SupplierVatNumber">
            </telerik:GridBoundColumn>
        </Columns>
        <ExpandCollapseColumn Visible="False">
            <HeaderStyle Width="19px"></HeaderStyle>
        </ExpandCollapseColumn>
        <RowIndicatorColumn Visible="False">
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
    </HeaderContextMenu>
</telerik:RadGrid>



aspx.cs:

public partial class InvoicesScalingDefault : iConnect.Web.iConnect, IInvoicesScale
    {
        private InvoicesScalePresenter _presenter;
  
        public System.Collections.Generic.IList<Data.SapDocuments> SapDocuments
        {
            get;
            set;
        }
  
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
  
                this._presenter.OnViewInitialized();
  
                LoadData();
            }
            this._presenter.OnViewLoaded();
  
        }
  
        [CreateNew]
        public InvoicesScalePresenter Presenter
        {
            set
            {
                this._presenter = value;
                this._presenter.View = this;
            }
        }
  
  
        /// <summary>
        /// Carregar RadGrid1 com o objecto SapDocuments 
        /// </summary>
        private void LoadData()
        {
  
            string user = Page.User.Identity.Name.Substring(Page.User.Identity.Name.IndexOf("\\") + 1);
  
            EscalonamentoFacturasEntities objectContx = new EscalonamentoFacturasEntities();
            RadGrid1.DataSource = objectContx.ShowUnprocessedInvoices(user);
            //RadGrid1.DataBind();
  
        }
  
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName)
            {
                RadGrid1.MasterTableView.Columns.FindByUniqueName("SequencialNumber").Visible = true;
                RadGrid1.ExportSettings.IgnorePaging = true;
  
                int count = 0;
                foreach (GridColumn column in RadGrid1.Columns)
                {
                    if (column.Visible)
                    {
                        if (count > 0)
                            column.Visible = false;
                        else
                            count++;
                    }
                }
  
            }
        }
  
protected void RadGrid1_GridExporting(object sender, GridExportingArgs e)
        {
            e.ExportOutput = e.ExportOutput.Replace("\"\r\n\"", "\"\r\n\"'");
        }
Ricardo
Top achievements
Rank 1
 answered on 25 Aug 2011
3 answers
94 views
Hello,

i'm having a problem with my RadGrid, At this moment i need to bind data to my Grid using 2 diferent Store Procedures, mapped on my .edmx.

The idea is to have two buttons, each one to call a procedure. At this moment My problem is when I click on a collumn to sort data, my grid comes blank....I need to allow my RadGrid to sort collumns but for the specific procedure that was bind at last.

How can i do that?

My code is

public partial class InvoicesScalingDefault : iConnect.Web.iConnect, IInvoicesScale
    {
        private InvoicesScalePresenter _presenter;
  
        public System.Collections.Generic.IList<Data.SapDocuments> SapDocuments
        {
            get;
            set;
        }
  
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
  
                this._presenter.OnViewInitialized();
  
                LoadData();
            }
            this._presenter.OnViewLoaded();
  
        }
  
        [CreateNew]
        public InvoicesScalePresenter Presenter
        {
            set
            {
                this._presenter = value;
                this._presenter.View = this;
            }
        }
  
  
        /// <summary>
        /// Carregar RadGrid1 com o objecto SapDocuments 
        /// </summary>
        private void LoadData()
        {
  
            string user = Page.User.Identity.Name.Substring(Page.User.Identity.Name.IndexOf("\\") + 1);
  
            EscalonamentoFacturasEntities objectContx = new EscalonamentoFacturasEntities();
            RadGrid1.DataSource = objectContx.ShowUnprocessedInvoices(user);
            //RadGrid1.DataBind();
  
        }
  
  
protected void RadGrid1_GridExporting(object sender, GridExportingArgs e)
        {
            e.ExportOutput = e.ExportOutput.Replace("\"\r\n\"", "\"\r\n\"'");
        }
  
protected void ShowProcessed_Click(object sender, EventArgs e)
        {
            string user = Page.User.Identity.Name.Substring(Page.User.Identity.Name.IndexOf("\\") + 1);
  
            EscalonamentoFacturasEntities objectContx = new EscalonamentoFacturasEntities();
            RadGrid1.DataSource = objectContx.ShowProcessedInvoices(user);
            RadGrid1.DataBind();
  
  
        }
  
  
        protected void ShowUnProcessed_Click(object sender, EventArgs e)
        {
            LoadData();
  
        }
Ricardo
Top achievements
Rank 1
 answered on 25 Aug 2011
1 answer
94 views
I'm trying to add a control to a web page that allows the user to enter date values in a variety of ways, hoping the control will display in the correct format.  I currently use a date type in another product that automatically formats the input to the correct value.  Example:  if the user types in 05052005, the control should convert the value to 5/5/2005, conversely if the user enters 05/05/2005, the control should convert to 5/5/2005.

Any ideas or help is welcomed.
Tom Renfro
Top achievements
Rank 1
 answered on 25 Aug 2011
1 answer
114 views

Hi,
In my application i am creating a new grid where i am trying to implement inline inserting and editing for radgrid where data is being binded from serverside code behind , I am trying to adopt the logic implemented in the following article
 http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/alleditablecolumns/defaultcs.aspx
The problem i am facing is in this article its shown for data being from clientside ,please  can i get any other article or sample working project where inline inline inserting and editing for radgrid is being implemented.


Thanks,
Mahesh
Elliott
Top achievements
Rank 2
 answered on 25 Aug 2011
6 answers
520 views
I have a very basic column and trying to set the width is not working:
<telerik:GridTemplateColumn UniqueName="Delete" Display="true" HeaderText="&nbsp;" ItemStyle-Width="20px" HeaderStyle-Width="40px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">  
                <ItemTemplate> 
                    <asp:ImageButton  CssClass="test" ImageUrl="~/images/silk/cancel.png" ID="btnDeleteItem" runat="server" CommandArgument='<%# Eval("Id") %>' onclick="btnDeleteItem_Click" /> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 
I set the width to be 20px for both, but the ItemTemplate is always doing a width of 40.  Which forced me to make the headerStyle-Width equal to 40.

How do I set the ItemTemplate width to make it take?  The image button included in the template is just 16x16 pixels in size.
Sompop
Top achievements
Rank 1
 answered on 25 Aug 2011
4 answers
167 views
Hi,

We are in the process of migrating SP2007 farm to SP2010 using the database attached method.  Our SP2010 environment will be a brand new farm.  Out SP2007 farm is  running RadEditor v4.5.6.  The SP2010 farm have v5.8.10.0 installed.

Here is the problem.  After attaching/upgrading the SP2007 database to SP2010, I get the following error when trying to navigate to the page:

"Could not load file or assembly 'RadEditorSharePoint, Version=4.5.6.0, Culture=neutral, PublicKeyToken=1f131a624888eeed' or one of its dependencies. The system cannot find the file specified."
 
The database is still looking for the older version of RadEditorSharepoint.  I can not remove RadEditor from the old farm before the migration.   So, how can I remove this from the upgraded database and have it use the 4.5.6.0 version instead?

Please advise.  Thanks
Ultra
Top achievements
Rank 1
 answered on 25 Aug 2011
2 answers
239 views
Hello,
I have the following problem. Once the splitter bar's are resized the mouse cursor does not go back to the default cursor.
I must be missing something.
See attached code.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Main.aspx.cs" Inherits="Main" %>
<%@ Register TagPrefix="rad" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<style type="text/css">
        .StdFont {FONT-SIZE: 11px; FONT-FAMILY: Arial; vertical-align: top;}
        .BoldFont {FONT-WEIGHT: bold; FONT-SIZE: 11px; FONT-FAMILY: Arial; vertical-align: top;}
        .TableBase { width: 100%;}
        .Textfont{FONT-FAMILY:Arial;FONT-SIZE:11px;}
        .ReqFont{FONT-SIZE: 0.9em; FONT-FAMILY: Arial; FONT-WEIGHT:Bold;}
        .VMSAjaxLoadingPanelBackground { height: 100%; background:#fff; } 
        .VMSAjaxLoadingPanel { margin-top: 25px; } 
</style>
<html xmlns="http://www.w3.org/1999/xhtml" style="height:100%">
<head runat="server">
    <title>Main</title>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> 
</head>
<body style="margin:0px;height:100%;overflow:hidden; cursor:default;"  >
    <form id="form1" runat="server">
      
<rad:RadScriptManager runat="server" ID="radSM" AsyncPostBackTimeout="3600"></rad:RadScriptManager>    
    <asp:Panel ID="pnlMain" runat="server">
    <div>   
    <rad:RadSplitter runat="server" id="RadSplitter1"  Orientation="Vertical" width="98%" height="85%" LiveResize="True" >
         <rad:RadPane runat="server" id="LeftPane" width="2%"  Collapsed="false">            
            <rad:RadSlidingZone ID="RadSlidingZone2" runat="server"  ExpandedPaneId="RadSlidingPane1" DockedPaneId="RadSlidingPane1">            
            <rad:RadSlidingPane ID="RadSlidingPane1" runat="server"  EnableDock="true"  MinWidth="355"
                CollapseMode="Both" Title="Filter" TabView="TextOnly" Width="380px" >
            <asp:Panel ID="pnlHolder" runat="server">
                          
            <br />
                <asp:Panel id="pnlSelection" Width="95%" HorizontalAlign="Center" Runat="server" GroupingText="Filter Criteria" CssClass="BoldFont">
                <br />
                    <table cellspacing="0" cellpadding="0" width="100%">
                        <tr>
                            <td valign="top" width="20%" align="left"></td>
                            <td ></td>
                        </tr>
                        <tr>
                            <td valign="top" width="20%" align="left">
                                <asp:Label id="lbl1" Runat="server" CssClass="BoldFont">Department:</asp:Label></td>
                            <td valign="top" align="left">
                                <asp:dropdownlist ID="ddl1" runat="server" CssClass="StdFont">
                                </asp:dropdownlist></td>
                        </tr>                                   
                        <tr>
                            <td valign="top" align="left">
                                <asp:Label id="lbllist2" Runat="server" CssClass="BoldFont" >Branch:</asp:Label></td>
                            <td valign="top" align="left">
                                <asp:Panel ID="List" runat="server"  Width="95%" Height="150px" ScrollBars="Auto">
                                    <asp:CheckBoxList ID="lblListSelection" runat="server"                                         
                                        Width="93%"  BorderWidth="1" BorderStyle="Solid"
                                        CssClass="StdFont" 
                                        Font-Bold="false">                              
                                    </asp:CheckBoxList>
                                </asp:Panel>
                            </td>
                        </tr>              
                        <tr>
                            <td valign="top" align="left">
                                 </td>
                            <td valign="top" align="left">
                                </td>
                        </tr>                  
                   </table>
                </asp:Panel> 
                <br />
                <asp:Panel ID="pnlFilter" Runat="server" Width="80%" HorizontalAlign="Center"  GroupingText="Additional Filter Criteria" CssClass="BoldFont">
                    <br />
                                    </asp:Panel>
            </asp:Panel> 
            </rad:RadSlidingPane>
            </rad:RadSlidingZone>
         </rad:RadPane>
         <rad:RadSplitBar runat="server" id="RadSplitBar1" />
         <rad:RadPane runat="server" id="RightPane"  Width="100%">
           <rad:RadSplitter runat="server" id="InnerSplitter" Orientation="Horizontal" LiveResize="true" >
             <rad:RadPane runat="server" id="TopPane" Height="30%" Width="98%">
             <asp:Panel id="pnlGrid" Width="98%" HorizontalAlign="Center" Runat="server" borderwidth="0px" Height="98%">            
                <rad:RadGrid id="RadGrid1"                                                                                                                                 
                        ShowStatusBar="false" 
                        runat="server" 
                        AllowPaging="True" 
                        AllowSorting="True"
                        AllowMultiRowSelection="False" 
                        AutoGenerateColumns="false"                                                                                                                                                 
                        EnableViewState="true" 
                        OnNeedDataSource="RadGrid1_NeedDataSource" 
                        OnItemCommand="RadGrid1_ItemCommand"                                                                                             
                        Width="100%"   Height="100%"  Skin="Windows7" AllowFilteringByColumn="true"  EnableLinqExpressions="false">
                        <MasterTableView  Width="98%" TableLayout="Fixed"  EnableViewState="true"  CommandItemDisplay="None"  >
                            <Columns>    
                                <rad:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" 
                                    HeaderStyle-Width="3%" 
                                    AllowFiltering="false"
                                    Resizable="false">                                    
                                    <ItemTemplate>
                                        <asp:CheckBox id="CheckBox1" OnCheckedChanged="ToggleRowSelection" AutoPostBack="True" runat="server"></asp:CheckBox>
                                    </ItemTemplate>
                                </rad:GridTemplateColumn>                                                                                                       
                            </Columns>                           
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true" 
                                        Resizing-AllowColumnResize="true"
                                        Resizing-AllowRowResize="false"  
                                        Resizing-EnableRealTimeResize ="false"                                                     
                                        Resizing-ClipCellContentOnResize ="false"                                         
                                        AllowColumnsReorder="true"
                                        EnablePostBackOnRowClick="true" >                                                    
                            <Scrolling AllowScroll ="true" UseStaticHeaders="true"  />                                                                 
                        </ClientSettings>
                        <PagerStyle   Mode="NextPrevAndNumeric" Height="10px"  VerticalAlign="Bottom" Position="Bottom"></PagerStyle>
                    </rad:RadGrid>        
                </asp:Panel>        
             </rad:RadPane>
             <rad:RadSplitBar runat="server" id="RadSplitBar2" EnableResize="true" />
             <rad:RadPane runat="server" id="BottomPane" Width="98%" >
                <iframe id="frm1" runat="server" width="100%" height="100%" frameborder="0"></iframe>
             </rad:RadPane>
           </rad:RadSplitter>
         </rad:RadPane>         
        </rad:RadSplitter>         
     </div>
    </asp:Panel>           
    </form>    
</body>
</html>

Pete
Top achievements
Rank 1
 answered on 25 Aug 2011
2 answers
389 views
Hi Telerik,

I'm running my website normal before, but now I am getting the following error

Exception of type 'System.OutOfMemoryException' was thrown.

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.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.Reflection.RuntimeAssembly.GetRawBytes(RuntimeAssembly assembly, ObjectHandleOnStack retRawBytes) +0
   System.Reflection.RuntimeAssembly.GetRawBytes() +38
   System.Security.Policy.Hash.GetRawData() +68
   System.Security.Policy.Hash.GenerateHash(Type hashType) +75
   System.Security.Policy.Hash.get_SHA1() +101
   System.Web.Handlers.ScriptResourceHandler.GetAssemblyInfoInternal(Assembly assembly) +68
   System.Web.Handlers.ScriptResourceHandler.GetAssemblyInfo(Assembly assembly) +77
   System.Web.Handlers.RuntimeScriptResourceHandler.GetScriptResourceUrlImpl(List`1 assemblyResourceLists, Boolean zip) +393
   System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(List`1 assemblyResourceLists, Boolean zip) +677
   System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(Assembly assembly, String resourceName, CultureInfo culture, Boolean zip) +143
   System.Web.UI.ScriptReference.GetUrlFromName(ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip) +296
   System.Web.UI.ScriptReference.GetUrlInternal(ScriptManager scriptManager, Boolean zip) +613
   System.Web.UI.ScriptReference.GetUrl(ScriptManager scriptManager, Boolean zip) +213
   System.Web.UI.ScriptManager.RegisterUniqueScripts(List`1 uniqueScripts) +203
   System.Web.UI.ScriptManager.RegisterScripts() +443
   System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +122
   System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +8938218
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2716


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1


This error page is used RadControls administration page, I tried to run other projects use RadControls on this server, they're still work fine, but this project is to experience such a problem.

Is there any way to resolve this, its very urgent.
Jayesh Goyani
Top achievements
Rank 2
 answered on 25 Aug 2011
9 answers
99 views
As the ASP.net grid forum is not allowed to open a new thread or reply old threads, I post it here.

Old post: http://www.telerik.com/community/forums/aspnet/grid/allow-vertical-scroll-but-not-horizontal-scroll-in-ie8.aspx

Dear Pavlina / other Telerik support,

I have upload my code on http://www.mediafire.com/?d1hmoaooe1tf8j1 , the file upzip password is 123456. Please have a look on whether the problem can be solved or enhanced, thank you.

Kev
Pavlina
Telerik team
 answered on 25 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?