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

CommandItemSettings

9 Answers 359 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dick
Top achievements
Rank 1
Dick asked on 11 Nov 2009, 04:15 PM
I finally got Q3 upgrade installed and I am now trying to use the
<CommandItemSettings
                    ShowExportToWordButton="true"
                    ShowExportToExcelButton="true"
                    ShowExportToCsvButton="true"
                    ShowExportToPdfButton="true"
                    />

in my current application.  Intellisense says that these are not valid attributes of the CommandItemSettings element.  I have looked at your example code in your demo site and they work there just fine.  I copied your code into my grid definition and it does not work. What am I doing wrong?  How do I get the Command item buttons to appear in my RadGrids CommandItemDisplay area?

9 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Nov 2009, 08:08 AM
Hi Dick,

Since the intellisence does not recognize the attributes, I strongly feel that the old version is not replaced with the new one and you are working with the old DLL. Check the version of the dll file in your web-application's bin folder. If it is not Q3, then try copying the new DLL (located in the /bin  folder or /bin35 folder if you use the NET 3.5 build of the assembly) to your web-application's /bin folder in order to replace the old dll. 

Regards,
Shinu.
0
Pavlina
Telerik team
answered on 12 Nov 2009, 09:46 AM
Hello Dick,

For your convenience I prepared a sample demo which is working as expected with Q3 2009. Please
give it a try and let me know if you need additional assistance.

Best wishes,
Pavlina
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
Dick
Top achievements
Rank 1
answered on 12 Nov 2009, 04:48 PM
Thanks that fixed the issue.
0
cwk
Top achievements
Rank 2
answered on 14 May 2010, 05:33 AM
Hi,  I have added radwindow for adding new record,

<

 

CommandItemTemplate>

 

 

 

<a href="#" onclick="return ShowInsertForm();">Add New Record</a>

 

 

 

</CommandItemTemplate>

 

 


 

<CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true"

 

 

 

ShowExportToCsvButton="true" ShowExportToPdfButton="true" />

 

 


However, the export settings for excel pdf does not display after this addition, any advice/workaround?

Thanks
CWK 
0
Princy
Top achievements
Rank 2
answered on 14 May 2010, 06:40 AM
Hello,

One suggestion to accomplish this appearance is by using default commanditem with export buttons (instead of using CommandItemTemplate) and invoking the client method on clicking the "Add New Record" button. You could access the "Add New Record" button from code behind and hook the "OnClientClick" event as shown below.

C#:
 protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
      if (e.Item is GridCommandItem) 
        { 
            GridCommandItem cmditem = (GridCommandItem)e.Item; 
            LinkButton btn = (LinkButton)cmditem.FindControl("InitInsertButton"); 
            btn.OnClientClick = "return ShowInsertForm();"
        } 
    } 

 In the client handler, add the code for showing the window.

Java Script:
<script type="text/javascript"
    function ShowInsertForm() 
    { 
        // code for opening the window 
        return false
    } 
</script> 

Regards,
Princy.
0
cwk
Top achievements
Rank 2
answered on 14 May 2010, 09:27 AM
Hi, it works!

Thank you very much.

Regards
CWK
0
Andrew
Top achievements
Rank 1
Veteran
Iron
answered on 14 Jul 2010, 01:56 PM
how do i get the excel export to open a new window, instead of it using the current window
0
Shinu
Top achievements
Rank 2
answered on 15 Jul 2010, 08:26 AM
Hello Andrew,


RadGrid has a property "OpenInNewWindow" under ExportSettings section. Set the property to "True" in order to show the exported file in new window.

ASPX:
. . .
 <ExportSettings OpenInNewWindow="true">
 </ExportSettings>
 <MasterTableView CommandItemDisplay="Top" DataSourceID="SqlDataSource1">
     <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" />
. . .


-Shinu.
0
Andrew
Top achievements
Rank 1
Veteran
Iron
answered on 15 Jul 2010, 01:25 PM
thanks
Tags
Grid
Asked by
Dick
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pavlina
Telerik team
Dick
Top achievements
Rank 1
cwk
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Andrew
Top achievements
Rank 1
Veteran
Iron
Share this question
or