Hi team,
I have a WDG and a WebImageButton. Both in an UpdatePanel. The WIB is hidden until the user selects a row in the WDG. By pressing the WIB I insert a new row in the DataBase and Hide the WIB. The WIB is hidden, but the WDG still shows the old values. How can I "reload" the WDG by codeBehind of WIB? I tried to ClearDatabaseSource() and the WDG is empty. But after rebind it only shows the headers of the binded table. Is ther a simple way of "refreshing" by codeBehind?
Hello Schnapper,
Thank you for contacting Infragistics!
We received your support request concerning inserting a row into the WebDataGrid from a button click, and this case has been assigned to me. Infragistics is dedicated to helping you solve this issue. Our team and I have done an initial review of your case and I have the following questions;
a.) Do you have ajax enabled on the WebDataGrid?b.) How are you adding the row to the?c.) What is your basic setting for the WebDataGrid?
Looking forward to hearing from you,
Sincerely,Mike P.Developer Support EngineerInfragistics, Inc.www.infragistics.com
Hi,
a: tried it with enabled and disabled.
b: sqlDataSource1.UpdateParameters.Clear();sqlDataSource1.UpdateCommand = "Update Table Set Date = '"+DateTime.Now.ToShortDateString()+"' WHERE Document = 'XXX'";
sql.DataSource.Update();
c: <ig:WebDataGrid ID="WebDataGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Font-Size="Medium" Height="310px" oninitializerow="WebDataGrid1_initializeRow" Width="356px">
Thank you for the update. If you are updating your data in your database you would then want to retrieve it from your database assign it to the datasource of the grid and bind it. Do you currently retrieve your database after updating it? How you doing the rebinding of the gird? Is there a reason you are updating your database then trying to update the grid instead of updating your grid and using that to update your database?
I Update single rows by elemts (form) outer the wdg, so i have to update database out of wdg. After Updating I do sqlDataSource.DataBind() and also wdg.DataBind, but nothing goes on. If i change the selection after updating the database, the grid shows the new values. there should be a way to update the gui in a same way.
Thank you for the update. By the sounds of it seems that after you update your database you aren’t pulling the data from the database and updating the grid with it. What leads me to believe this is that on the next postback the data is refreshed and is now correct. After you update the database do you set the data back to the DataSource property of the WebDataGrid?
I had to bind it twice, now it works. Thanks.
I need further help. When i pressed the webImageButton I update the DataSource by SQLDataSource.Update(). After this I clear wdg DataSource and set it to the same as before. Then I bind the sqlDataSource and the wdg. The Page refreshes and shows the right rows. But my WebDatGridButtons CommandArgument and CommandName are empty at this time. I set them in des aspx-file this way: <igtxt:WebImageButton ID="WebImageButton4" runat="server" CommandArgument='<%#Eval("Link") %>' CommandName='<%#Eval("ID")+", "+Eval("Datum") %>' oncommand="WebImageButton4_Command" Text="Öffnen"></igtxt:WebImageButton>
Why the Argument and Name are empty?
I cleared the datasource and set it once again. Now the grid updated the gui. But after pushing another button in the grid, now it says "no Object...".
I am following up to see if this matter has been resolved. If this isn’t the case can you please answer my question? After you update the database do you set the data back to the DataSource property of the WebDataGrid?
Please let me know if I may be of further assistance with this matter.