Свойство не может быть установлено на связанный с данными элемент управления datagridview. В VB.NET
Свойство не может быть установлено на связанный с данными элемент управления datagridview. В VB.NET
Что я уже пробовал:
con = New SqlConnection(conn) con.Open() ds = New DataSet() da = New SqlDataAdapter("select Cid,Name,Gender,dob,RationNo,PanId,voteId,Address,Phone,EmailId,NomineeStatus,photo from CustomerReg where statuss=1 ", con) da.Fill(ds) If ds.Tables(0).Rows.Count > 0 Then DataGridView1.AutoGenerateColumns = False DataGridView1.ColumnCount = 12 DataGridView1.Columns(0).Name = "cid" DataGridView1.Columns(0).HeaderText = "Customer ID" DataGridView1.Columns(0).DataPropertyName = "Cid" DataGridView1.Columns(1).Name = "Name" DataGridView1.Columns(1).HeaderText = "Customer Name" DataGridView1.Columns(1).DataPropertyName = "Name" DataGridView1.Columns(2).Name = "Gender" DataGridView1.Columns(2).HeaderText = "Gender" DataGridView1.Columns(2).DataPropertyName = "Gender" DataGridView1.Columns(3).Name = "DOB" DataGridView1.Columns(3).HeaderText = "DOB" DataGridView1.Columns(3).DataPropertyName = "DOB" DataGridView1.Columns(4).Name = "RationNO" DataGridView1.Columns(4).HeaderText = "Ration Card No" DataGridView1.Columns(4).DataPropertyName = "RationNO" DataGridView1.Columns(5).Name = "PanId" DataGridView1.Columns(5).HeaderText = "Pancard ID" DataGridView1.Columns(5).DataPropertyName = "PanId" DataGridView1.Columns(6).Name = "voteid" DataGridView1.Columns(6).HeaderText = "Voters ID" DataGridView1.Columns(6).DataPropertyName = "voteid" DataGridView1.Columns(7).Name = "Address" DataGridView1.Columns(7).HeaderText = "Address" DataGridView1.Columns(7).DataPropertyName = "Address" DataGridView1.Columns(8).Name = "Phone" DataGridView1.Columns(8).HeaderText = "Phone" DataGridView1.Columns(8).DataPropertyName = "Phone" DataGridView1.Columns(9).Name = "EmailId" DataGridView1.Columns(9).HeaderText = "Email ID" DataGridView1.Columns(9).DataPropertyName = "EmailId" DataGridView1.Columns(10).Name = "NomineeStatus" DataGridView1.Columns(10).HeaderText = "Nominee Status" DataGridView1.Columns(10).DataPropertyName = "NomineeStatus" DataGridView1.Columns(11).Name = "Photo" DataGridView1.Columns(11).HeaderText = "Photo" DataGridView1.Columns(11).DataPropertyName = "Photo" DataGridView1.DataSource = ds.Tables(0) DataGridView1.Refresh() End If con.Close() End Sub Private Sub DataGridView1_RowHeaderMouseClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DataGridView1.RowHeaderMouseClick ' Dim sts As String txtID.Text = DataGridView1.Rows(e.RowIndex).Cells(0).Value.ToString() txtName.Text = DataGridView1.Rows(e.RowIndex).Cells(1).Value.ToString() sex = DataGridView1.Rows(e.RowIndex).Cells(2).Value.ToString() If sex = "M" Then rbtmale.Checked = True Else rbtfmale.Checked = True End If DateTimePicker1.Value = DataGridView1.Rows(e.RowIndex).Cells(3).Value.ToString() txtrcno.Text = DataGridView1.Rows(e.RowIndex).Cells(4).Value.ToString() txtpcno.Text = DataGridView1.Rows(e.RowIndex).Cells(5).Value.ToString() txtvid.Text = DataGridView1.Rows(e.RowIndex).Cells(6).Value.ToString() txtaddress.Text = DataGridView1.Rows(e.RowIndex).Cells(7).Value.ToString() txtphone.Text = DataGridView1.Rows(e.RowIndex).Cells(8).Value.ToString() txtemail.Text = DataGridView1.Rows(e.RowIndex).Cells(9).Value.ToString() sts = DataGridView1.Rows(e.RowIndex).Cells(10).Value.ToString() If sts = "Y" Then CheckBox1.Checked = True Else CheckBox1.Checked = False End If fileName = DataGridView1.Rows(e.RowIndex).Cells(11).Value.ToString() PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage PictureBox1.ClientSize = New Size(177, 197) PictureBox1.Image = Image.FromFile(fileName)
Maciej Los
Это вовсе не вопрос!