Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
1.0K+ views
Hi Telerik Team - I have a grid that has gridTemplateColumn checkbox column. so If the user checks some rows and in the second screen if he checks some rows then return backs to previous rows needs to show correct records. I searched in this forum, found code and created with northwind database. But sometimes when I check some items in 4 pages and then returns back not preserving the checkboxes as expected. Can anyone please guide me on this?
aspx:
  
<telerik:GridTemplateColumn UniqueName="TemplateColumn" SortExpression="LastName">
                                        <ItemTemplate>
                              
                                <asp:checkbox ID="checkColumn" runat="server" />
                              
          </ItemTemplate>
         </telerik:GridTemplateColumn>
                                          
                                           
                                             
                                           <telerik:GridBoundColumn DataField="OrderID" DataType="System.Int32" 
                                               HeaderText="OrderID" ReadOnly="True" SortExpression="OrderID" 
                                               UniqueName="OrderID">
                                           </telerik:GridBoundColumn>
                                           <telerik:GridBoundColumn DataField="ProductID" DataType="System.Int32" 
                                               HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" 
                                               UniqueName="ProductID">
                                           </telerik:GridBoundColumn>
                                           <telerik:GridBoundColumn DataField="UnitPrice" DataType="System.Decimal" 
                                               HeaderText="UnitPrice" SortExpression="UnitPrice" UniqueName="UnitPrice">
                                           </telerik:GridBoundColumn>
                                      
  
                                          
                                           
                                             
                                        </Columns
  
  
  
aspx.cs:
  
 ArrayList selectedItems; 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ViewState["Selected"] = null;
        }  
  
    }
  
    private void RememberSelected()
    {
        selectedItems = new ArrayList();
        int index = -1;
  
       // foreach (GridDataItem row in  RadGrid1.MasterTableView.Items)//RadGrid1.Items)
            foreach (GridDataItem row in RadGrid1.Items)
        {
            index = (int)row.GetDataKeyValue("ProductID");
            bool result = ((CheckBox)row.FindControl("CheckColumn")).Checked;
  
            // Check in the Session   
            if (ViewState["Selected"] != null)
                selectedItems = (ArrayList)ViewState["Selected"];
            if (result)
            {
                if (!selectedItems.Contains(index))
                    selectedItems.Add(index);
            }
            else
                selectedItems.Remove(index);
        }
  
        if (selectedItems != null && selectedItems.Count > 0)
            ViewState["Selected"] = selectedItems;
    }
  
  
    protected void RadGrid1_PageIndexChanged(object source, Telerik.Web.UI.GridPageChangedEventArgs e)
    {
        RememberSelected();
    }
  
    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (selectedItems != null)
        {
            if (e.Item is GridDataItem)
             
            {
                GridDataItem row = (GridDataItem)e.Item;
  
                int index = (int)row.GetDataKeyValue("ProductID");
  
                if (selectedItems.Contains(index))
                {
                    e.Item.Selected = true;
                     
                     
                }
            }
        }
    }
  
    protected void RadGrid1_SortCommand(object source, GridSortCommandEventArgs e)
    {
        RememberSelected();
    }  


Eyup
Telerik team
 answered on 15 Dec 2016
3 answers
293 views
hi,
Iam using Radgrid for my ASP.Net project.
I want to design,bound ,bind and create events for my grid by program.
for ex in my design i will have

<telerik:radgrid ID="RadGrid1" runat="server" >

              </telerik:radgrid>


In page init i define all bound columns and design of grid and create a event for the grid for ex.
 protected void Page_Init(object source, System.EventArgs e)
    {
        Loadprogramaticgrid();
        RadGrid1.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
    }

  private void Loadprogramaticgrid()
    {
             RadGrid1.MasterTableView.DataKeyNames = new string[] { "username" };
        RadGrid1.Skin = "Default";
        RadGrid1.Width = Unit.Percentage(100);
              RadGrid1.AutoGenerateColumns = false;
        //Add columns
        GridBoundColumn boundColumn;
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "username";
        boundColumn.HeaderText = "username";
        RadGrid1.MasterTableView.Columns.Add(boundColumn);
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "firstname";
        boundColumn.HeaderText = "firstname";
        RadGrid1.MasterTableView.Columns.Add(boundColumn);

        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "lastname";
        boundColumn.HeaderText = "lastname";
        RadGrid1.MasterTableView.Columns.Add(boundColumn);
     
    }
 protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = loaddata();
    }
and i have a Button and in button click i rebind the grid as
 protected void Button1_Click(object sender, EventArgs e)
    {
        RadGrid1.Rebind();
    }

now the problem is for first time the grid binds and display the data in grid.
When i click the button the grid is not binding correctly.
i have attached the image for more referance.

Naga
Top achievements
Rank 1
 answered on 14 Dec 2016
2 answers
364 views

Hi,

I'm porting some old code to Telerik and I'm having issues. This application has a grid and two of the columns contains hyperlinks that would execute java code to open a non-modal windows to present more details on the items with hyperliks
In the old code, this solved by a template like this:

<ItemTemplate>
              <asp:HyperLink ID="hplnkCatalogDetails" runat="server" ToolTip='Click To View Details'    Text='<%# Eval("ID") %>' NavigateUrl="<%#String.Format(&quot;javascript:void(window.showModalDialog('CatalogDetailsPopUp.aspx?id={0}','','dialogHeight:500px;dialogWidth:850px'));&quot;, Eval(&quot;ID&quot;)) %>" />                                                
</ItemTemplate>

 

However this solution fails to execute if using this solution with Telerik GridTemplateColumn :

<telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="Catalog" UniqueName="TemplateColumn" DataField="ID">
                                                        <ItemTemplate>
                                                          <asp:HyperLink ID="hplnkCatalogDetails2" runat="server" ToolTip='Click To View Details'
                                                                    Text='<%# Eval("ID") %>' NavigateUrl="<%#String.Format(& quot;javascript:void(window.showModalDialog     ('CatalogDetailsPopUp.aspx?id={0}','','dialogHeight:500px;dialogWidth:850px'));&quot;, Eval(&quot;ID&quot;)) %>" />
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>

 

and this other approach does not work neither using GridHyperLinkColumn:

                                                   
                                                    <telerik:GridHyperLinkColumn AllowSorting="False" DataTextField="ID" FilterControlAltText="Filter column column" HeaderText="Catalog" UniqueName="colID"
                                                      
                                                        NavigateUrl= "&quot;<%#String.Format(& quot;javascript:void(window.showModalDialog('CatalogDetailsPopUp.aspx?id={0}','','dialogHeight:500px;dialogWidth:850px'));&quot;, Eval(&quot;ID&quot;)) %>&quot;"
                                                        DataNavigateUrlFields="ID"
                                                        DataNavigateUrlFormatString="javascript:void(window.showModalDialog('CatalogDetailsPopUp.aspx?id={0}','','dialogHeight:500px;dialogWidth:850px'))" >
                                                       
                                                    </telerik:GridHyperLinkColumn>

 

How should I address this?

 

 

 

Miguel
Top achievements
Rank 1
 answered on 14 Dec 2016
2 answers
155 views

I have an ASPX page that works fine in a seperate development project.  I am now trying to move the page into a Visual Studio 2015 project that creates a SharePoint 2010 package.  I just want to deploy the page into the site.

When I load the page through the SharePoint 2010 site, I get a Parser Error page saying that the event handler for OnNeedDataSource is not allowed on this page.  If I remove that event, it complains about the first event that it finds.

Any suggestions on what I might be missing in order to get the events firing?

 

The error is:

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The event handler 'OnNeedDataSource' is not allowed in this page.

Source Error:

Line 37: <telerik:RadCheckBox ID="RadCheckBoxShowDisabledConnections" runat="server" Text="Show Disabled Connections">

Line 38: </telerik:RadCheckBox>

Line 39: <telerik:RadGrid ID="RadGridConnections" runat="server" Width="100%"

Line 40: AllowFilteringByColumn="True"

Line 41: AllowPaging="True" PageSize="5"
Source File: /Pages/TestPage.aspx    Line: 39


Version Information: Microsoft .NET Framework Version:2.0.50727.8745; ASP.NET Version:2.0.50727.8745 

 

The ASPX page is:

<%@ Assembly Name="PSC.UDCS.SP2010, Version=1.0.0.0, Culture=neutral, PublicKeyToken=21ff67ef5617fb2f" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Assembly="Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<%@ Page Language="C#"  CodeBehind="UdcsTestPage.aspx.cs" Inherits="PSC.UDCS.SP2010.UdcsTestPage" MasterPageFile="~/_catalogs/masterpage/default.master"  %>
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    UDCS-Connections
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server">
    Unmanned Device Connection Service - Connections
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager>
    <h2>Unmanned Device Connections - Connection Setup</h2>
    <asp:Label runat="server" ID="CompileTime"></asp:Label>
                <asp:Label runat="server" ID="Label1"></asp:Label>
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="RadGrid1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadGridConnections" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>
                <telerik:RadCheckBox ID="RadCheckBoxShowDisabledConnections" runat="server" Text="Show Disabled Connections">
                </telerik:RadCheckBox>
                    <telerik:RadGrid ID="RadGridConnections" runat="server" Width="100%"
                        AllowFilteringByColumn="True"
                        AllowPaging="True" PageSize="5"
                        AllowSorting="True"
                        AllowAutomaticUpdates="True"
                        AllowAutomaticDeletes="true"
                                    RenderMode="Lightweight"
                        OnNeedDataSource="RadGridConnections_OnNeedDataSource"
                        OnItemDataBound="RadGridConnections_OnItemDataBound"
                        OnDeleteCommand="RadGridConnections_OnDeleteCommand"
                        OnUpdateCommand="RadGridConnections_OnUpdateCommand"
                        OnInsertCommand="RadGridConnections_OnInsertCommand"
                        OnItemCommand="RadGridConnections_OnItemCommand"
                        >
                        <GroupingSettings CaseSensitive="false" />
                        <PagerStyle Mode="NextPrevAndNumeric" />
                        <MasterTableView CommandItemDisplay="TopAndBottom" Width="100%" DataKeyNames="ID, Station,Device,TemplateName" AutoGenerateColumns="False" >
                            <Columns>
                                <telerik:GridButtonColumn CommandName="Edit" Text="Edit" UniqueName="Edit" />
                                <telerik:GridButtonColumn ConfirmText="Disable this connection?" ConfirmDialogType="RadWindow" ConfirmTitle="Disable" CommandName="Delete" />
                                                                <telerik:GridBoundColumn UniqueName="ID" DataField="ID" Display="False" />
                                <telerik:GridBoundColumn UniqueName="DeviceId" DataField="DeviceId" Display="False" />
                                <telerik:GridBoundColumn UniqueName="Station" HeaderText="Station" DataField="Station" />
                                <telerik:GridBoundColumn UniqueName="Device" HeaderText="Device" DataField="Device" />
                                <telerik:GridBoundColumn UniqueName="TemplateName" HeaderText="TemplateName" DataField="TemplateName" />
                                <telerik:GridBoundColumn UniqueName="ApplicationPort" HeaderText="ApplicationPort" DataField="ApplicationPort" />
                                <telerik:GridBoundColumn UniqueName="UseMultiHomed" HeaderText="UseMultiHomed" DataField="UseMultiHomed" />
                                <telerik:GridBoundColumn UniqueName="Application" HeaderText="Application" DataField="Application" />
                                <telerik:GridBoundColumn UniqueName="Access" HeaderText="Access" DataField="Access" />
                                <telerik:GridBoundColumn UniqueName="Connection" HeaderText="Connection" DataField="Connection" />
                                <telerik:GridBoundColumn UniqueName="WhiteListIps" HeaderText="WhiteListIps" DataField="WhiteListIps" />
                            </Columns>
    <EditFormSettings UserControlName="UdcsConnectionEdit.ascx" EditFormType="WebUserControl">
      <EditColumn UniqueName="EditCommandColumn1">
      </EditColumn>
    </EditFormSettings>                        </MasterTableView>
                    </telerik:RadGrid>
</asp:Content>

Marin
Telerik team
 answered on 14 Dec 2016
9 answers
179 views

I have an async upload control in my page along with a grid view wherein all the uploads are displayed. When I click on a line item in a grid I have a download file functionality. But, whenever I click on the download file link, the progress area appears which is not expected. the progress area is only meant for the upload control but not for the download. How do I sort this issue out?

Veselin Tsvetanov
Telerik team
 answered on 14 Dec 2016
1 answer
59 views

I have a need for a scheduler that is not time specific and not necessarily all-day (though maybe treating them as all day is a way to do it).

So, I need the Month View and the ability to add any number of entries in any given day. 

I need the added items to display alphabetically.

And I need NO TIMES to show up in the output nor in the Data Entry form.

How do I do this?

Anton
Telerik team
 answered on 14 Dec 2016
3 answers
122 views

Hi,

There is a label called "Command item" in radgrid, I need to remove that label.  Please advise. 

Ram
Top achievements
Rank 1
 answered on 14 Dec 2016
6 answers
3.7K+ views

General info:
- Sharepoint 2010 + webparts with Telerik controls on it
- Telerik ASP.NET AJAX version 2013.2.717.35
- Both Telerik.Web.UI and Telerik.Web.UI.Skins are in GAC ("C:\Windows\assembly")

After deploying webpart to Sharepoint farm webpart works as expected.But when left web page for a some period of time (more than 1 hour) and after that refresh the page telerik error occurs:

==============================================================================================================
Telerik.Web.UI.RadAjaxLoadingPanel with ID='loadingPanel' was unable to find an embedded skin with the name 'WebBlue'. Please, make sure that the skin name is spelled correctly and that you have added a reference to the Telerik.Web.UI.Skins.dll assembly in your project. If you want to use a custom skin, set EnableEmbeddedSkins=false.
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.InvalidOperationException: Telerik.Web.UI.RadAjaxLoadingPanel with ID='loadingPanel' was unable to find an embedded skin with the name 'WebBlue'. Please, make sure that the skin name is spelled correctly and that you have added a reference to the Telerik.Web.UI.Skins.dll assembly in your project. If you want to use a custom skin, set EnableEmbeddedSkins=false.

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.
==============================================================================================================

Telerik registration in  *.vbproj file:
<Reference Include="Telerik.Web.UI, Version=2013.2.717.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL" />
<Reference Include="Telerik.Web.UI.Skins, Version=2013.2.717.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4, processorArchitecture=MSIL" />

Telerik registration in *.ascx 
<%@ Register assembly="Telerik.Web.UI, Version=2013.2.717.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>

I read a lot of articles which advice to put assemblies into the GAC, but assemblies are already in the GAC. 

Can you please explain why web part stops working after some period of time and how can I fix this problem?
I assume that this behavior is caused by the ending of user session timeout, but don't know how this influences on skin loading.

Thx,
Alex.

Rumen
Telerik team
 answered on 13 Dec 2016
1 answer
83 views

We currently have Telerik version 2011.2.712.40 and to upgrade to version 2016.3.1027.

Our application runs on VS2010 microsoft framework 4.0.

Can we upgrade Telerik without upgrading Visual Studio nor the framework?

Thank you

Rumen
Telerik team
 answered on 13 Dec 2016
1 answer
109 views

We currently have Telerik version 2011.2.712.40 and to upgrade to version 2016.3.1027.
Our application runs on VS2010 microsoft framework 4.0.

Can we upgrade Telerik without upgrading Visual Studio nor the framework?

Thank you

Rumen
Telerik team
 answered on 13 Dec 2016
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?