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

Telerik:telerik:GridTemplateColumn

1 Answer 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chaitanya
Top achievements
Rank 1
Chaitanya asked on 26 Jun 2012, 07:42 AM

We have a RadGrid with some telerik:GridTemplateColumns. We get a datasource and bind the grid. For first page grid behavour is consistent. But after page change, other columns in grid gets new values but itemtemplate columns persist the values from first page.

Grid Design Code :

   

 

<

 

 

telerik:RadGrid ID="rgvTest" runat="server" AllowFilteringByColumn="false"

 

 

 

 

 

 

 

 

AllowPaging="True" AllowSorting="True" MasterTableView-ShowHeadersWhenNoRecords="false"

 

 

 

 

 

 

 

 

AllowCustomPaging="false" AutoGenerateDeleteColumn="false" AllowMultiRowSelection="true"

 

 

 

 

 

 

 

 

AutoGenerateEditColumn="false" GridLines="None" ShowGroupPanel="True" OnItemDataBound="rgvTest_ItemDataBound"

 

 

 

 

 

 

 

 

OnPageIndexChanged="rgvTest_PageIndexChanged" OnSortCommand="rgvTest_SortCommand"

 

 

 

 

 

 

 

 

ClientSettings-ClientEvents-OnRowDblClick="GridRowDoubleclick" >

 

 

 

 

<

 

 

Columns>

 

 

 

<telerik:GridTemplateColumn HeaderImageUrl="../Images/priority_icon.png" UniqueName="Priority1"

 

 

 

 

 

 

 

 

HeaderTooltip="Priority">

 

 

 

 

 

 

 

 

<ItemStyle Width="20px" Wrap="false" />

 

 

 

 

 

 

 

 

<HeaderStyle Width="20px" Wrap="false" />

 

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

 

<asp:Image ID="PriorityImage" runat="server" />

 

 

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

 

</telerik:GridTemplateColumn>
</Column>

 

 

 

 

Considering page size is set to 10.
After debugging , i got that OnItemdataBound event is called for first 10 records on load.
And after page change, it is called for 20 times but insted for 20 record of first page and second page, it is called twice for first 10 records... Strange but true.
If anyone has any idea abot this please help me out.

1 Answer, 1 is accepted

Sort by
0
Chaitanya
Top achievements
Rank 1
answered on 26 Jun 2012, 09:00 AM
I got the resolution. Actually while binding the items we were using Item.ItemIndex property instaed of Item.dataIndex. ItemIndex value varies from 0-10 and DataIndex varies from 0 - length of DataIndex... Where 10 is page xise of grid.
Tags
Grid
Asked by
Chaitanya
Top achievements
Rank 1
Answers by
Chaitanya
Top achievements
Rank 1
Share this question
or