or
<telerik:RadAjaxPanel ID="RP1" runat="server" Width="100%"> <br /> <table class="style2"> <tr> <td align="center" width="33%"> <asp:Label ID="lblUpload" runat="server" ForeColor="#000099" Text="Uploaded" Visible="False"></asp:Label> </td> <td align="center" width="33%"> </td> <td align="center" width="33%"> <asp:Label ID="lblProcessed" runat="server" ForeColor="#000099" Text="Imported" Visible="False"></asp:Label> </td> </tr> <tr> <td align="center" valign="top" width="50%"> <telerik:RadListBox ID="UploadListBox" runat="server" Visible="False" Width="350px" AllowDelete="True" TransferToID="ProcessedListBox"> <ButtonSettings TransferButtons="All"></ButtonSettings> </telerik:RadListBox> </td> <td align="center" valign="top" width="50%"> <telerik:RadButton ID="RadButton1" runat="server" onclick="RadButton1_Click" Text="Transfer to Database"> </telerik:RadButton> </td> <td align="center" valign="top" width="50%"> <telerik:RadListBox ID="ProcessedListBox" runat="server" Visible="False" Width="350px"> <ButtonSettings TransferButtons="All"></ButtonSettings> </telerik:RadListBox> </td> </tr> </table> </telerik:RadAjaxPanel>protected void RadButton1_Click(object sender, EventArgs e) { { int tcount = UploadListBox.Items.Count; if (tcount < 1) { lblMessage.Text= "You must have files to process."; return; } int increment = 100 / tcount; int completed = 0; string pfile; string[] fileparts; for (int i = 0; i < (tcount); i++) { string filetype; InitMstrVariables(); InitFGVariables(); InitTransactionSet(); pfile = UploadListBox.Items[0].Value.ToString(); fileparts = pfile.Split('_'); MstrType = Right(fileparts[1], 1).ToUpper(); Batch = Convert.ToInt32(fileparts[0]); MstrYearMonth = Convert.ToInt32(Left(fileparts[3], 6)); DateCreated = StrToDate(fileparts[3]); filetype = Left(fileparts[1], 3); if (filetype == "834") { DeleteBatch834(); ProcessFile834(pfile); } else if (filetype == "820") { DeleteBatch820(); ProcessFile820(pfile); } var item = new Telerik.Web.UI.RadListBoxItem(); item.Value = pfile; item.Text = pfile; UploadListBox.Transfer(UploadListBox.Items[0], UploadListBox, ProcessedListBox); File.Delete(filepath + pfile); completed = completed + increment; } } }protected void ButtonClose_Click(object sender, EventArgs e){ RadTabStrip rts = (RadTabStrip)this.Parent.FindControl("rtsDQEApplication"); RadTab currentTab = rts.InnermostSelectedTab; if (currentTab != null) { IRadTabContainer owner = currentTab.Owner; owner.Tabs.Remove(currentTab); RadMultiPage rmp = (RadMultiPage)this.Parent.FindControl("rmpDQEApplication"); rmp.PageViews.RemoveAt(rmp.SelectedIndex); }}Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) If TypeOf e.Item Is GridDataItem Then Dim item As GridDataItem = DirectCast(e.Item, GridDataItem) Dim strImageUrl1 As String = item.GetDataKeyValue("Ship_Photo_1").ToString() DirectCast(item("Ship_Photo_1").Controls(16), Image).ImageUrl = "http://admin.recris.info/" + strImageUrl1.Replace("~/", "") Dim strImageUrl As String = item.GetDataKeyValue("Ship_Photo_2").ToString() DirectCast(item("Ship_Photo_2").Controls(17), Image).ImageUrl = "http://admin.recris.info/" + strImageUrl.Replace("~/", "") Dim strImageUrl2 As String = item.GetDataKeyValue("Accident_Photo_1").ToString() DirectCast(item("Accident_Photo_1").Controls(18), Image).ImageUrl = "http://admin.recris.info/" + strImageUrl2.Replace("~/", "") Dim strImageUrl3 As String = item.GetDataKeyValue("Accident_Photo_2").ToString() DirectCast(item("Accident_Photo_2").Controls(19), Image).ImageUrl = "http://admin.recris.info/" + strImageUrl3.Replace("~/", "") End If End Sub<telerik:GridImageColumn DataImageUrlFields="Ship_Photo_1" HeaderText="Ship Photo 1" ImageAlign="Left" ImageHeight="" ImageWidth="150px" UniqueName="Ship_Photo_1" AllowFiltering="False"> </telerik:GridImageColumn> <telerik:GridImageColumn DataImageUrlFields="Ship_Photo_2" HeaderText="Ship Photo 2" ImageAlign="Left" ImageHeight="" ImageWidth="150px" UniqueName="Ship_Photo_2" AllowFiltering="False"> </telerik:GridImageColumn> <telerik:GridImageColumn DataImageUrlFields="Accident_Photo_1" HeaderText="Accident Photo 1" ImageAlign="Left" ImageHeight="" ImageWidth="150px" UniqueName="Accident_Photo_1" AllowFiltering="False"> </telerik:GridImageColumn> <telerik:GridImageColumn DataImageUrlFields="Accident_Photo_2" HeaderText="Accident Photo 2" ImageAlign="Left" ImageHeight="" ImageWidth="150px" UniqueName="Accident_Photo_2" AllowFiltering="False"> </telerik:GridImageColumn>Hi,
I need to export radgrid to CSV and Excel as well as print .One particular column of the grid is a datetime column .But in the grd_DataBound event I am changing the value of that field to either Y or null for business purpose(e.Item.Cells[4].Text = "Y";).
This is only for showing to the user and the column is bound to datetime field.
While exporting CSV exports the Y or null but excel exports the date time value. While print also I am getting Y or null value.
Could anybody please suggest a way to show cell text i.e. ‘Y’ in Excel also …?
grd.ExportSettings.ExportOnlyData = true; grd.ExportSettings.IgnorePaging = true; grd.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML; grd.ExportSettings.OpenInNewWindow = true;
Regards,
Soumya