Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Kristopher Davis   on Oct 19 In Asp.net Category.

  
Question Answered By: Heru Chalthoum    on Oct 19

i've followed your instructions for this the editpart but have still a
problem...

when i click on the button  edit, i get the edit text  fields but in stead of the
real name of the movie i get <% DataBinder.eval(...)%> in the textbox
How can i avoid that?

BTW: first problem  is solved, but i don't know exactly how, i changed some stuff
like handles datagrid1.itemcommand, and now it works just fine

<asp:TemplateColumn HeaderText="Titel">
<ItemTemplate>
<asp:Label ID="lblmovieName" Text='<%#
DataBinder.Eval(Container.DataItem, "movieName") %>' Runat="server"/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtmovieName" Width="300" Text='<%
DataBinder.Eval(Container.DataItem, "movieName") %>' Runat="server"/>
</EditItemTemplate>
</asp:TemplateColumn>

Having said that this doesn't look right

DataGrid1.EditItemIndex = -1
BindGrid()
DataGrid1.EditItemIndex = objARgs.Item.ItemIndex

it should be

DataGrid1.EditItemIndex = -1
DataGrid1.EditItemIndex = objARgs.Item.ItemIndex
BindGrid()

else you don't bind till th enext time round, well you do, but you bind to -1.

In your current code  click the same edit button twice and it will work  ( I
suspect).

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Button in datagrid Or get search suggestion and latest updates.


Tagged: