asp.net gridview edit mode index - c#

I have a gridview which is populated via a sql data source with the SELECT command: Select * FROM myTable
When the page is first loaded that displays every record in the table.
The gridview has an Edit button for each row and when the user clicks the row I want to update the gridview to display only that result in the gridview so I change the SELECT command of the sql data source to SELECT * FROM myTable WHERE ID = currentEditRow
That works except for one issue, when editing any other row but the first, the Update and Cancel buttons do not show up on the row. It is like is not in edit mode.
Any idea why that is?
Code:
protected void gvResults_RowEditing(object sender, GridViewEditEventArgs e)
{
gvResults.EditIndex = e.NewEditIndex;
SqlDataSource1.SelectCommand = "SELECT * FROM [myTable] WHERE ID = '" + ID + "'";
}

GridView will bind data again automatically when you set a new command to SqlDataSource1.SelectCommand. This made it returns to start mode (Display read-only data with Edit button in GridView).
Otherwise, you trick it as my sample code below ...
This is my GridView binding data with SqlDataSource1, has DataKey names "code". There are three event handlings to implement: OnRowEditing, OnSelectedIndexChanged and OnRowCancelingEdit.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
DataKeyNames="code"
OnRowEditing="GridView1_RowEditing"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
OnRowCancelingEdit="GridView1_RowCancelingEdit">
<Columns>
<asp:BoundField DataField="std_room_id" HeaderText="Room ID" SortExpression="std_room_id" />
<asp:BoundField DataField="booking_name" HeaderText="Name" SortExpression="booking_name" />
<asp:BoundField DataField="course_id" HeaderText="Course" SortExpression="course_id" />
<asp:BoundField DataField="course_period" HeaderText="Period" SortExpression="course_period" />
<asp:BoundField DataField="start_date" HeaderText="Start Date" SortExpression="start_date" />
<asp:BoundField DataField="end_date" HeaderText="End Date" SortExpression="end_date" />
<asp:CheckBoxField DataField="approved" HeaderText="Approved" SortExpression="approved" />
<asp:CommandField ShowSelectButton="true" SelectText="Edit"/>
<asp:CommandField ShowEditButton="true" Visible="false"/>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"
SelectCommand="SELECT * FROM [BookingRoom]"></asp:SqlDataSource>
</div>
I have two CommandFields: SelectButton to click when user want open Edit Mode, and the second CommandField for display Update and Cancel buttons.
And this is my code-behide
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.Columns[7].Visible = false;
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
string code = GridView1.DataKeys[GridView1.SelectedIndex].Value.ToString();
SqlDataSource1.SelectCommand = "SELECT * FROM [BookingRoom] WHERE code = '" + code + "'";
GridView1.Columns[8].Visible = true;
GridView1.SetEditRow(0);
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.Columns[7].Visible = true;
GridView1.Columns[8].Visible = false;
}
I tricked it by show the SelectButton (display text as "Edit") in GridView with all loaded data in start mode. When user selects the row by clicking the SelectButton, it will start to do the steps in GridView1_SelectedIndexChanged which try to display only the selected row in GridView and set Edit Mode to that row togather with displaying the second CommandField (Update and Cancel buttons).
To set Edit Mode by this line GridView1.SetEditRow(0);, it will do the step in GridView1_RowEditing which try to hide the SelectButton.
Final, you have to handle the cancling Edit Mode as in GridView1_RowCancelingEdit which try to display the SelectButton, and hide the Update and Cancel buttons.
I access those two CommandFields by their column index according to my columns in GridView: column index of Select button is 7 and column index of Update and Cancel buttons is 8

Try to interchange the two line of codes:
protected void gvResults_RowEditing(object sender, GridViewEditEventArgs e)
{
SqlDataSource1.SelectCommand = "SELECT * FROM [myTable] WHERE ID = '" + ID + "'";
gvResults.EditIndex = e.NewEditIndex;
}

Related

SQL Select ID from automatically generated rows with C#

Basically whenever i would press a button on my website it would generate some kind of report with the ID and other information. What am trying to do is change one column of the table with SQL statements. I managed to change it but the code changes the column for all the IDs. What am trying to do is change column according to ID, but am still new to C# and SQL so i'm not sure how to get the automatic generated row. Just to highlight that i'm using a button in a gridview to change the value in the column. Below is what i tried:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
string order = Request.QueryString["id"];
SqlConnection con = new SqlConnection();
con.ConnectionString = ConfigurationManager.ConnectionStrings["RCManiaConnectionString"].ConnectionString;
con.Open();
if (e.CommandName == "received")
{
SqlCommand com = new SqlCommand();
com.Connection = con;
com.CommandText = "UPDATE [Orders] SET Status = 'Received' WHERE [ID] ='" + order + "'";
SqlDataReader data = com.ExecuteReader();
}
}
Using DataKeyNames property of grid view you can pass each record's primary key value, assign the same to the button of the record under CommandArgument. The below code is working code. You can try the same.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"
DataKeyNames="ID" OnRowDataBound="GridView1_RowCommand">
<EmptyDataTemplate>
No Data Found
</EmptyDataTemplate>
<Columns>
<asp:TemplateField HeaderText="Update" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:ImageButton ID="btnUpdate" runat="server" CausesValidation="false" OnClick="btnUpdate_Click" CommandName="Select" ImageUrl="~/Contents/Images/classicPencil.svg" Width="20" Height="20" Text="View" CommandArgument='<%#Eval("ID")%>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
//Using Direct button click event
protected void btnUpdate_Click(object sender, ImageClickEventArgs e)
{
ImageButton btn = sender as ImageButton;
int ID = Convert.ToInt32(btn.CommandArgument);
//Your code of update data process
}
//Using grid row command event.
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
int id = Convert.ToInt32(e.CommandArgument.ToString());
//Your code of update data process
}

unable to update gridview values in .net

while updating gridview record . old values only getting updated. im using bound field. getting old value while im fetching data in variable.
<asp:GridView runat="server" ID="GvLeads" AutoGenerateColumns="false" AutoGenerateEditButton="true" AutoGenerateDeleteButton="true" OnRowDeleting="GvLeads_RowDeleting" OnRowEditing="GvLeads_RowEditing" OnRowCancelingEdit="GvLeads_RowCancelingEdit" EmptyDataText="No Records Found" OnRowUpdating="GvLeads_RowUpdating" OnRowDeleted="GvLeads_RowDeleted">
<Columns>
<asp:BoundField HeaderText="Id" DataField="LeadId" />
<asp:BoundField HeaderText="Company" DataField="Companyname" />
</Columns>
</GridView >
code behind
protected void GvLeads_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = GvLeads.Rows[e.RowIndex];
String str = ((TextBox)(row.Cells[1].Controls[0])).Text;
int Leadid = Convert.ToInt32(str);
string CompanyName = ((TextBox)(row.Cells[2].Controls[0])).Text;
}
This usually happens when you are populating grid at Page_Load as soon as RowUpdating event gets called before that Page_Load event get's called which populates the grid with initial values. How to Avoid? Use !IsPostBack for this purpose
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGrid(); // For e.g.
}
}

delete database data using grid view button but returns me with null values

This is how my gridview looks like:
I need to delete the selected row where there is a hidden column activityID and taskID which I set visible to false because I need their value to delete it from the database.
I have to delete from database using QuestionNo , activityID and taskID .
ActivityID and TaskID is hidden , it actually looks like this :
QuestionNo,ActivtiyID,TaskID,QuestionContent then delete.
Code :
protected void gvQuestion_RowCommand(object sender, GridViewCommandEventArgs e)
{
}
protected void gvQuestion_RowDeleted(object sender, GridViewDeletedEventArgs e)
{
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
}
protected void gvQuestion_RowDeleting1(object sender, GridViewDeleteEventArgs e)
{
gvQuestion.DeleteRow(e.RowIndex);
Model.question del = new Model.question();
int q = Convert.ToInt32(gvQuestion.Rows[e.RowIndex].Cells[0].ToString());
int a = Convert.ToInt32(gvQuestion.Rows[e.RowIndex].Cells[1].ToString()); // Hidden Column
int t = Convert.ToInt32(gvQuestion.Rows[e.RowIndex].Cells[2].ToString()); // Hidden Column
del.QuestionNo = q;
del.ActivityID = a;// Value of ActivityID column in GV
del.TaskID = t; // Value of TaskID column in GV
daoQuestion.Delete(del);
daoQuestion.Save();
}`
From what i know once delete button is pressed , it fires OnRowDeleting event so i put my delete codes in there , however i connection reset when i try to delete , the values of q , a , t is null , what gone wrong here? , The delete button is not working.. Help please , thanks . i am using EF to do this btw...
Here is the aspx :
<asp:GridView ID="gvQuestion" runat="server"
AutoGenerateColumns="False"
onselectedindexchanged="gvQuestion_SelectedIndexChanged"
onrowcommand="gvQuestion_RowCommand" onrowdeleted="gvQuestion_RowDeleted" onrowdeleting="gvQuestion_RowDeleting1"
>
<Columns>
<asp:BoundField DataField="QuestionNo" HeaderText="QuestionNo"
InsertVisible="False" ReadOnly="True" SortExpression="QuestionNo" />
<asp:BoundField DataField="ActivityID" HeaderText="ActivityID"
SortExpression="ActivityID" Visible="False" />
<asp:BoundField DataField="TaskID" HeaderText="TaskID"
SortExpression="TaskID" Visible="False" />
<asp:BoundField DataField="joined" HeaderText="QuestionContent"
SortExpression="joined" >
<ControlStyle Width="150px" />
</asp:BoundField>
<asp:TemplateField>
<ItemTemplate>
<span onclick="return confirm('Are you sure to Delete the record?')">
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Delete"
onclick="LinkButton1_Click" CommandArgument="Delete">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
With data keys ( duno if this is the correct way ) :
aspx :
DataKeyNames="QuestionNo,ActivityID,TaskID"
code behind :
protected void gvQuestion_RowDeleting1(object sender, GridViewDeleteEventArgs e)
{
GridView gvQuestion = (GridView)sender;
int row = e.RowIndex;
int q = Convert.ToInt32(gvQuestion.DataKeys[row].Value[0].ToString());
int a= Convert.ToInt32(gvQuestion.DataKeys[row].Value[1].ToString());
int t = Convert.ToInt32(gvQuestion.DataKeys[row].Value[2].ToString()); // I assume that value 0 , 1 , 2 is according to the columns , not really sure on this.
/* Model.question del = new Model.question();
del.QuestionNo = q;
del.ActivityID = a;// Value of ActivityID column in GV
del.TaskID = t; // Value of TaskID column in GV
daoQuestion.Delete(del);
daoQuestion.Save();
gvQuestion.DataBind(); */
}
I am just trying to retrieve the values so i'll comment out the delete codes .. i check the values by debugging and returns 0 . is this the right way to do it?
You are deleting a row, not selecting it, so selectedindex won't have anything, unless you've selected a row previously. You should use the information in the GridViewDeleteEventArgs. In there you can find the rowindex, as well as the data for columns you've marked as key columns.

Gridview Button in TemplateField only fires on second click

I've done some searching prior to asking, and although this post is close, it doesn't work for my scenario.
What I find is that the "delete" button in my template field seems to fire, but the click event does not trigger. Yet the second time you click the button it works as expected.
So, breaking the code down, I am binding my data to a GridView, using a `SqlDataSource.
My page load event starts as follows:
if (!Page.IsPostBack)
{
externalUserDataSource.ConnectionString = "some connection string";
}
My data source is as follows:
<asp:SqlDataSource ID="externalUserDataSource" runat="server"
ConflictDetection="CompareAllValues" SelectCommand="uspGetExternalUsersByTeam"
SelectCommandType="StoredProcedure" ProviderName="System.Data.SqlClient">
<SelectParameters>
<asp:SessionParameter Name="TeamID" SessionField="TeamID" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
And this is my GridView markup:
<asp:GridView ID="gridView" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px"
CellPadding="4" DataKeyNames="LoginID" DataSourceID="externalUserDataSource"
EnableModelValidation="True" OnRowDataBound="GridViewRowDataBound" TabIndex="3">
<HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="White" />
<FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
<PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
<RowStyle BackColor="LightGoldenrodYellow" />
<SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<Columns>
<asp:BoundField DataField="RowID" HeaderText="Row ID" ReadOnly="True"
SortExpression="RowID" Visible="False" />
<asp:BoundField DataField="LoginID" HeaderText="Login ID" ReadOnly="True"
SortExpression="LoginID" Visible="False" />
<asp:BoundField DataField="EmailAddress" HeaderText="Email Address"
ItemStyle-VerticalAlign="Bottom" ReadOnly="True" SortExpression="AssociateName"/>
<asp:BoundField DataField="TeamID" HeaderText="Team ID" ReadOnly="True"
SortExpression="TeamID" Visible="False" />
<asp:CheckBoxField DataField="HasFIAccess"
HeaderText="Has Access to<br />Funding<br/>Illustrator"
ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Bottom"
ReadOnly="True"/>
<asp:CheckBoxField DataField="HasALTAccess"
HeaderText="Has Access to<br />Asset Liability<br/>Tracker"
ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Bottom"
ReadOnly="True"/>
<asp:CheckBoxField DataField="HasFIAAccess"
HeaderText="Has Access to<br />Funding<br/>Illustrator App"
ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Bottom"
ReadOnly="True"/>
<asp:TemplateField>
<ItemTemplate>
<asp:Button runat="server" CssClass="additionsRow" ID="btnDeleteExternalUser" OnClick="DeleteExtUserButtonClick"
CausesValidation="False" Text="Delete"
CommandArgument='<%#Eval("TeamID") + "," + Eval("LoginID") + "," + Eval("EmailAddress") + "," + Eval("HasALTAccess")%>'/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
So, you can see that I am passing across some information in the button that is used in the event to ensure the correct data is deleted (which is why I cannot use the ButtonField, as suggested in the link above).
The last part to the puzzle is the GridView's databound event:
protected void GridViewRowDataBound(object sender,
GridViewRowEventArgs e)
{
// if rowtype is not data row...
if (e.Row.RowType != DataControlRowType.DataRow)
{
// exit with no further processing...
return;
}
// get the ID for the selected record...
var selectedId = DataBinder.Eval(e.Row.DataItem, "RowID").ToString();
// create unique row ID...
e.Row.ID = string.Format("ExtUserRow{0}", selectedId);
// find the button delete for the selected row...
var deleteButton = (Button)e.Row.FindControl("btnDeleteExtUser");
// get the email address for the selected record...
var selectedUser = DataBinder.Eval(e.Row.DataItem, "EmailAddress").ToString();
// define the message text...
var messageText = string.Format("OK to delete {0}?",
selectedUser.Replace("'", "\\'"));
// add attribute to row delete action...
this.AddConfirmMessage(deleteButton, messageText);
}
Where AddConfirmMessage simply assigns an onclick attribute to the control to ensure the user has to confirm the deletion.
Now, in every case the message pops up 'OK to delete abc#xyz.com?', but as stated earlier, the event assigned to the "delete" button does not trigger until the button is clicked a second time.
Strangely enough, I took this code from another page and modified accordingly, though it doesn't have this issue there:
protected void DeleteExtUserButtonClick(object sender,
EventArgs e)
{
// get the buton which was clicked...
var button = (Button)sender;
// break the delimited array up...
string[] argumentArray = button.CommandArgument.Split(',');
// store the items from the array...
string teamId = argumentArray[0];
string loginId = argumentArray[1];
string emailAddress = argumentArray[2];
string hasAltAccess = argumentArray[3];
using (var conn = new SqlConnection(Utils.GetConnectionString()))
{
// create database command...
using (var cmd = new SqlCommand())
{
// set the command type...
cmd.CommandType = CommandType.StoredProcedure;
// set the name of the stored procedure to call...
cmd.CommandText = "uspDeleteExternalUser";
// create and add parameter to the collection...
cmd.Parameters.Add(new SqlParameter("#TeamId", SqlDbType.Int));
// assign the search value to the parameter...
cmd.Parameters["#TeamId"].Value = teamId;
// create and add parameter to the collection...
cmd.Parameters.Add(new SqlParameter("#LoginId", SqlDbType.VarChar, 50));
// assign the search value to the parameter...
cmd.Parameters["#LoginId"].Value = loginId;
// set the command connection...
cmd.Connection = conn;
// open the connection...
conn.Open();
// perform deletion of user...
cmd.ExecuteNonQuery();
}
}
// bind control to refresh content...
ExtUsersGrid.DataBind();
}
Have I missed something obvious? I am happy to modify if there are better ways to do this.
Edit 1: Following on from the discussions below, I have modified the following:
Removed the Onclick event property of the ButtonItem;
Set the CommandName and CommandArgument as suggested below, and updated the DataKeyNames to use RowID which is a unique ID from the data;
Assigned a RowCommand event for the GridView;
Assigned the delete code to the RowCommand event.
Following these changes, it still fires the row event code on the second click.
Edit 2: FYI - I've now removed the SqlDataSource and the associated code/references, and created a procedure to fill the dataset, which is called on Page_Load (inside the !Page.IsPostBack brackets). I started making the changes below to use the RowCommand event, but they still caused the same issue (i.e. the button will only fire on the second click). As using RowCommand meant converting the BoundFields to ItemTemplates, I reverted back to the button click event as it seemed pointless making all those changes for no gain. If anyone else can help me understand why it only triggers on the second click, would appreciate your input.
OK, frustratingly this was due to some code that for reasons still unknown, works elsewhere.
In the DataBound event, there was two lines of code:
// get the associate name for the selected record...
var selectedId = DataBinder.Eval(e.Row.DataItem, "RowID").ToString();
// create unique row ID...
e.Row.ID = string.Format("ExtUserRow{0}", selectedId);
The process of applying an ID to the rows programatically seems to break the connection between the data and the events.
By removing these two lines of code, it works as expected.
Well instead you can do something like this.
Add a CommandName property to your GridView like this. Also note the changes in the CommandArgument property:
<asp:TemplateField>
<ItemTemplate>
<asp:Button runat="server" CssClass="additionsRow" ID="btnDeleteExtUser"
CausesValidation="False" Text="Delete"
CommandName="OnDelete"
CommandArgument='<%# Container.DisplayIndex %>" '
</ItemTemplate>
</asp:TemplateField>
Code behind will look something like this. Note that I am using the RowCommand event of Gridview.
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if(e.CommandName == "OnDelete")
{
int rowIndex = Convert.ToInt32(e.CommandArgument);
// now you got the rowindex, write your deleting logic here.
int ID = Convert.ToInt32(myGrid.DataKeys[rowIndex]["ID"].Value);
// id will return you the id of the row you want to delete
TextBox tb = (TextBox)GridView1.Rows[rowIndex].FindControl("textboxid");
string text = tb.Text;
// This way you can find and fetch the properties of controls inside a `GridView`. Just that it should be within `ItemTemplate`.
}
}
Note: mention DataKeyNames="ID" inside your GridView. The "ID" is the primary key column of your table.
Are you binding the GridView on pageload? If so, then move it to !IsPostBack block as show below:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
GridView1.DataSource = yourDataSource;
GridView1.DataBind();
}
}

Passing gridview values(data) to textbox fields

For my view,
In the page:
1) I have a gridview with the select hyperlink in it. The gridview data is from the SQLDataSource.
2) And, I also have a few textboxes (abt 5) - not in the gridview.
What I would like to do is to use the select hyperlink to select the row that i want to edit. And when i click select, the data in the row should come out to their respective textboxes.
How do I go about doing this?
Grid views have inline record editing support, you can enable this functionality by setting the AutoGenerateEditButton property to true. You must specify the name of a stored procedure or SQL query in the UpdateCommand property, this is used to update data in the underlying data base.
From MSDN:
<asp:gridview id="CustomersGridView"
datasourceid="CustomersSqlDataSource"
autogeneratecolumns="true"
autogeneratedeletebutton="true"
autogenerateeditbutton="true"
datakeynames="CustomerID"
runat="server">
</asp:gridview>
<asp:sqldatasource id="CustomersSqlDataSource"
selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
updatecommand="Update Customers SET CompanyName=#CompanyName, Address=#Address, City=#City, PostalCode=#PostalCode, Country=#Country WHERE (CustomerID = #CustomerID)"
deletecommand="Delete from Customers where CustomerID = #CustomerID"
connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
runat="server">
</asp:sqldatasource>
See here for the full example code.
Wireup OnSelectedIndexChanged event:
ASPX:
<asp:GridView id="gvTest" OnSelectedIndexChanged="gvTest_SelectedIndexChanged"
..........></asp:GridView>
<asp:TextBox id="text1" runat="server"/>
Code:
protected void gvTest_SelectedIndexChanged(object sender, EventArgs e)
{
//get currently selected row
var r =gvTest.Rows[gvTest.SelectedIndex];
//THIS WAY YOU CAN GET TEXT FROM ALL COLUMNS
text1.Text = r.Cells[r.Cells.Count - 1].Text;
}
protected void gvofertas_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
gvofertas.SelectedIndex = Convert.ToInt32(e.CommandArgument);
switch (e.CommandName)
{
case "ELIMINAR":
{
//lblSolEliminar.Text = "Usuario: " + Convert.ToString(gvCorreos.DataKeys[gvCorreos.SelectedIndex].Values["etspcpusrn"]);
mpeEliminar.Show();
break;
}
case "EDITAR":
{
Limpiar();
Session["NROOFERTAACTUALIZA"] = Convert.ToString(gvofertas.DataKeys[gvofertas.SelectedIndex].Values["efophcodi"]).Trim();
txtDescripcion.Text = Convert.ToString(gvofertas.DataKeys[gvofertas.SelectedIndex].Values["efophdesc"]).Trim();
StartDate.Text= Convert.ToDateTime(gvofertas.DataKeys[gvofertas.SelectedIndex].Values["efophfini"]).ToShortDateString();
EndDate.Text = Convert.ToDateTime(gvofertas.DataKeys[gvofertas.SelectedIndex].Values["efophffin"]).ToShortDateString();
txtRango1Localidades1Agregar.Text = Convert.ToString(gvofertas.DataKeys[gvofertas.SelectedIndex].Values["efophloci"]).Trim();
txtRango2Localidades1Agregar.Text = Convert.ToString(gvofertas.DataKeys[gvofertas.SelectedIndex].Values["efophlocf"]).Trim();
this.mpeAgregar.Show();
BtnGuardar2.Text = "Actualizar";
txtDescripcion.Focus();
break;
}
}
catch (Exception ex)
{
ucMsje.RegistrarMensajeCliente("dvMsjeError", F.m_strImagenError, ex.Message);
}

Categories