Select a Tabelview entry?

View: New views
7 Messages — Rating Filter:   Alert me  

Select a Tabelview entry?

by Stefan Miefert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

how can i select a tableview entry?

I use this code

Public sub tableview_data(Row AS Integer, Column AS Integer)

RESdata.MoveTo(Row)
Tableview.data.text = Str(REsdata(RESdata.fields[column].name])


        If Column =  0 then
                ' How can I select this entry?!
        End if
end

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Select a Tabelview entry?

by Rolf-Werner Eilert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stefan Miefert schrieb:

> Hello,
>
> how can i select a tableview entry?
>
> I use this code
>
> Public sub tableview_data(Row AS Integer, Column AS Integer)
>
> RESdata.MoveTo(Row)
> Tableview.data.text = Str(REsdata(RESdata.fields[column].name])
>
>
>         If Column =  0 then
>                 ' How can I select this entry?!
>         End if
> end
>
>

I wouldn't do it in the _data event but somewhere else. Then try

Tableview.MoveTo(Row, Column)
Tableview.Current.Selected = True

Rolf

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Select a Tabelview entry?

by Stefan Miefert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> I wouldn't do it in the _data event but somewhere else. Then try
>
> Tableview.MoveTo(Row, Column)
> Tableview.Current.Selected = True


Hello,

hm, this dosent work. Their is no select/selected after the "TBLview.xxxx"



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Select a Tabelview entry?

by Stefan Miefert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> Tableview.MoveTo(Row, Column)
> Tableview.Current.Selected = True

Hello,

I try this
Tableview.Rows[3].selected = true

Because your example dosent work.
This  is running fine but how can I get the rownumber?
Tableview.find(row,column) #
Didn't work? Or? How can I get the rownumber ?

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Select a Tabelview entry?

by Rolf-Werner Eilert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stefan Miefert schrieb:

>> I wouldn't do it in the _data event but somewhere else. Then try
>>
>> Tableview.MoveTo(Row, Column)
>> Tableview.Current.Selected = True
>
>
> Hello,
>
> hm, this dosent work. Their is no select/selected after the "TBLview.xxxx"
>


Oops - sorry, I didn't look this up before I answered...

You're right, it's Tableview.Rows[something].Selected

Maybe there are 2 things: not to write it in the _data event AND look
which mode the control has for selecting Rows and Columns. I always use
Line mode, never Both.

Rolf

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Select a Tabelview entry?

by Stefan Miefert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



> Oops - sorry, I didn't look this up before I answered...
>
> You're right, it's Tableview.Rows[something].Selected
>
> Maybe there are 2 things: not to write it in the _data event AND look
> which mode the control has for selecting Rows and Columns. I always use
> Line mode, never Both.

Hello,

And how you do it?

How can I get the rownumber for a specified entry?
Direct after the sqlquery there is nothing in the table. I think the data is filled asyncron?
When you get the value of  a field  and how you select it?

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user

Re: Select a Tabelview entry?

by Bugzilla from gambas@users.sourceforge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On lundi 23 juin 2008, Stefan Miefert wrote:

> > Tableview.MoveTo(Row, Column)
> > Tableview.Current.Selected = True
>
> Hello,
>
> I try this
> Tableview.Rows[3].selected = true
>
> Because your example dosent work.
> This  is running fine but how can I get the rownumber?
> Tableview.find(row,column) #
> Didn't work? Or? How can I get the rownumber ?
>

Your question is not very clear. Which rownumber of what do you want? If you
are inside the Data event, the row number is given by the 'Row' function
parameter. Otherwise, I don't see what you are talking about.

--
Benoit Minisini

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Gambas-user mailing list
Gambas-user@...
https://lists.sourceforge.net/lists/listinfo/gambas-user