[Gambas-user] Questions about SQLIte and Data Objects

acidblue sunblaster5 at ...626...
Thu Sep 6 01:36:18 CEST 2012




Benoît Minisini wrote:
> 
> Le 10/08/2012 01:34, acidblue a écrit :
>>
>> I noticed when i use 'datetime' as a type in sqlite it also adds a time
>> at
>> the end the date:
>> 8/9/2012 00:00:00 when displayed in a dataview box.
>>
>> Is there a way to NOT display the time, just the date?
> 
> I think I have some sort of solution for you, in revision #5059:
> 
> DataView now raises a "Data" event, exactly like the GridView control, 
> except that the Data event handler receives three arguments: the row, 
> the column and the database value.
> 
> In that event handler, you will be able to define the cell visual 
> contents through the new DataView.Data property (exactly like GridView).
> 
> So, to not display the time part of the date:
> 
> Public Sub MyDataView_Data(Row As Integer, Column As Integer, Value As 
> Variant)
> 
>    ' Let's suppose that the date is in the third column.
>    If Column = 2 Then MyDataView.Data.Text = Format(Value, gb.ShortDate)
> 
>    ' By default, the other columns will be displayed the old way.
> 
> End
> 
>>
>> I have to re-adjust the column widths every time program loads,(using
>> dataview),this is inherited
>> of the length of the Varchar and string elements in the database.
>> Is there a way to adjust the column widths to my liking and have them
>> stay
>> that way?
> 
> I think so, as the DataView.View property will return its underlying 
> TableView for you. That way, you can redefine the width of each 
> TableView column as you like.
> 
> Maybe I should add a "Load" event that would be raised each time the 
> DataView contents has been loaded from the database. That way, you won't 
> have to worry about when exactly you should apply the columns widths...
> 
>>
>> I've tried using both the datacombo and the datacomboview but have
>> received
>> error messages when I do.
>> "Unknown symbol in HeaderHieght in class", Grid_viewRows"
>> But when I double click either the datacomdo or the comboview to enter
>> code
>> gambas crashes.
>>
> 
> Please provide the details: exact error messages, little project
> example...
> 
> -- 
> Benoît Minisini
> 
> Forgive my ignorance but where do I find the DataBrowser sub routine?
> It's not listed in the FMain code, and if I create it a I get an error:
> "DataBrowser1 already declared"
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 
> 

-- 
View this message in context: http://old.nabble.com/Questions-about-SQLIte-and-Data-Objects-tp34279714p34395138.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list