I have a webdatagrid that lists employees in our company. I click on a row and display data retrieved from our database such as name, employee number, etc. in controls that are on a webtab inside an updatepanel. Everything works fine with the first 2 records selected from the grid. But always on the 3rd selection I get an "Invalid JSON primitive" error. If I take away the updatepanel, everything works fine. I want to use the updatepanel so the page doesn't repaint everytime I select a new record from the grid.
I use a sqldatasource to populate the grid and a linq query to retrieve data based on the selection.
I have tried with the grid inside and outside the updatepanel. The WebTab control is inside the updatepanel.
I am using VS2010 and v11.1 of the Infragistics controls.
Any ideas why this might br happening?
Hello itdepartmentsts ,
It has been a while since our last communication. Do you still need assistance with this issue?
If so please notify me.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
It would be very helpfull if you could provide an isolated sample with your issue represented.
Let me know once you get back to this issue.
Thanks Maya. I got sidetracked on another project and have not had a chance to get back to this. I don't think I explained my problem very well. I actually think the issue has something to do with using an UpdatePanel with the WebDataGrid. Get back with you on this soon. Thanks again.
I'm just following up to see if you've managed to resolve your issue.If you still have any concerns or questions I will be glad to help.
I couldn’t reproduce the same misbehavior but I could provide an alternative approach that might work for you. Instead of filling the TextBoxes from the code behind you could do it on the client side. I tested this and it seems to work as expected.
If I understood your scenario correctly you want to populate the textboxes from the selection made from the WebDataGrid which is inside the DropDown provider. Regardless the approach could be altered to any webdatagrid on your page.
The idea is simple. You acess the texboxes from the Initialize event of the WebTab:
function WebTab1_Initialize(sender, eventArgs) {
///<summary>
///
///</summary>
///<param name="sender" type="Infragistics.Web.UI.ControlMain"></param>
///<param name="eventArgs" type="Infragistics.Web.UI.EventArgs"></param>
textBox1 = sender.get_tabs()[0].findChild("TextBox1");
textBox2 = sender.get_tabs()[0].findChild("TextBox2");
textBox3 = sender.get_tabs()[0].findChild("TextBox3");
}
Then from the RowSelectionChanged event of the grid you want to take the data from you get the cells and their text and set it to the textboxes:
function WebDataGrid4_Selection_RowSelectionChanged(sender, e) {
///<param name="sender" type="Infragistics.Web.UI.WebDataGrid"></param>
///<param name="eventArgs" type="Infragistics.Web.UI.RowSelectionChangedEventArgs"></param>
//Add code to handle your event here.
//Gets the selected rows collection of the WebDataGrid
var selectedRows = e.getSelectedRows();
//Gets the row that is selected from the selected rows collection
var row = selectedRows.getItem(0);
//Gets the second cell object in the row
//In this case it is ProductName cell
var cell1 = row.get_cell(1);
var cell2 = row.get_cell(2);
var cell3 = row.get_cell(3);
//Gets the text in the cell
var text1 = cell1.get_text();
var text2 = cell2.get_text();
var text3 = cell3.get_text();
textBox1.value = text1;
textBox2.value = text2;
textBox3.value = text3;
I’m also attaching a sample for your reference( uses Nwind database).
If this approach doesn’t work for you please notify me so that I can further research this.
Thank you for your patience while I was working on this.