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

telerik:RadGrid with updatepanel

5 Answers 258 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gaurav
Top achievements
Rank 1
Gaurav asked on 01 Jun 2011, 01:24 PM
Hi Telerik

I am using telerik:GridGroupByExpression.

My code is following..........

<telerik:RadGrid AlternatingItemStyle-CssClass="even" Width="100%" OnItemCreated="radGridComments_ItemCreated"
                   OnColumnCreated="radGridComments_ColumnCreated" OnItemDataBound="radGridComments_ItemDataBound"
                   ID="radGridComments" runat="server" AutoGenerateColumns="true" GridLines="none">
                   <mastertableview groupsdefaultexpanded="true">
               <GroupByExpressions>
                   <telerik:GridGroupByExpression>
                       <SelectFields>
                        <telerik:GridGroupByField FieldName="ItemName" HeaderText="" />
                       </SelectFields>
                       <GroupByFields>
                       <telerik:GridGroupByField FieldName="ItemName" SortOrder="Ascending" />
                       </GroupByFields>
                   </telerik:GridGroupByExpression>
               </GroupByExpressions>
           </mastertableview>
                   <clientsettings>
               <Resizing ResizeGridOnColumnResize="false" AllowColumnResize="true" />
           </clientsettings>
               </telerik:RadGrid>

It display fine on page load as following.



As soon as I click on export, export to excel is working fine. but the data is now displaying like



Please see the GridGroupByField in both images. Please look in to this issue. I don't want GridGroupByField name like with

"ItemName:" it must be same as before like "Please indicate the region in which you currently work."



Thanks
Gaurav

5 Answers, 1 is accepted

Sort by
0
Gaurav
Top achievements
Rank 1
answered on 02 Jun 2011, 05:44 AM
Hi Telerik

I am waiting for your reply..

Thanks
Gaurav
0
Shinu
Top achievements
Rank 2
answered on 02 Jun 2011, 06:54 AM
Hello Gaurav,

Try the following code snippet in order to hide the groupheader when exporting.
C#:
protected void Button1_Click(object sender, EventArgs e)
   {
       RadGrid1.ExportSettings.ExportOnlyData = true;
       RadGrid1.ExportSettings.OpenInNewWindow = true;
       foreach (GridGroupHeaderItem groupItem in RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader))
       {
           groupItem.Visible = false;
       }
       RadGrid1.MasterTableView.ExportToExcel(); 
   }

Thanks,
Shinu.
0
Gaurav
Top achievements
Rank 1
answered on 02 Jun 2011, 09:21 AM
Hi Telerik

There is no problem in exporting. I think you are not getting my problem. My problem is.. when I click on export button, export is done in proper way but the problem is that grid is binding again and the gridgroup filed name is replaced with Field Name + "Text of Group field name(which I created dynamically on ItemDataBound. Please see the images. ( these images are not from excel, its radgrid)

Thanks
Gaurav
0
Gaurav
Top achievements
Rank 1
answered on 03 Jun 2011, 05:14 AM
Hi Telerik

I am waiting for your reply..

Thanks
Gaurav
0
Iana Tsolova
Telerik team
answered on 08 Jun 2011, 09:04 AM
Hi Gaurav,

If the grid export finishes properly, as a result you should receive the exported file and the page with the grid should not change. It should be the same as before you clicked the export button.
Can you send us a video showing what happens in your case?

Regards,
Iana
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Gaurav
Top achievements
Rank 1
Answers by
Gaurav
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Iana Tsolova
Telerik team
Share this question
or