Programmatically adding cells to a datagrid
-
Hi all. I'd like to add new cells to a datagrid, which I'm doing: .Items().Cells.Add() But how do I set the header text of the new cell? Regards, Mark
Well, header is for column not the cell. To set the columns header text use this code:
DataGrid1.Columns[0].HeaderText
-- Mariusz 'mAv' Wójcik master e-software engineer (BPC)
-
Well, header is for column not the cell. To set the columns header text use this code:
DataGrid1.Columns[0].HeaderText
-- Mariusz 'mAv' Wójcik master e-software engineer (BPC)
A better way to think of this might be to think in terms of what the datagrid reflects. Use a datatable *behind* the grid. You can easily add/remove/modify/sort the data there and then just rebind the grid when you do this. Hope this helps, *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";