Click here to Skip to main content
15,886,422 members

Comments by miss_sumaira (Top 10 by date)

miss_sumaira 4-Jul-12 13:01pm View    
yeah i implemented all these handler also ..
thank you so much for replaying...
miss_sumaira 4-Jul-12 12:55pm View    
<asp:GridView ID="gvw" runat="server" AutoGenerateColumns="False"
CssClass="basix" Width="408px" CellPadding="4" ForeColor="#333333"
GridLines="None" Height="127px"
onselectedindexchanged="gvwExample_SelectedIndexChanged" onrowdeleting="gvw_RowDeleting1"

onrowupdating="gvw_RowUpdating" EditIndex="0"
onrowcancelingedit="gvw_RowCancelingEdit" onrowediting="gvw_RowEditing"
DataKeyNames="ID" >


<asp:BoundField DataField="ID" HeaderText="ID" AccessibleHeaderText="ID" />
<asp:BoundField DataField="MedDoze" HeaderText="DOZE"
AccessibleHeaderText="DOZE" />
<asp:CommandField HeaderText="Delete" ShowDeleteButton="True" />
<asp:CommandField ShowEditButton="True" />


<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />




Event code

GridViewRow row = (GridViewRow)gvw.Rows[e.RowIndex];
Int32 ID = Int32.Parse(gvw.DataKeys[e.RowIndex].Value.ToString());
string DozeName = ((TextBox)(row.Cells[1].Controls[0])).Text;
TextBox txtDozename = new TextBox();
txtDozename.Text = DozeName;
this.Controls.Add(txtDozename);
string Query = " update dbo.AddDoze set Meddoze= N'" txtDozename.Text + "' where ID= " + ID + " ";
DBAccess.Execute(Query);
miss_sumaira 4-Jul-12 8:26am View    
Deleted
.
miss_sumaira 4-Jul-12 8:16am View    
after added this Query, my Data-updated Successfully but its not Accepting NEW Value in grid view its again used previous value...

Like if database Table stored that value "صبح، دوپہر شام". when i am updating or replace with " روزانہ صبح " ... When i enter " روزانہ صبح " in gridview ...but its do not Use new value " روزانہ صبح " instead its again used "صبح، دوپہر شام" and updated ...
i am using Above Code.
Can you tell me what mistake i done in it.
miss_sumaira 3-Jul-12 17:09pm View    
try{
GridViewRow row = (GridViewRow)gvw.Rows[e.RowIndex];
Int32 ID = Int32.Parse(gvw.DataKeys[e.RowIndex].Value.ToString());
string investgation = ((TextBox)(row.Cells[1].Controls[0])).Text;

string Query = "update dbo.Investigations set Investigations= '" + investgation + "' where ID= " + ID + " ";
DBAccess.Execute(Query);
gvw.EditIndex = -1;
FillData();

}
catch (Exception ex)
{
string strEx = ex.Message;


}