मुझे कोड के निम्नलिखित भाग में समस्या है। जब मैं डीबगर के माध्यम से जाना मैं एक अपवाद प्राप्त जब यह निम्न पंक्ति की बात आती है:कॉलम जोड़ा नहीं जा सकता है क्योंकि इसकी सेलटाइप संपत्ति शून्य अपवाद
dgvCalls.Columns.Insert(1, msisnnColumn);
मैं एक अपवाद मिलती है: क्योंकि उसके CellType संपत्ति शून्य है
कॉलम जोड़ा नहीं जा सकता।
विचित्र रूप से, मैंने कुछ अन्य डेटाग्रिड व्यू के लिए एक ही प्रक्रिया बनाई और यह ठीक काम किया।
if (!(dgvCalls.Columns.Contains("DirectionImage")))
{
directionIconColumn = new DataGridViewImageColumn();
directionIconColumn.Name = "DirectionImage";
directionIconColumn.HeaderText = "";
dgvCalls.Columns.Insert(0, directionIconColumn);
directionIconColumn.CellTemplate = new DataGridViewImageCell();
}
if (!(dgvCalls.Columns.Contains("msisndColumn")))
{
msisnnColumn = new DataGridViewColumn();
msisnnColumn.Name = "msisndColumn";
msisnnColumn.HeaderText = "Klic";
dgvCalls.Columns.Insert(1, msisnnColumn);
msisnnColumn.CellTemplate = new DataGridViewTextBoxCell();
}
कोई सुझाव?
आप इसे हाइलाइट करके और संपादन टेक्स्टरेरा के ठीक नीचे छोटे 0101010 आइकन पर क्लिक करके कोड को आसानी से पढ़ने के प्रारूप में प्रदर्शित कर सकते हैं। – DOK