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

[Solved] ! Error On Group on drag and drop

3 Answers 169 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 1
Pierre asked on 27 Mar 2008, 11:48 PM
Hi,
I try to grouping by expression on drag and drop. I use the expression from documentation as codebehind C#. But No solution only errors.
What are the problem?

ASPX
<radGrid:RadGrid ID="gridContacts" OnNeedDataSource="gridContacts_NeedDataSource" AutoGenerateColumns="false" SkinsPath="~/Sitefinity/Admin/Themes/Default/Skins/Grid" Skin="Sitefinity" 
                    OnItemCommand="ContactsGrid_Command" runat="server" 
                    GridLines="None" Width="95%" AllowPaging="true" AllowSorting="True" PageSize="25" ShowGroupPanel="true" OnGroupsChanging="RadGrid1_GroupsChanging" GroupingEnabled="true" ClientSettings-AllowDragToGroup"true" > 
                    <ClientSettings AllowDragToGroup="True" /> 
                    <AlternatingItemStyle BackColor="#FFA500"  /> 
                    <ItemStyle BackColor="#FFFFFF"  /> 
                    <GroupPanel PanelStyle-Height="25px"/>  
                    <HeaderStyle Height="25px" BackColor="#637783"  /> 
                    <GroupHeaderItemStyle Height="20px" /> 
                      
                    <MasterTableView DataKeyNames="NbClients" AllowMultiColumnSorting="true" > 
                        <Columns> 


I use the Code from Documentation : Grouping in Drag and drop

Message d'erreur du compilateur: CS0019: L'opérateur '==' ne peut pas Ãªtre appliqué aux opérandes de type 'Telerik.Web.UI.GridGroupsChangingAction' et 'Telerik.WebControls.GridGroupsChangingAction'  
 
Erreur source:  
 
   
 
Ligne 204 :        //Expression is added (by drag/grop on group panel)  
Ligne 205 :  
Ligne 206 :        if (e.Action == GridGroupsChangingAction.Group)  
Ligne 207 :        {  
Ligne 208 :            if (e.Expression.GroupByFields[0].FieldName != "NbClients")  
   
 
 Without == but only =
New ERROR
Message d'erreur du compilateur: CS0200: La propriété ou l'indexeur 'Telerik.Web.UI.GridGroupsChangingEventArgs.Action' ne peut pas Ãªtre assigné -- il est en lecture seule  
 
Erreur source:  
 
   
 
Ligne 204 :        //Expression is added (by drag/grop on group panel)  
Ligne 205 :  
Ligne 206 :        if (e.Action = GridGroupsChangingAction.Group)  
Ligne 207 :        {  
Ligne 208 :            if (e.Expression.GroupByFields[0].FieldName != "NbClients")  
   
 

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 28 Mar 2008, 07:11 AM
Hello Pierre,

It seems that you have a mix between Telerik.WebControls.RadGrid and Telerik.Web.UI.RadGrid classes:

'Telerik.Web.UI.GridGroupsChangingAction' et 'Telerik.WebControls.GridGroupsChangingAction'

Please use one of them only!

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Pierre
Top achievements
Rank 1
answered on 28 Mar 2008, 12:04 PM
Hi,

Thanks, you are right, but I use Sitefinity, how to select the SkinPath needs in Sitefinity using RadGrid prometeus, No skinPath only Skin and SkinID.

Regards
0
Pepi
Telerik team
answered on 28 Mar 2008, 03:40 PM
Hello Pierre,

You need to set the full name for the GridGroupsChangingAction parameter in RadGrid1_GroupsChanging event handler. If you want to use RadGrid control, RadGrid1_GroupsChanging method should look as follows:

private void RadGrid1_GroupsChanging(object source, Telerik.WebControls.GridGroupsChangingEventArgs e) 
   ... 

Here is the declaration for RadGrid "Prometheus":

 private void RadGrid1_GroupsChanging(object source, Telerik.Web.UI.GridGroupsChangingEventArgs e) 
   ... 

Hope this helps.

Best wishes,
Pepi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Pierre
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Pierre
Top achievements
Rank 1
Pepi
Telerik team
Share this question
or