We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

questions of datarow

I met a few questions when I use datagrid. 1.When I use dataview as a datasource instead of dataset. The tablestyle property doesn't work. So how to customer each column style as I wanted. 2. If I use dataset/data table as a datasource. I can define the table style for the grid. However, i couldn't control the new row. I hope i can add a new row by program instead of appear automatically. Is there a way to prevent the newrow appear? 3. Is there a way to write multiple lines in the column header? 4. When double click the mouse while the mouse cursor is in between two rows (resize the row heights). There is always an out of index exception. how to prevent that? Thanks

2 Replies

AL Abraham Luna November 15, 2002 01:31 PM

> I met a few questions when I use datagrid. > 1.When I use dataview as a datasource instead of dataset. The tablestyle property doesn't work. > So how to customer each column style as I wanted. > > 2. If I use dataset/data table as a datasource. I can define the table style for the grid. However, i couldn't control the new row. I hope i can add a new row by program instead of appear automatically. Is there a way to prevent the newrow appear? first set the addnew property of the defaultview to false before binding the datagrid to the datatable. like this: dtDataTable.DefaultView.AddNew = False dgDataGrid.DataSource = dtDataTable > > 3. Is there a way to write multiple lines in the column header? i'm not sure > > 4. When double click the mouse while the mouse cursor is in between two rows (resize the row heights). There is always an out of index exception. how to prevent that? > if you find the answer let me know :) at abe@attilanet.com > Thanks


UE UESTC November 30, 2002 11:18 PM

> 3. Is there a way to write multiple lines in the column header? Maybe you can build a new class which inherit from DataGridTextBoxColumn, then use your own class instead of the origin DataGridTextBoxColumn.

Loader.
Live Chat Icon For mobile
Up arrow icon