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();
}
<telerik:radgrid ID="RadGrid1" runat="server" >
</telerik:radgrid>
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.
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("javascript:void(window.showModalDialog('CatalogDetailsPopUp.aspx?id={0}','','dialogHeight:500px;dialogWidth:850px'));", Eval("ID")) %>" />
</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'));", Eval("ID")) %>" />
</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= ""<%#String.Format(& quot;javascript:void(window.showModalDialog('CatalogDetailsPopUp.aspx?id={0}','','dialogHeight:500px;dialogWidth:850px'));", Eval("ID")) %>""
DataNavigateUrlFields="ID"
DataNavigateUrlFormatString="javascript:void(window.showModalDialog('CatalogDetailsPopUp.aspx?id={0}','','dialogHeight:500px;dialogWidth:850px'))" >
</telerik:GridHyperLinkColumn>
How should I address this?
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>
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?
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?
Hi,
There is a label called "Command item" in radgrid, I need to remove that label. Please advise.
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
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