Datagrid Refresh Problem

Hello,

I have a datagrid. When I refresh the datagrid, the selected record becomes unselected and the datagrid record selector goes to the first record at the top of the datagrid.

Is there a way to retain the selected record after a datagrid refresh.

Thanks
Peter


Answer this question

Datagrid Refresh Problem

  • Juke

    Just for the record, what are you doing, and what datagrid are you using

    Next time when asking for help, please include version of .NET and what control and who's control it is. 

    Now looking at this, it's now as plain as day that we were not talking about the 1.0-1.1 MS datagrid for winforms.

    Another funny thing is, if you are using datasets, then you could have done a merge and your position information wouldn't have changed (or shouldn't have changed, who knows, we still don't know what Datagrid your using).

    Just thought to point that out.

  • tenshon

    Problem sorted


     Dim x As Integer = DGjobrequest.CurrentRowIndex
            refreshgrid()
            DGjobrequest.CurrentRowIndex = x
            DGjobrequest.Select(x)

  • Nikita Mironov

    How exactly are you refreshing  and what are you refreshing
  • JDO1NH0U53

    Sorry for the mislead.
    I am actually using the .net datagrid, but the refreshgrid command is actually a sub routine I have which queries a database and fills the datagrid. I only realised recently.

    Regards
    Peter

  • Faisal Mohamood

    jfuentes,

    I am using the refreshgrid() command.

    Peter

  • JohaViss

    Ok, so exactly why are you using it  What reason >

    Also are you using a Winforms MS Datagrid, I show no method called Refresh Datagrid, give it's total path. 

  • Datagrid Refresh Problem