Hi
string text = tb.Text;
try to send me your code. I will correct it. :
Michael
"herman" <> wrote in message
news: om...
> Hi Michael:
>
> Thanks for your reply, however, when I am reading the text box value
> using your code, I get the same value as before. That is, I've the
> changed the value of the textbox from 0 to 1, but the value is still 0
> when I am reading it from the code, do you know why?
>
> "Michael Tkachev" <> wrote in message
news:<>...
> > foreach(DataGridItem di in DataGrid.Items)
> > {
> > if(di.ItemType == ListItemType.AlternatingItem || di.ItemType ==
> > ListItemType.Item)
> > {
> > TextBox tb = (TextBox)di.Cells[0].Controls[0];
> > //your code
> > }
> > }
> >
> >
> > "herman" <> wrote in message
> > news: m...
> > > Hi:
> > >
> > > I have a datagrid and I've created a itemtemplate column with textbox
> > > inside each row like the following:
> > >
> > > <asp:TemplateColumn HeaderText="New NIBS DS1s">
> > > <ItemTemplate>
> > > <asp:TextBox ID="txtNewNIBSDS1" Runat="server" MaxLength="10"
> > > Enabled="True" Visible="True" Width="200" ReadOnly="False"
> > > Text=""></asp:TextBox>
> > > </ItemTemplate>
> > > </asp:TemplateColumn>
> > >
> > > However, when I goto the onclick event of that image button, I can't
> > > read the text of the textbox. I read somewhere that I need to give
> > > the image button a itemcommand, and make it bind to the datagrid so
> > > that I can read the datagrid's data, how can I do that?
> > >
> > > Thanks