about ... table

Discussion in 'Questions (Windows Mobile)' started by giannimaione, May 21, 2007.

  1. giannimaione

    giannimaione Well-Known Member Licensed User

    this is my simple code:

    Sub Globals

    End Sub

    Sub App_Start
    End Sub

    Sub CreateTable

    End Sub

    Sub Table1_SelectionChanged (ColName, Row)
    ' this is only event for table ???
    ' can i catch click on Head (name or phone)
    ' i want use sort by name or by phone
    End Sub

  2. Erel

    Erel Administrator Staff Member Licensed User

    The underlying control (Datagrid) doesn't support the header click event.
    A new control - ListView will be soon available which will allow this.
    However, it will not allow many other features of the Table control.
  3. RandomCoder

    RandomCoder Well-Known Member Licensed User

    If all you are wanting to do is sort by either the name or the number then I don't think this will work as the value is not actually being changed and so the event won't be fired.
    As an alternative why not try using the MouseDown event on the Form, you could say that if x is <120 Then sort by name else sort by number.

  4. giannimaione

    giannimaione Well-Known Member Licensed User

    Hey RandomCoder,

    I do not understand
    Can you make example?
  5. RandomCoder

    RandomCoder Well-Known Member Licensed User

    It's better for you to try first and if you experience a problem then were all here to help out.

    Basically what I was meaning by...
    is that if the stylus is tapped in the first half of the screen, i.e. where the name column is then sort the table by name else if tapped in the other half of the screen then sort by the number (presuming that the table divides the screen in two).

    Of course you could narrow down the positions so that only the table headers are covered, and I'd also advise setting the table enabled to false so that you can't accidentally change any values. When you need to change/add new values you could have a button at the bottom of the screen that allows this to be done.

    If you really feel that you want me to do it for you I will, it's just that I find it's always better to learn by trial and error rather than being handed a solution.
    Just remember that there's are no rights and wrongs with programming its like handwriting - everyone has there own style! (of course some peoples handwriting is more elegant than others ;))

  6. giannimaione

    giannimaione Well-Known Member Licensed User

    it is a nice and easy solution.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice