Yes it is a dataset. However, how can i update the
dataset with the new value? The tricky part is we are
trying to avoid the single row edits so we don't have
an "editcommandbutton". Our thought was to spin through
the items in the datagrid page, update the dataset, then
bind the grid again. Here is what i am trying to do in
the code behind.
For iItemCount = 0 To LaborGrid.Items.Count - 1
LaborGrid.SelectedIndex = iItemCount
Debug.Write(LaborGrid.SelectedIndex & vbCrLf)
With LaborGrid.SelectedItem
Debug.Write("selecteditem :" &
LaborGrid.SelectedItem.Cells(8).Text & vbCrLf)
txtbox = LaborGrid.SelectedItem.FindControl
("txtPeriod1")
'value = txtbox.Text
'Debug.Write("value :" & value & vbCrLf)
End With
Next
I get my selecteditem number ok, but I can't get the new
number. I am missing something here, something that
the "editcommandbutton" would do. We are using a non-grid
button because the user wants to be able to update any
column of any row before updating. Is it possible?
-----Original Message-----
If you are using a DataSet - - you need to first, update
the dataset beforeyou 'spin through' the datagrid (I assume you mean
Dataset - - otherwise - -show us how you're doing it)
David Wier
MCP, MVP ASP.NET, ASPInsider
http://aspnet101.com
http://aspexpress.com
"ALPO" <an*******@discussions.microsoft.com> wrote in
messagenews:06****************************@phx.gbl... We have a datagrid built using template columns. Many
are text boxes. These text boxes are bound to a datasource
as follows: <ItemTemplate>
<asp:TextBox
id="txtPeriod1"
runat="server"
columns="1"
Font-Size="8pt"
text='<%# Container.dataitem
("LaborHoursAm")%>' >
</asp:TextBox>
</ItemTemplate>
My problem arises when I change the data (like changing
txtPeriod1 from 80 to 30) in the column and try to
retrieve it. When I spin through the datagrid values I
see the "80", the bound value, not the "30" the value I want
to change it too. Is there a way I can accomplish this?
.