I have a RADComboBox on my ASPX page as shown below:
<telerik:RadComboBox RenderMode="Lightweight" ID="cboxEmployee" runat="server" Width="400" Height="400px" AutoPostBack="false" EmptyMessage="select employee here" CssClass="validationClass" OnSelectedIndexChanged="cboxAccused_SelectedIndexChanged"> </telerik:RadComboBox>I Bind the ComboBox with this C# code:
private void BindAccusedDropdowns() { using (PSDEntities context = new PSDEntities()) { cboxEmployee.DataSource = context.LawsonEmployees.OrderBy(s => s.LAST_NAME).ToList(); cboxEmployee.DataTextField = "DISPLAY"; cboxEmployee.DataValueField = "EID"; cboxEmployee.DataBind(); cboxEmployee.AllowCustomText = true; cboxEmployee.MarkFirstMatch = true; } }The Box functions properly on the page I can select an employee.
When I attempt to get the SelectedValue of the comboBox with this code it returns a null value.
a.EID = Convert.ToInt32(cboxEmployee.SelectedValue);
Any idea why this happening?
Hello,
I want to implement RadGrid in which i am using telerik:GridTemplateColumn to bind data to link button. I want to open another page on click of this link and pass the value of the link as query-string. can anyone help me with the example?
Hi I am using radgrid and I want to apply export excel functionality on that but when I am trying to add header using Prerender event it is not working for
rgEnrolmentExport.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx;
I need this format to remove prompt which we normally get on opening of Xls file
So please see code
On aspx -
<telerik:RadGrid ID="rgEnrolmentExport" OnPreRender="rgEnrolmentExport_PreRender" runat="server" AllowPaging="false" AutoGenerateColumns="true" ExportSettings-Excel-Format="Html">
<ExportSettings IgnorePaging="True" OpenInNewWindow="True" ExportOnlyData="True">
</ExportSettings>
</telerik:RadGrid>
on C#
rgEnrolmentExport.DataSource = dtExportData;
rgEnrolmentExport.DataBind();
DateTime obj1 = (DateTime)rdpExportDate.SelectedDate;
rgEnrolmentExport.ExportSettings.FileName = "HO_Enrollment_Source_Report_" + obj1.ToString("MM.yyyy");
rgEnrolmentExport.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx;
// rgEnrolmentExport.ExportSettings.Excel.FileExtension = "Xlsx";
rgEnrolmentExport.HeaderStyle.Font.Bold = true;
rgEnrolmentExport.MasterTableView.ExportToExcel();
And in Prerender
protected void rgEnrolmentExport_PreRender(object sender, EventArgs e)
{
//get the current header
GridItem[] header = rgEnrolmentExport.MasterTableView.GetItems(GridItemType.Header);
if (header.Length > 0)
{
//get the current THead element
DateTime obj1 = (DateTime)rdpExportDate.SelectedDate;
GridTHead head = ((GridTHead)header[0].Parent.Controls[0].Parent);
//Get the GridHeaderItem from the THead
GridHeaderItem currentHeaderItem = (GridHeaderItem)head.Controls[0];
//Clear all GridHeaderItems
head.Controls.Clear();
//create a new GridHeaderItem which will be the new row
GridHeaderItem newHeaderItem = new GridHeaderItem(rgEnrolmentExport.MasterTableView, 0, 0);
// newHeaderItem.Cells.Add(new GridTableHeaderCell());
newHeaderItem.Cells.Add(new GridTableHeaderCell());
newHeaderItem.Cells.Add(new GridTableHeaderCell());
newHeaderItem.Cells.Add(new GridTableHeaderCell { Text = "Massachusetts", ColumnSpan = 3, HorizontalAlign = HorizontalAlign.Center });
newHeaderItem.Cells.Add(new GridTableHeaderCell { Text = "Rhode Island", ColumnSpan = 3, HorizontalAlign = HorizontalAlign.Center });
// newHeaderItem.Cells.Add(new GridTableHeaderCell());
newHeaderItem.Cells.Add(new GridTableHeaderCell { Text = "New Hampshire", ColumnSpan = 3, HorizontalAlign = HorizontalAlign.Center });
// newHeaderItem.Cells.Add(new GridTableHeaderCell());
newHeaderItem.Cells.Add(new GridTableHeaderCell { Text = "All EMembers", ColumnSpan = 3, HorizontalAlign = HorizontalAlign.Center });
// head.Controls.AddAt(0, newHeaderItem);
GridHeaderItem newHeaderItem1 = new GridHeaderItem(rgEnrolmentExport.MasterTableView, 0, 0);
newHeaderItem1.Cells.Add(new GridTableHeaderCell());
newHeaderItem1.Cells.Add(new GridTableHeaderCell());
newHeaderItem1.Cells.Add(new GridTableHeaderCell { Text = "Heating Oil Enrollment Sources Report for " + obj1.ToString("MMMMM yyyy"), ColumnSpan = 12, HorizontalAlign = HorizontalAlign.Center });
//Add back the GridHeaderItems in the order you want them to appear
head.Controls.Add(newHeaderItem1);
head.Controls.Add(newHeaderItem);
head.Controls.Add(currentHeaderItem);
}
}
So basically if I am not applying Xlsx format it woking fine pelase see attachment it is exoporting what ever I need to do but with Xlsx format it throwing error.
So conclusion is I need to export file as I have attached in Image but in Xlsx format
Hello,
I have implemented RadGid with filter options. I have 2 quries:
1. How to show default text e.g "Search..." for filters for some of the columns(not All columns).
2. When user clicks on Filter Textbox it should populate all the values for that column.
Hello,
I am new to this forum and using Telerik controls for the first time.
I am using RadGid in Provider Hosted Add-In and so far could bind the data to it. My questions are:
1. When i use default ExportToExcel functionality nothing happens.. The page becomes blank after showing RadAjaxLoadingPanel
I have written below code for that:
protected void RadGrid_ItemCommand(object source, GridCommandEventArgs e) { if (e.CommandName == RadGrid.ExportToExcelCommandName) { RadGridRequests.ExportSettings.Excel.Format = GridExcelExportFormat.Biff; RadGridRequests.ExportSettings.IgnorePaging = true; RadGridRequests.ExportSettings.ExportOnlyData = true; RadGridRequests.ExportSettings.OpenInNewWindow = true; } }I'm using RadGrid to export to Excel. Everything works except the worksheets have an extra tab named 'License' that contains the following text: "This document was generated by a trial version of Telerik Document Processing.".
I would like to suppress the creation of this tab. The online demo here does not create this tab: http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/exporting/excel-export/defaultcs.aspx?show-source=true
Has anyone encountered and addressed this?
Thanks.
I'm in the process of updating to use the newest version of UI for ASP.NET AJAX. We were using Q2 2014.
One of our pages had a RadGrid with 12 visible columns. After upgrading to 2017_9_913 3 of the columns no longer display. The only update we made to the .aspx file was to reference the new Telerik DLL.
See attached images showing screen shot and code.
