Hello all, basically I would want to select a specific field and update it. However when I click Update, I would want to see the data that I selected not just a blank field. I am using a View( I joined 2 tables), so is it possible to update the view through the datagrid or do I have to update them separately?
My view is already mapped but I cannot figure out the update process.
This is what I have so far:
protected void bindGridView_RowEditing(object sender, GridViewEditEventArgs e)
{
}
protected void bindGridView_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
bool flag = false;
TextBox txtAccountID = (TextBox)bindGridView.Rows[e.RowIndex].FindControl("AccountID");
TextBox txtCountryCode = (TextBox)bindGridView.Rows[e.RowIndex].FindControl("CountryCode");
TextBox txtType = (TextBox)bindGridView.Rows[e.RowIndex].FindControl("Type");
this.Validate();
//Do I need an Adapter??
}
<asp:GridView ID="bindGridView" runat="server"
Width="797px"
AutoGenerateColumns="False" AllowSorting="True" selectedindex="0"
AutoGenerateEditButton="True" onrowediting="bindGridView_RowEditing" >
<Columns>
<asp:BoundField Visible="true" DataField="AccountID" HeaderText="AccountID" />
<asp:BoundField Visible="true" DataField="CountryCode" HeaderText="CountryCode" />
<asp:BoundField Visible="true" DataField="Region" HeaderText="Region" />
<asp:BoundField Visible="true" DataField="Account" HeaderText="Account" />
<asp:BoundField Visible="true" DataField="Type" HeaderText="Type" />
</Columns>
</asp:GridView>