iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I'm using webgrid 7, and I've two grids, if the user select the upper grid, the bottom grid will display all the related data.
I'm using OnRowChanged client event to apply the data.
Now the bug is, if the user navigates quickly between the rows using the keyboard arrows (up and down) very quickly, it will sometime skip the action, and the action is not fired, and that cause a problem to the data in the bottom grid, as it will not refresh and give wrong data to the user.
This bug is very effective and critical bug, and I can not find work around it to fix. I think you may send hot fix for it. Please advice.
Thanks,
Hi Maged,
I have tested your scenario and I could replicate your issue. However, this issue is not a bug. Since the grid need time to process the data, then when you choose the next data quickly, the grid is already in progress for the first data. Basically the progress itself happened in almost no time, which can be counted as milliseconds. So the second grid will show it as the result.
You might want to see our sample that fit with your scenario. The sample name is SendingCustomRequest.aspx.
Hope this information helps.
Best regards,
Julia
Hi Julia,
Thanks for your reply.
I don’t agree that this is not a bug.
The problem is, if you change quickly, the grid will send the first event, but it will not send the second event, you need to wait a little while to get the second event for the new row before you move to a new row.
Now imagine, if you have 10 rows of data in the first grid, and the user just keep clicking on the down arrow to go down to the fourth row, but because it was too fast, the grid may miss the last row to send the event, this will result that the user will see a data in the second grid not related to the current selected line, and that is my main concern.
I’m working on a large medical project, and mistake like this will result of wrong patient results and information.
I tried your sample, and it act a little bit better, but here is another related issue to your sample.
If I have three grids, one master grid, that if this grid changed the row, the other 2 grid will get updated. With your sample, if we move quickly, we will get one grid updated and the other one not!!
This is serious issue and need to be fixed.
If there is any way to block the master grid of moving until the other grids get updated that may fix, so please check and let me know.
Maged
Please allow me to expressing my opinion regarding this topic.
I refer to ‘SendingCustomRequest.aspx’ sample file in WebGridSamples project. The sample utilizes two unique features of WebGrid which are parts of the architecture: SendCustomRequest and ClientAction engine. The SendCustomRequest basically sends a custom request to the server, just like the Refresh request which is made when you click the Refresh icon at the bottom-right corner of a WebGrid.
There are two methods that can be optionally used together with SendCustomRequest: wgPrepareCustomAction and wgCustomActionResponse. The first one is called when the custom request is about to be made. You can place some code in the function to, for instance, set the StatusBar text. The latter is invoked after a response for the custom request is received. You can also send custom data to the server during the custom request.
The ClientAction engine acts as a bridge between the client and the server, allowing client-side functions to be invoked from server side during OnTheFly Postback. This result in smoother interactions and most importantly much reduced codes and time needed for more complex scenarios.
I will try to describes how to utilize the architecture to send data to the server to be processed and then send the result back to the client, all without Page Postback and yet conforming to the ASP.NET page lifecycle.
Specifically, the sample shows how to get a row’s data on the server, process it and send the results back to be displayed in another grid. When a user selects a row from the Customer table (WebGrid1), WebGrid2 will then load and display the Orders data of that selected customer.
The logic behind this scenario is as following:
In this case, I agree with Julia Wijaya’s post that state that this is not an issue from WebGrid’s side. When user navigates quickly between rows using keyboard arrows, WebGrid1 will invoke custom request in OnRowSelect event from the client. However, there is a small amount of time (actually very small amount of time, in millisecond and less than a second) that needed to process the custom request.
I’d like to suggest you to filter WebGrid1 rather than navigating quickly between rows using keyboard arrows. I’m sure that the filter feature of WebGrid will help you find your desired row rather than scrolling up and down quickly using keyboard arrow.
Please correct me if I'm wrong and let us know your response.
Thanks again for your support.
First let me show you what I did in the code.
On the server side:
/// <summary>
///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void MemebershipTypesGrid_InitializePostBack(object sender, ISNet.WebUI.WebGrid.PostbackEventArgs e)
if (e.Action == ISNet.WebUI.WebGrid.PostBackAction.Custom)
{
ucSelectedMemebershipTypID.Value = Request["key"] asstring;
FreeProductsGrid.ClientAction.Refresh();
PricedProductsGrid.ClientAction.Refresh();data
}
On the client side:
function MemebershipTypesGrid_OnRowSelect(controlId, tblName,
rowIndex, rowEl)
try
var grid = ISGetObject(controlId);
var row = grid.RootTable.GetRow(rowIndex);
var key = row.KeyValue;
document.getElementById('ucSelectedMemebershipTypIDGroup').childNodes[0].value = key;
grid.AddInput("key", key);
grid.SendCustomRequest();
catch (err)
alert(err.description);
return true;
With this code, it works perfectly, except one thing, still refresh issue, sometimes the third grid or the second grid don’t get refreshed, and if I update it manually, I’ll see the data.
Any brilliant ideas to ensure the refreshment will happen?
This software will be used by hundreds of users, and may be thousands of people in the future, and I can’t ask the users not to navigate quickly using the keyboard or to use the filter to navigate instead of using the keyboard, this is hard to ask. If its few users and all technical users, I wouldn’t really care, but users like doctors, nurses or accountants can’t be asked to do things like that, they only want to know how to use the keyboard or mouse...etc :-)
I have modified our sample WebGrid of "SendingCustomRequest.aspx" and hopefully, it will meet your scenario. Please kindly add and change that sample with the provided code. After modifed them, you can try to change row quickly and see that the WebGrid2 will also refreshing acording to the last select row in WebGrid1. Here is the snippet:
var status = true; function WebGrid1_OnRowSelect(gridId, tblName, rowIndex, rowElm) { var grid = ISGetObject("WebGrid1"); if (status == true) { var key = rowElm.keyValue; { grid.AddInput("key", key); grid.SendCustomRequest(); } status = false; return true; } else { return false; } } function WebGrid2_OnAfterResponseProcess(controlId, actionName, lastRequestObject, xmlResponseObject) { var txt = document.getElementById("ctl00_content_TextBox1"); var grid1 = ISGetObject("WebGrid1"); var grid1SelectedObject = grid1.GetSelectedObject().ToRowObject(); var grid2 = ISGetObject("WebGrid2"); setTimeout(function() { if (grid1SelectedObject.KeyValue != txt.value) { txt.innerText = grid1SelectedObject.KeyValue; grid2.Refresh(); grid1.RootTable.GetRowByKeyValue(txt.value).Select(); } }, 200); status = true; return true; }
I hope it helps. Thank you and have a nice day.
Best Regards,
Andi Santoso
Hi Andi,
Nice work arround. The onlything is not working properly is the
grid1.RootTable.GetRowByKeyValue(txt.value).Select();
The grid1 doesn't show the selected row after we select back the older row, it need kind of screen referesh, but I could not do it, any idea?
Also, I had to modify this solution, as we need to handle grid1_OnBeforeRowSelect(...).
Thank you, however, I am having a difficulty to replicate the new issue in my end. Could you provide me with more details regarding this? Perhaps, steps to reproduce or send me a video would be great.
Thank you and have a nice day.
I managed to fix it, all good now.
Thanks allot for your support.
Well, simplest fix is to set the grid to BindingOperationMode="ClientBinding"
That also will make everything work more smooth and fast.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname