PC Review


Reply
Thread Tools Rate Thread

DataGrid UpdateCommand refresh problem

 
 
Mervin Williams
Guest
Posts: n/a
 
      15th Mar 2004
I have a datagrid with template columns. Upon editing the value of a column
in a row and clicking the update button, the original value is displayed.
However, the new (modified) value should be displayed.

How do I get the new value to display after exiting out of update mode?

Thanks in advance,

Mervin Williams


 
Reply With Quote
 
 
 
 
Marshal Antony
Guest
Posts: n/a
 
      17th Mar 2004
Hi Mervin,
The workaround is query the table after updation and bind it to the
datagrid again in the same event handler.
Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com




"Mervin Williams" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a datagrid with template columns. Upon editing the value of a

column
> in a row and clicking the update button, the original value is displayed.
> However, the new (modified) value should be displayed.
>
> How do I get the new value to display after exiting out of update mode?
>
> Thanks in advance,
>
> Mervin Williams
>
>



 
Reply With Quote
 
dada
Guest
Posts: n/a
 
      17th Mar 2004
Marshal Antony,
Did you think of this?(it doesn`t help me ):

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
localhost.RasporedService s= new localhost.RasporedService();
dsDepartmani=s.WebPopuni("Osobe");
DataGrid1.DataSource=dsDepartmani;
DataGrid1.DataMember="Osobe";

if(!IsPostBack)
{DataGrid1.DataBind();
DataGrid1.PageIndexChanged += new
DataGridPageChangedEventHandler(this.DataGrid1_Change);
}

}

private void DataGrid1_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
localhost.RasporedService s= new localhost.RasporedService();

string ime, prez, tit;
int Departman;
string key = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
TextBox tb;
tb=(TextBox)(e.Item.Cells[3].Controls[1]);
ime = tb.Text;
tb=(TextBox)(e.Item.Cells[4].Controls[1]);
prez=tb.Text;
DropDownList ddl;
ddl=(DropDownList)(e.Item.Cells[5].Controls[1]);
tit=ddl.SelectedItem.Text;
ddl=(DropDownList)(e.Item.Cells[7].Controls[1]);
Departman=Convert.ToInt32(ddl.SelectedItem.Value);
DsDepartmani.OsobeRow rd;
rd=dsDepartmani.Osobe.FindByID_osobe(int.Parse(key));
if (rd!=null)
{
rd.Ime=ime;
rd.Prezime=prez;
rd.Titula=tit;
rd.ID_departmana=Convert.ToInt32(Departman);

s.WebSnimi(dsDepartmani);
dsDepartmani.AcceptChanges();
}
DataGrid1.EditItemIndex = -1;

DataGrid1.DataBind();
}
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid UpdateCommand Leona Smyth Microsoft C# .NET 0 9th Jul 2004 10:57 AM
DataGrid UpdateCommand refresh problem Mervin Williams Microsoft ASP .NET 8 17th Mar 2004 12:23 PM
Problem refreshing values in DataGrid UpdateCommand Mervin Williams Microsoft ADO .NET 3 15th Mar 2004 04:12 PM
Problem refreshing values in DataGrid UpdateCommand Mervin Williams Microsoft ASP .NET 0 14th Mar 2004 04:43 PM
update problem in DataGrid's UpdateCommand method dawn Microsoft ASP .NET 1 28th Jul 2003 04:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:17 AM.