How to get the primary key value in DeleteCommand event of a RadGrid

First of all you should set the MasterTableView.DataKeyNames property of the RadGrid to the primary key columns: <MasterTableView DataKeyNames="Id"> <telerik:RadGrid ID="customerOverviewRadGrid" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="customersDS" EnableLinqExpressions="false" runat="server" ondeletecommand="customerOverviewRadGrid_DeleteCommand" > <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> <MasterTableView DataKeyNames="Id"> <Columns> . . . </Columns> </MasterTableView> </telerik:RadGrid> Then in you’re DeleteCommand you can get you’re primary …

Exception on filtering a telerik RadGrid

I was getting an error when I filtered a telerik RadGrid:   Error System.Web.HttpUnhandledException (0x80004005): Exception of type ‘System.Web.HttpUnhandledException’ was thrown. —> No property or field ‘Name’ exists in type ‘EntityBase2’ (at index 5) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at …

Using the Telerik GridHyperlinkColumn

I wanted a GridHyperlinkColumn to have a static text   DataTextField, contains the datasource columns that can be used in the property “DataTextFormatString” DataTextFormatString, is used to display the text of the hyperlink. Must be set, else the column would be empty! DataNavigateUrlFields, contains the datasource columns that can be …

IE 6 and Telerik error: Sys.InvalidOperationException Telerik.Web.UI.Orientation has already been registered

If you get the error: Microsoft JScript runtime error: Sys.InvalidOperationException: Type Telerik.Web.UI.Orientation has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update. in IE 6, …

Set initial sorting on a Telerik RadGrid column

If you want to set an initial sorting on a column on a Telerik RadGrid, use the “NeedDataSource” event and add a GridSortExpression to the MasterTableView.SortExpressions protected void RadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { // Set datasource here… if (!IsPostBack) { // Clear the current sortexpressions this.RadGrid.MasterTableView.SortExpressions.Clear(); // Create "Date" sorting …

Set initial filter on GridDateTimeColumn in a Telerik RadGrid

If you want to set an initial filter on a Telerik RadGrid, use the “NeedDataSource” event and set the MasterTableView.FilterExpression and use the function MasterTableView.GetColumnSafe protected void RadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { // Set datasource here… if (!IsPostBack) { // Set initial filter on [RadGrid] this.RadGrid.MasterTableView.FilterExpression = string.Format("([Date] = ‘{0}’)", …

Cannot find column Customer when sorting a Telerik RadGrid column with LLBLGen entities

When you sort a column in a Telerik RadGrid you get the error “Cannot find column Customer”, make sure the  SortExpression is the same as the DataField DataField="Customer.Description" HeaderText="Customer" SortExpression="Customer.Description" UniqueName="Customer" If SortExpression is not the same as the DataFiel, you will get the error: Message: Cannot find column Customer …

Ajaxification of ASP .NET controls with the Telerik RadAjaxManagerProxy (Master / Content page scenario)

If you have a ASP .NET web application with a master page and a content page and you want a LinkButton to update a label with AJAX, you can use the Telerik R.A.D. controls: Web.config configuration > system.web > pages > controls should contain: <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" /> configuration …