[Mono-winforms-list] ListView vs DataGridView - which is more stable?

jmauster evan.arnold at gmail.com
Sat Jun 6 20:22:42 EDT 2009


Thanks for the help.:-) 

But, it turns out that I need to have rows of varying height, which I
believe is impossible in a list view, therefore I have gone with a
DataGridView. 

However, this row sizing is behaving a little strangely.  When I use the
code before, my text does not wrap and it does not autosize the rows,
although that seems like it is what should happen. 

public DataGridViewForm()
		{
			DataGridView dgv = new DataGridView();
			dgv.Parent = this;
			DataGridViewTextBoxColumn colDisplayDate = new
DataGridViewTextBoxColumn();
			DataGridViewTextBoxColumn colDisplayText = new
DataGridViewTextBoxColumn();
			colDisplayDate.Name = "Display Date";
			colDisplayDate.Width = 100;
			colDisplayText.Name = "Note Text";
			colDisplayText.Width = 150;
			dgv.Columns.Add(colDisplayDate);
			dgv.Columns.Add(colDisplayText);
			dgv.Rows.Add("Display Date 1", "Display Note");
			dgv.Rows.Add("Second Date", "Lorem ipsum dolor  ... [a long string]
...");
			dgv.Dock = DockStyle.Fill;
			dgv.DefaultCellStyle.WrapMode = DataGridViewTriState.True;
			dgv.AutoSizeRowsMode  = DataGridViewAutoSizeRowsMode.AllCells;
			
		}


Any other thoughts?

Thanks again,



Carlos Alberto wrote:
> 
> ListView should do enough for that you need - also, take into account that
> *some* features of DataGridView hadn't been implemented yet.
> 
> Carlos.
> 
> 2009/6/5 jmauster <evan.arnold at gmail.com>
> 
>>
>> Hi,
>>
>> I am new to Mono and I am building a simple application that will display
>> a
>> two-column table with no more than 100 rows at a time. I believe I can do
>> this equally well with ListView and DataGridView, however - I was
>> wondering
>> which of these is more stable.
>>
>> Any thoughts?
>>
>> Thanks,
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/ListView-vs-DataGridView---which-is-more-stable--tp23891679p23891679.html
>> Sent from the Mono - WinForms mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
>>
> 
> _______________________________________________
> Mono-winforms-list maillist  -  Mono-winforms-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-winforms-list
> 
> 

-- 
View this message in context: http://www.nabble.com/ListView-vs-DataGridView---which-is-more-stable--tp23891679p23906831.html
Sent from the Mono - WinForms mailing list archive at Nabble.com.



More information about the Mono-winforms-list mailing list