any way to "unbind" data of a web control ?

KONZUL

New Member
Hi all,<BR><BR>I will try to make my problem as clear as possible, do not hesitate to reply if you dont understand it.<BR><BR>I came across the following problem.<BR>I've developped 2 custom web control, <BR>1st control contains 2 child controls textbox and a button to add the textbox content to a database table.<BR>2nd control contains a datagrid (edit, update) with the data from the database and its binded only on the first call by checking the Page.IsPostBack property.<BR><BR>now the problem is, when I am adding a new record using the first control the datagrid doesnt update itself as it takes back the old information as I dont bind again on postback.<BR><BR>At this time I am using a redirect statement to the page to simulate a new call and bind the data again. However I cannot believe there is another solution for this kind of problems ? I could setup a Viewstate or session variable to check if a new record has been added but this looks a bit too "tricky" :). <BR>Is there a way to force the datagrid to bind itself again or to reset the isPostback property to make it bind again ? <BR><BR>Also not that the custom controls id can be customized by the user, so I guess its not possible to find the control and call the bind method directly.<BR><BR>Many thanks,<BR>Thomas
 
Back
Top