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

want to find the vlaue in item tempalte

1 Answer 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 06 Jan 2011, 03:11 PM
 <telerik:GridTemplateColumn DataField="GamePrice" HeaderText="Price" SortExpression="GamePrice"
                                    HeaderStyle-HorizontalAlign="Center" UniqueName="GamePrice" AutoPostBackOnFilter="True"
                                    FilterControlWidth="40px" ShowFilterIcon="false" CurrentFilterFunction="Contains">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "GamePrice", "{0:C}")%>
                                        <%--<asp:Label ID="lblGamePrice" runat="server" Text='<%#  Eval("GamePrice")%>'></asp:Label>--%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtGamePrice" runat="server" onkeydown="return isNumericPrice(event.keyCode);"
                                            TabIndex="5" Text='<%# Eval("GamePrice")%>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="reqFieldValGamePrice" runat="server" ErrorMessage="RequiredFieldValidator"
                                            ControlToValidate="txtGamePrice" Text="Please enter Game price."></asp:RequiredFieldValidator>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>

Hello i want to find the value in itemtemplate

  if (e.CommandName == "Edit")
            {
                if (ds != null)
                {
                    grdGameInfo.DataSource = ds;
                    grdGameInfo.DataBind();


                    GridDataItem eItem = (GridDataItem)e.Item;
                    string gameGID = Convert.ToString(((Label)eItem.FindControl("lblGameGID")).Text);
                    string oldGameName = Convert.ToString(((Label)eItem.FindControl("lblGameName")).Text);
                  string oldGamePrice = Convert.ToString(e.Item.DataItem );

but oldgameprice contains null..

How find ?


                 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 06 Jan 2011, 04:04 PM
Hi Rahul,

I suggest that you go through the online resources below:
http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/accessingcellsandrows/defaultcs.aspx

Best wishes,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Rahul
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or