code_junkie

Column cannot be added because its CellType property is null exception

Nov 12th, 2011
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. dgvCalls.Columns.Insert(1, msisnnColumn);
  2.  
  3. if (!(dgvCalls.Columns.Contains("DirectionImage")))
  4. {
  5. directionIconColumn = new DataGridViewImageColumn();
  6. directionIconColumn.Name = "DirectionImage";
  7. directionIconColumn.HeaderText = "";
  8. dgvCalls.Columns.Insert(0, directionIconColumn);
  9. directionIconColumn.CellTemplate = new DataGridViewImageCell();
  10. }
  11. if (!(dgvCalls.Columns.Contains("msisndColumn")))
  12. {
  13. msisnnColumn = new DataGridViewColumn();
  14. msisnnColumn.Name = "msisndColumn";
  15. msisnnColumn.HeaderText = "Klic";
  16. dgvCalls.Columns.Insert(1, msisnnColumn);
  17. msisnnColumn.CellTemplate = new DataGridViewTextBoxCell();
  18. }
  19.  
  20. dgvCalls.Columns.Insert(1, msisnnColumn);
  21. msisnnColumn.CellTemplate = new DataGridViewTextBoxCell();
Add Comment
Please, Sign In to add comment