Link to home
Start Free TrialLog in
Avatar of ChanderMadhavi
ChanderMadhavi

asked on

datagridcommand brings up a empty row

Hi
I am trying to create a datagrid to update a table. When I click on the edit link/button a grid with a headers is brought up. There are no text boxes to click. I am pasting the code below. Could someone please help.

Private Sub dgLineFill_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgLineFill.EditCommand
        dgLineFill.EditItemIndex = Int32.Parse(e.Item.ItemIndex)
        dgLineFill.DataBind()
 End Sub
'this is in pageload
 If Not IsPostBack Then

            daLineFill.Fill(dsLineFill1, "lineFill")
            dgLineFill.DataSource = dsLineFill1
            dgLineFill.DataMember = "lineFill"
            dgLineFill.DataBind()
            'dsLineFill1.AcceptChanges()
        End If

<asp:DataGrid id="dgLineFill" runat="server" Height="136px" Width="272px" DataSource="<%# dsLineFill1 %>" DataKeyField="LineFillID" DataMember="LineFill" AutoGenerateColumns="False">
                        <Columns>
                              <asp:BoundColumn DataField="LineFillID" HeaderText="LineFillID"></asp:BoundColumn>
                              <asp:BoundColumn DataField="LineID" HeaderText="LineID"></asp:BoundColumn>
                              <asp:BoundColumn DataField="MonthYear" HeaderText="MonthYear"></asp:BoundColumn>
                              <asp:BoundColumn DataField="LineFillVolume" HeaderText="LineFillVolume"></asp:BoundColumn>
                              <asp:BoundColumn DataField="LocationFormID" HeaderText="LocationFormID"></asp:BoundColumn>
                              <asp:BoundColumn DataField="LocationToID" HeaderText="LocationToID"></asp:BoundColumn>
                              <asp:EditCommandColumn ButtonType="PushButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>
                        </Columns>
                  </asp:DataGrid>


Thanks in advance for your  help.
ASKER CERTIFIED SOLUTION
Avatar of rohanpandya
rohanpandya

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial