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

Gridview sort image issue

3 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rajneesh
Top achievements
Rank 2
Rajneesh asked on 10 Aug 2011, 07:12 AM
Hi,
I am using Rad Grid and using Template Field I am doing Filtering and sorting but issue arises at the time of sorting that small sort image comes below text i want it right side of text i tried many combination in style-sheet but no success.

My template column is as:
<telerik:GridTemplateColumn ReadOnly="true" AllowFiltering="false"  GroupByExpression="CloseOutType Group By CloseOutType" DataField="CloseOutType" SortExpression="CloseOutType" >
                   <HeaderTemplate>
                   <table>
                   <tr>
                   <td style="width:20%"><asp:Image ID="imgCloseOutType" ImageUrl="~/Images/closeout_type.png" runat="server" /></td>
                   <td style="width:80%">
                   <asp:Button  ID="btnheaderCloseOutType" Title="Sort by Interim/Workbook"  runat="server"
                        CommandName="Sort" CssClass="LabelViewForButton" CommandArgument="CloseOutType" Text="Interim/Workbook" />             
                   </td>
                   </tr>
                   </table>
                 </HeaderTemplate>
                   <ItemTemplate>
                      <div style="text-align:center">
                      <asp:Label ID="lblCloseOutType" runat="server" Text='<%# eval("CloseOutType") %>'></asp:Label>
                      </div>                   
                   </ItemTemplate>
                   </telerik:GridTemplateColumn>

And style Sheet as:
/*sorting, reordering*/
 
.RadGrid_Vista .rgHeader .rgSortAsc
{
    background-position:3px -248px;
    height:10px;  
}
 
.RadGrid_Vista .rgHeader .rgSortDesc
{
    background-position:3px -198px;
    height:10px;
}
 
.GridReorderTop_Vista,
.GridReorderBottom_Vista
{
    width:9px !important;
    height:9px !important;
    margin-left:-5px;
    background:0 0 no-repeat url('Grid/sprite.gif');
}
 
.GridReorderBottom_Vista
{
    background-position:0 -50px;
}

I am attaching both screens for better understanding. (See Attachment)

Thanks....



3 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 10 Aug 2011, 07:23 AM
Hello,

please set Header width.

<telerik:GridTemplateColumn>
 <HeaderStyle Width="200px" /> 
...
...

let me know its working or not.


Thanks,
Jayesh Goyani
0
Rajneesh
Top achievements
Rank 2
answered on 10 Aug 2011, 07:40 AM
Thanks Jayesh for reply.
I have tried as you said but no joy. Result is same.
<telerik:GridTemplateColumn ReadOnly="true" AllowFiltering="false"  GroupByExpression="CloseOutType Group By CloseOutType" DataField="CloseOutType" SortExpression="CloseOutType" >
                       <HeaderStyle Width="350px" /> 
                   <HeaderTemplate>
                   <table>
                   <tr>
                   <td style="width:20%"><asp:Image ID="imgCloseOutType" ImageUrl="~/Images/closeout_type.png" runat="server" /></td>
                   <td style="width:80%">
                   <asp:Button  ID="btnheaderCloseOutType" Title="Sort by Interim/Workbook"  runat="server"
                        CommandName="Sort" CssClass="LabelViewForButton" CommandArgument="CloseOutType" Text="Interim/Workbook" />             
                   </td>
                   </tr>
                   </table>
                 </HeaderTemplate>

Result is as attachment.

Please see...

0
Rajneesh
Top achievements
Rank 2
answered on 10 Aug 2011, 07:42 AM
Hi,
Can anyone help me please........
Tags
Grid
Asked by
Rajneesh
Top achievements
Rank 2
Answers by
Jayesh Goyani
Top achievements
Rank 2
Rajneesh
Top achievements
Rank 2
Share this question
or