M
Michael
Hi Everyone,
I'm having a problem with the gridview control. When I click on the edit
link, the grid disapears and don't come back, until I restart the page. I
have setup the grid as such:
<asp:GridView ID="grdPOs" runat="server" AllowPaging="True"
AutoGenerateColumns="False"
BackColor="White" BorderColor="#CC9966" BorderStyle="None"
BorderWidth="1px"
CellPadding="4" Width="692px" DataKeyNames="ItemId">
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<Columns>
<asp:BoundField DataField="Page" HeaderText="Page"
SortExpression="Page">
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="CatalogId" HeaderText="Catalog #">
<ItemStyle HorizontalAlign="Right" Width="80px" />
</asp:BoundField>
<asp:BoundField DataField="ItemDescription"
HeaderText="Description" SortExpression="ItemDescription">
<ItemStyle Width="250px" />
</asp:BoundField>
<asp:BoundField DataField="Qty" HeaderText="Qty"
SortExpression="Qty">
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="UnitPrice"
DataFormatString="{0:C}" HeaderText="UnitPrice"
SortExpression="UnitPrice">
<ItemStyle HorizontalAlign="Right" Width="70px" />
</asp:BoundField>
<asp:BoundField DataFormatString="{0:0.00}"
HeaderText="Total" InsertVisible="False" />
<asp:CommandField ShowEditButton="True" />
<asp:ButtonField CommandName="Delete" Text="Delete" />
<asp:BoundField DataField="POrderId" HeaderText="POrderId"
InsertVisible="False"
SortExpression="POrderId" Visible="False" />
<asp:BoundField DataField="OrderDate" HeaderText="OrderDate"
SortExpression="OrderDate"
Visible="False" />
<asp:BoundField DataField="ItemID" HeaderText="ItemID"
InsertVisible="False" SortExpression="ItemID"
Visible="False" />
</Columns>
<RowStyle BackColor="White" ForeColor="#330099" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True"
ForeColor="#663399" />
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#990000" Font-Bold="True"
ForeColor="#FFFFCC" />
</asp:GridView>
And the RowEditing event is as follows.
Protected Sub grdPOs_RowEditing(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewEditEventArgs) Handles grdPOs.RowEditing
grdPOs.EditIndex = e.NewEditIndex
DataBind()
End Sub
Has anyone else seen anything like this. Thanks for any advice that you can
provide.
Michael
I'm having a problem with the gridview control. When I click on the edit
link, the grid disapears and don't come back, until I restart the page. I
have setup the grid as such:
<asp:GridView ID="grdPOs" runat="server" AllowPaging="True"
AutoGenerateColumns="False"
BackColor="White" BorderColor="#CC9966" BorderStyle="None"
BorderWidth="1px"
CellPadding="4" Width="692px" DataKeyNames="ItemId">
<FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
<Columns>
<asp:BoundField DataField="Page" HeaderText="Page"
SortExpression="Page">
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="CatalogId" HeaderText="Catalog #">
<ItemStyle HorizontalAlign="Right" Width="80px" />
</asp:BoundField>
<asp:BoundField DataField="ItemDescription"
HeaderText="Description" SortExpression="ItemDescription">
<ItemStyle Width="250px" />
</asp:BoundField>
<asp:BoundField DataField="Qty" HeaderText="Qty"
SortExpression="Qty">
<ItemStyle HorizontalAlign="Right" />
</asp:BoundField>
<asp:BoundField DataField="UnitPrice"
DataFormatString="{0:C}" HeaderText="UnitPrice"
SortExpression="UnitPrice">
<ItemStyle HorizontalAlign="Right" Width="70px" />
</asp:BoundField>
<asp:BoundField DataFormatString="{0:0.00}"
HeaderText="Total" InsertVisible="False" />
<asp:CommandField ShowEditButton="True" />
<asp:ButtonField CommandName="Delete" Text="Delete" />
<asp:BoundField DataField="POrderId" HeaderText="POrderId"
InsertVisible="False"
SortExpression="POrderId" Visible="False" />
<asp:BoundField DataField="OrderDate" HeaderText="OrderDate"
SortExpression="OrderDate"
Visible="False" />
<asp:BoundField DataField="ItemID" HeaderText="ItemID"
InsertVisible="False" SortExpression="ItemID"
Visible="False" />
</Columns>
<RowStyle BackColor="White" ForeColor="#330099" />
<SelectedRowStyle BackColor="#FFCC66" Font-Bold="True"
ForeColor="#663399" />
<PagerStyle BackColor="#FFFFCC" ForeColor="#330099"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#990000" Font-Bold="True"
ForeColor="#FFFFCC" />
</asp:GridView>
And the RowEditing event is as follows.
Protected Sub grdPOs_RowEditing(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewEditEventArgs) Handles grdPOs.RowEditing
grdPOs.EditIndex = e.NewEditIndex
DataBind()
End Sub
Has anyone else seen anything like this. Thanks for any advice that you can
provide.
Michael