This is a migrated thread and some comments may be shown as answers.

[Solved] RadGrid images disabled after Export to Word

8 Answers 230 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nishat Mazhar
Top achievements
Rank 1
Nishat Mazhar asked on 01 Feb 2010, 06:11 PM
When i export to "Word/CSV/Excel" the images on the grid are getting disabled. I have a RadGrid with FilteringByColumn enabled. This makes the grid to display a Filtering Menu which has a text box and an image button which can be clicked to filter. I also have buttons which allows the user to click and download to different formats. Once i download, the filtering image button gets disabled and does not show the filtering menu. Please can anybody show me how to enable the Filtering Menu.

8 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 01 Feb 2010, 06:50 PM
Hello Nishat,

Please post or attach your code so we can examine your approach. In the meantime you can try to reproduce the problem in our online demo:
MS Excel/MS Word/CSV

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Nishat Mazhar
Top achievements
Rank 1
answered on 01 Feb 2010, 07:03 PM

 

//1. Button event to handle Word Export
void
btnDownloadToWord_Click(object sender, EventArgs e)

 

{

Export(

"Word");

 

}

//2. Export Function

 

 

private void Export(string exportTo)

 

{

//Replace Hyperlink column with a Template Column.

 

for (int i = 0; i < RadGrid1.MasterTableView.Columns.Count; i++)

 

{

 

GridColumn column = RadGrid1.MasterTableView.Columns[i];

 

 

if (column is GridHyperLinkColumn)

 

{

 

string columnname = column.UniqueName;

 

 

GridTemplateColumn newcolumn = new GridTemplateColumn();

 

newcolumn.UniqueName = columnname +

"Link";

 

newcolumn.HeaderText = column.HeaderText;

RadGrid1.MasterTableView.Columns.AddAt(column.OrderIndex - 1, newcolumn);

i++;

column.Visible =

false;

 

}

}

RadGrid1.MasterTableView.AllowSorting =

false;

 

RadGrid1.MasterTableView.AllowPaging =

false;

 

RadGrid1.MasterTableView.AllowFilteringByColumn =

true;

 

RadGrid1.Rebind();

 

for (int i = 0; i < RadGrid1.MasterTableView.Columns.Count; i++)

 

{

 

GridColumn column = RadGrid1.MasterTableView.Columns[i];

 

 

if (column is GridHyperLinkColumn)

 

{

 

string columnname = column.UniqueName;

 

 

foreach (GridItem item in RadGrid1.MasterTableView.Items)

 

{

 

if (item is GridDataItem)

 

{

 

GridDataItem dataItem = (GridDataItem)item;

 

 

string button = "";

 

 

foreach (Control Link in dataItem[columnname].Controls)

 

 

if (Link is HyperLink)

 

button = ((

HyperLink)Link).Text;

 

 

Literal literal = new Literal();

 

literal.Text = button;

dataItem[columnname +

"Link"].Controls.Add(literal);

 

}

}

}

}

 

switch (exportTo)

 

{

 

case "Word":

 

RadGrid1.MasterTableView.ExportToWord();

 

break;

 

 

case "Excel":

 

RadGrid1.MasterTableView.ExportToExcel();

 

break;

 

 

case "CSV":

 

RadGrid1.MasterTableView.ExportToCSV();

 

break;

 

}

 

 

}

0
Nishat Mazhar
Top achievements
Rank 1
answered on 03 Feb 2010, 04:35 PM
Telerik team, Please can you help....
0
Daniel
Telerik team
answered on 03 Feb 2010, 05:43 PM
Hello Nishat,

Please try to modify your button click event this way:
void btnDownloadToWord_Click(object sender, EventArgs e)
{
    //Export("Word");
    RadGrid1.MasterTableView.ExportToWord();
}

Let me know whether this helps.

Best regards,
Daniel
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Nishat Mazhar
Top achievements
Rank 1
answered on 03 Feb 2010, 07:05 PM
No. This did not help. I am still not able to filter columns after Exporting. When i click on the filter image button it does not open the menu.
0
Daniel
Telerik team
answered on 03 Feb 2010, 09:59 PM
Hello Nishat,

I'm afraid I ran out of ideas as to what could be wrong - this is not a common problem.
Could you please provide a runnable version of your project so I can debug it locally? You can attach it to a formal support ticket (with reference to this thread).

Best regards,
Daniel
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Nishat Mazhar
Top achievements
Rank 1
answered on 03 Feb 2010, 11:05 PM
Thanks Daniel. But were you able to reproduce this problem in your test application?
Thanks
0
Daniel
Telerik team
answered on 08 Feb 2010, 09:01 PM
Hello Nishat,

Unfortunately we couldn't reproduce the problem on our end. In most of the cases we could suggest a workaround if we have a runnable project that demonstrates the problem.

I will do my best to provide a fix for this behavior if you could attach a runnable demo.

Best regards,
Daniel
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Grid
Asked by
Nishat Mazhar
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Nishat Mazhar
Top achievements
Rank 1
Share this question
or