Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Every,
I am so lucky to be a member of Code project.Thanks guys for all the support.

Today i am stuck with a problem in telerik rad grid view. Can any body has idea how to show auto serial number in my rad grid view.

thanks in advance.
Posted

Did you tried looking here:
Telerik RadGrid Forum[^]
Posting here is fine. Might be someone can help but I had found that specific questions related to 3rd party is answered more quickly and accurately at respective forums.

Based on what you ask, there is a high chance that it might be already documented there or someone must have asked it.
 
Share this answer
 
Comments
Saumya J Pandey 23-May-11 1:35am    
yeah S Mewara... i tried and looked there.. it worked.. thanks alot.
Sandeep Mewara 23-May-11 2:36am    
:thumbsup:
Hi you can this:

C#
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
       {
           if (e.Item is GridDataItem)
           {
               GridDataItem dataItem = (GridDataItem)e.Item;
               dataItem["RowNumber"].Text = Convert.ToString(grdState.PageSize * grdState.CurrentPageIndex + e.Item.ItemIndex + 1);

           }
       }


HTML
<columns>
    <telerik:gridboundcolumn uniquename="RowNumber" xmlns:telerik="#unknown"></telerik:gridboundcolumn></columns>
 
Share this answer
 
As vkeyan has posted, Add a column to Radgrid as

XML
<telerik:GridTemplateColumn HeaderText="#" UniqueName="RowNumber">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblRowNumber" Width="50px" Text='<%# Container.DataSetIndex+1 %>'></asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
 
Share this answer
 
<telerik:gridtemplatecolumn allowfiltering="false" headerstyle-width="30px" headertext="S.L.No" xmlns:telerik="#unknown">
<itemtemplate>

<%# Container.DataSetIndex+1 %>












Regards:

Vijayendrean Karthikeyan
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900