On Mon, Aug 14, 2006 at 11:19:36AM +0200, Elmar Haneke wrote:
> Hi,
> 
> I want to edit Values of type double within an Treeview. Therefore I did 
> user CellRendererText class for Display.
> 
> How can I control how many decimals are shown? Currentliy I get a lot of 
> trailing "0" - I would prefer to see "1" instead of "1.000000".

In your TreeCellDataFunc callback used for rendering, you'll want to
use the decimal ToString overload which takes a string format parameter.
Something like:

((CellRendererText)cell).Text = ((double)model.GetValue (iter, 0)).ToString 
("#.##");


hth,

-pete

-- 
Peter Johanson
<[EMAIL PROTECTED]>
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to