Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Move focus from ultrawebgrid to another control
posted

Hey Guys,

My apologies in advance if this has been covered, but I really did search and not find an answer to this.

Situation: Using ultrawebgrids in ASP.Net 2.0.

User needs to select from a grid. The name of the person in the selected row populates a textbox underneath the grid.  The user makes selections from ddls and it all goes into a second grid. Eventually, it gets saved to a database.

User is not allowed to select anyone from grid one who is already in grid two or already in the table where it all gets saved, so I need to run server-side code to check the second grid and my data source.

Problem - I also need t move the cursor into the textbox once a selection is made, so the user can continue to tab through the web form from there.  However, the focus always ends up back in the grid.

Even if I move the cursor programmatically to the textbox, once I try to tab again, the focus is right back in the grid.

I've tried the selected row change event, click event for the grid itself, click event for link buttons in template columns - no good.

I give up - how is it done?

Thanks.

  • 80
    Suggested Answer
    posted

    Problem solved.  I found this in another post where they had two grids on a web page and when the first grid was used to launch a child window, the child window was not getting the focus.

    In source code of aspx file add this javascript :

     

     

     

     

    function

    grid_MouseDownHandler(gridName, id, button)

    {

     

     

    var

    grid = igtbl_getGridById(gridName);

    grid.Element.removeAttribute(

     

    "mouseDown"

    );

    In the grid's DisplayLayout section add:

    ClientSideEvents-MouseDownHandler

     

    ="grid_MouseDownHandler"

    Works just fine.