Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
911 views
Good afternoon,
I have following RadGrid in my aspx page:

<telerik:RadGrid ID="EmplReqGrid" runat="server" Skin="Office2010Blue"
GridLines="None" AllowPaging="true" AllowSorting="true"
onexcelmlexportrowcreated="EmplReqGrid_ExcelMLExportRowCreated"
onexcelmlexportstylescreated="EmplReqGrid_ExcelMLExportStylesCreated"
onitemcommand="EmplReqGrid_ItemCommand" onitemcreated="EmplReqGrid_ItemCreated"
onitemdatabound="EmplReqGrid_ItemDataBound"
onneeddatasource="EmplReqGrid_NeedDataSource"
onpageindexchanged="EmplReqGrid_PageIndexChanged"
onpagesizechanged="EmplReqGrid_PageSizeChanged"
onpdfexporting="EmplReqGrid_PdfExporting"
onsortcommand="EmplReqGrid_SortCommand">
<ExportSettings FileName="EmplReqRpt" OpenInNewWindow="true" IgnorePaging="true" ExportOnlyData="true">
<Excel Format="ExcelML" FileExtension="xls"/>
<Pdf FontType="Subset" PaperSize="letter" />
</ExportSettings>
<MasterTableView AutoGenerateColumns="false" AllowMultiColumnSorting="true" >

<Columns>

<telerik:GridBoundColumn HeaderText="Eis-Id" DataField="PRI" UniqueName="PRI" ReadOnly="True" SortExpression="PRI" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>

<telerik:GridBoundColumn HeaderText="ReqNo" DataField="TRKNO" UniqueName="TRKNO" ReadOnly="True" SortExpression="TRKNO" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>

<telerik:GridBoundColumn HeaderText="Term-Id" DataField="TERMID" UniqueName="TERMID" ReadOnly="True" SortExpression="TERMID" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Start Date" DataField="TERMST" UniqueName="TERMST" ReadOnly="true" DataFormatString="{0:MM/dd/yyyy}" SortExpression="TERMST" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="End Date" DataField="TERMEND" UniqueName="TERMEND" ReadOnly="true" DataFormatString="{0:MM/dd/yyyy}" SortExpression="TERMEND" HeaderButtonType="TextButton">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn HeaderText="No of Periods" DataField="NUMP" UniqueName="NUMP" ReadOnly="True" SortExpression="NUMP" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>


<telerik:GridBoundColumn HeaderText="Req Status" DataField="APPRFLAG" UniqueName="APPRFLAG" ReadOnly="True" SortExpression="APPRFLAG" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>


<telerik:GridBoundColumn HeaderText="Rec Status" DataField="STATUS" UniqueName="STATUS" ReadOnly="True" SortExpression="STATUS" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Req Status Date" DataField="FORMDATE" UniqueName="FORMDATE" ReadOnly="True" DataFormatString="{0:MM/dd/yyyy}" SortExpression="FORMDATE" HeaderButtonType="TextButton" >
</telerik:GridBoundColumn>

<telerik:GridTemplateColumn HeaderText="Link to Form Button" UniqueName="ButtonColumn">
<ItemTemplate>
<asp:ImageButton ID="ReqFormBtn" ImageUrl="~/Image/update.jpg"
BackColor="transparent" ImageAlign ="Top"
ToolTip="update,re-submit or print the request" runat="server" CommandName="Redirect" />

</ItemTemplate>
</telerik:GridTemplateColumn>

</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle="True" EnablePostBackOnRowClick = "false">
<Selecting AllowRowSelect="false" />
</ClientSettings>
</telerik:RadGrid>

In code behind I press on Export to Excel button:

protected void ExporttoExcel_Click1(object sender, ImageClickEventArgs e)
{
try
{
if (!IsPostBack)
return;
RadGrid ReqInfoGrid = (RadGrid)EmpReqReport.FindItemByValue("EmployeeData").FindControl("EmplReqGrid");
ReqInfoGrid.DataSource = Session["dtGrid"];
ReqInfoGrid.DataBind();
ReqInfoGrid.MasterTableView.ExportToExcel();
}
catch (Exception ex)
{
throw;
}
}

For some reason excel spreadsheet not open instead I am getting error window:
'The file is corrupt and cannot be opened'.

Please help me to resolve this issue.
Thanks so much.
Princy
Top achievements
Rank 2
 answered on 18 Jul 2014
3 answers
88 views
Does the spell checker recognize plurals?
For Ex: forums. It is providing suggestion to change the text.
Any suggestions?
Marin Bratanov
Telerik team
 answered on 18 Jul 2014
3 answers
106 views
Hi

I have implemented rad grid with scrolling, and I have set grid width to 99% and height to 650px.
everything works fine till I resize any column in the grid.

once I resize the column grid looses its horizontal scroll bar and it expands the whole page with grid's width.

in turn scrollbar appears for web page.

Please help me to retain horizontal scroll for grid.

Thanks
Marin Bratanov
Telerik team
 answered on 18 Jul 2014
1 answer
88 views
Hi,

in my cause I have a RadCombobox with EnabledAutomaticLoadOnDemand = true and ItemsPerRequest = 10.
I can add a new RadComboBoxItem and have a postback on my page.

Now I have to set the new item after the postback as selected item.
The problem is, the new item is not in the first requested 10 items and combo.findItemByValue(value) will not find the item for me.
How can I find items not requested yet? I can see you guys have a solution for this because the filtering shows none requested items in the DropDown.

Maybe you can help me?

Thanks!

With kind regards
Michael
Shinu
Top achievements
Rank 2
 answered on 18 Jul 2014
6 answers
148 views
Hi,
I have added some custom header menus (e.g Export to CSV) to my RadGrid. They work fine with the MasterTable.

But when I right click on Detail Table header, same menus are displayed as master table.

I want to hide my custom menu when user right clicks Detail Table header.

I tried to check in HeaderContextMenu.OnClientShowing client event, but I am not able to get any property to confirm if it is Master Table or Detail Table.

Is there a way to Identify if header menu is being displayed for Master Table or Detail Table?

Thanks!!
Princy
Top achievements
Rank 2
 answered on 18 Jul 2014
1 answer
191 views
I have a RadButton that looks like this

<telerik:RadButton ID="btnCancelRegistration" runat="server" Width="691px" Height="144px"
                     SingleClick="False" NavigateUrl="<%$Resources:, btnCancelRegistrationResource1.NavigateUrl %>" ButtonType="LinkButton" Target="_blank" Text="Moved On?" AutoPostBack="False">
                     <Icon PrimaryIconCssClass="<%$Resources:, btnCancelRegistrationResource1.PrimaryIconClass %>" PrimaryIconWidth="700px" PrimaryIconHeight="150px" PrimaryIconLeft="0" PrimaryIconTop="0" />
                 </telerik:RadButton>


The button does bring up the specified URL, but it does not bring up a new page (as the Target="_blank" would indicate). Tested on Opera 24 and Firefox 33. Using .NET 4.5 / Rad 2014.2.618.45
Princy
Top achievements
Rank 2
 answered on 18 Jul 2014
6 answers
179 views
Hi,

I’m trying to program the context menu (client side) to
display different  menus based upon the
node that is clicked on.

So far I have managed to get the system to work out which
node its on:
 

            
var NodeType = args._node.get_attributes().getAttribute("type1");
 
if (NodeType == "position") {
     
}
else if (NodeType == "serial") {
}

 

But I’m having no success is determining how to change the
context menu – Any suggestions (I’m very new to javascript)

Shinu
Top achievements
Rank 2
 answered on 18 Jul 2014
10 answers
2.2K+ views
Is they some RadGrid equivalent for ASP.Net GridView's OnRowDataBound event?
Please point me to some examples.


Thanks
Asad
Jeremy
Top achievements
Rank 1
 answered on 18 Jul 2014
0 answers
83 views
Hello there,

im using radeditors to update news content. when i click in the radgrid on some row, it opens a jquery dialog and sets two radeditor using set_html(Preview and Content).

This works perfect in google chrome but not on IE and FF. the html field has the content, but the design field dont and i cant even type on it.

here's the code:
var varTitle = eventArgs.getDataKeyValue("title");
var varInitialDate = eventArgs.getDataKeyValue("initial");
var varEndDate = eventArgs.getDataKeyValue("end");
var varPreview = eventArgs.getDataKeyValue("prev");
var varContent = eventArgs.getDataKeyValue("content");
 *** Opens the dialog ***
$find('<%= Title.ClientID%>').set_value(varTitle);
$find('<%= ID.ClientID%>').get_textBox().control.set_value(varInitialDate);
$find('<%= ED.ClientID%>').get_textBox().control.set_value(varEndDate);
$find('<%= Preview.ClientID%>').set_html(varPreview);
$find('<%= Content.ClientID%>').set_html(varContent);

any ideas on what the problem is?

thanks





MikeS
Top achievements
Rank 1
 asked on 17 Jul 2014
3 answers
298 views
I can create different controls per column depending on data from code behind and it works.  

I want to create different controls per each row in code behind.
example:

                   <EditMode>
                    ColumnA             ColumnB
                    Row I:   RadComboBox         RadComboBox
                    Row II:  RadNumericTextBox   RadNumericTextBox
                    Row III: CheckBox            CheckBox
...

The problem is the Rad-grid Batch mode only have one Control in one Edit-template for each column, that means all the rows have the same Edit-template and control.

this I can do:


                ColumnA (RadComboBox)     ColumnB(RadNumericTextBox)
                Row I:   RadComboBox               RadNumericTextBox
                Row II:  RadComboBox               RadNumericTextBox
                Row III: RadComboBox               RadNumericTextBox

Is it possible to have Multiple Edit-templates per column or what is my alternatives? 
Konstantin Dikov
Telerik team
 answered on 17 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?