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

Issue With Grid Grouping Drag and Drop

2 Answers 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
saravanakumar subramaniam
Top achievements
Rank 1
saravanakumar subramaniam asked on 04 Aug 2011, 10:37 AM

Hi all,
Please hlelp on this issue , It is very urgent .
I need to do goup by (By Drag and drop )  . When I am using GridBoundColumn It is working fine. but when i am using

 GridTemplateColumn  with HeaderTemplate . I am not able to do drag and drop columns to do groupby and sorting the column also.I am not binding values in the header template . I am just arranging with a label with text value set directly and image.

Whether Is it mandatroy that i must bind some thing to the label in header template.  I couldnt understand why it is not working .

Here is code i am using

<telerik:GridTemplateColumn GroupByExpression="CloseOutType" DataField="CloseOutType"  SortExpression="CloseOutType" HeaderStyle-CssClass="xmediumcolsize"
              <HeaderTemplate
                 <asp:Image ID="imgCloseOutType" ImageUrl="~/Images/closeout_type.png" runat="server" /> 
                <asp:Label ID="lblheaderCloseOutType" runat="server" Text="Interim/Workbook" ></asp:Label
                 <%--  <asp:HiddenField ID="HiddenField1"  Value='<%# eval("CloseOutType") %>' runat="server" />--%> 
              </HeaderTemplate
              <ItemTemplate
                   <asp:Label ID="lblCloseOutType" runat="server" Text='<%# eval("CloseOutType") %>'></asp:Label
               </ItemTemplate
              </telerik:GridTemplateColumn>

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Aug 2011, 10:59 AM
Hello,

Make sure that you have set GroupByExpressions for GridTemplateColumn which worked as expected.
aspx:
<telerik:GridGroupByExpression>
    <SelectFields>
        <telerik:GridGroupByField FieldName="CloseOutType" >
        </telerik:GridGroupByField>
    </SelectFields>
    <GroupByFields>
        <telerik:GridGroupByField FieldName="CloseOutType" >
        </telerik:GridGroupByField>
    </GroupByFields>
</telerik:GridGroupByExpression>

Thanks,
Princy.
0
saravanakumar subramaniam
Top achievements
Rank 1
answered on 04 Aug 2011, 11:37 AM
Hi Princy ,
Thanks . Grouping worked by specifiying Group By Expressions . But Still I am facing issues with sorting . I am not able to do sorting

I dont know why ... I have given SortExpression="JobID"  and DataField="JobID" but I have not binded any values in the header template
<telerik:GridTemplateColumn GroupByExpression="JobID Group By JobID"  ReadOnly="true" SortExpression="JobID" DataField="JobID"  HeaderStyle-CssClass="smallcolsize">
                   <HeaderTemplate>
                      <asp:Image ID="imgJobID" ImageUrl="~/Images/job_id.png" runat="server" />
                   <asp:Label ID="lblheaderJobID" runat="server" Text="Job ID"></asp:Label>
               
                   </HeaderTemplate>
                   <ItemTemplate>
                   <div style="text-align:center">
                   <asp:Label ID="lblJobID" runat="server" Text='<%# eval("JobID") %>'></asp:Label>
                   </div>
                     
                   </ItemTemplate>
                   </telerik:GridTemplateColumn>
Tags
Grid
Asked by
saravanakumar subramaniam
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
saravanakumar subramaniam
Top achievements
Rank 1
Share this question
or