Predmet:Re: hidden field - visible false
evo koda
problem mi je sa poljem txt.KCID koje želim da bude visible false
Public Class PodaciSaRelacije
Private Sub T_KONTROLA_DFBindingNavigatorSaveItem_Click(sender
As Object, e As EventArgs) Handles T_KONTROLA_DFBindingNavigatorSaveItem.Click
Try
Me.Validate()
Me.T_KONTROLA_DFBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.KontrolaPodataka_DataSet)
Me.T_KONTROLA_CFTableAdapter.Update(Me.KontrolaPodataka_DataSet)
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub
Private Sub PodaciSaRelacije_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.T_VOZACITableAdapter.Fill(Me.KontrolaPodataka_DataSet.T_VOZACI)
Me.T_KONTROLA_CFTableAdapter.Fill(Me.KontrolaPodataka_DataSet.T_KONTROLA_CF)
Me.T_KCTableAdapter.Fill(Me.KontrolaPodataka_DataSet.T_KC)
Me.T_KONTROLA_DFTableAdapter.Fill(Me.KontrolaPodataka_DataSet.T_KONTROLA_DF)
KeyPreview = True
Dim myCulture As System.Globalization.CultureInfo = Globalization.CultureInfo.CurrentCulture
Dim dayName As String = myCulture.DateTimeFormat.GetDayName(DateTime.Parse(KNT_DF_DATUMTextBox.Text).DayOfWeek)
TXT_Dan.Text = dayName
txt_Ime.Text = Login.Ime
txt_KCID.Text = KC_ID
Dim strHostName As String
Dim strIPAddress As String
strHostName = System.Net.Dns.GetHostName()
strIPAddress = System.Net.Dns.GetHostByName(strHostName).AddressList(0).ToString()
txt_CompName.Text = strHostName
txt_IP.Text = strIPAddress
End Sub
Private Sub CustomDataGridView1_CellDoubleClick_1(sender As Object, e As DataGridViewCellEventArgs) Handles CustomDataGridView1.CellDoubleClick
If CustomDataGridView1.Columns(e.ColumnIndex).HeaderText = "KNT_CF_VOZAC_ID" Then
Vozaci.Show()
ElseIf CustomDataGridView1.Columns(e.ColumnIndex).HeaderText = "KNT_DRUGI_VZC_ID" Then
Vozaci.Show()
ElseIf CustomDataGridView1.Columns(e.ColumnIndex).HeaderText = "KNT_CF_RELACIJE_ID" Then
Relacije.Show()
ElseIf CustomDataGridView1.Columns(e.ColumnIndex).HeaderText = "KNT_VOZILO_ID" Then
Vozila.Show()
End If
End Sub
Private Sub PodaciSaRelacije_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
e.Handled = True
e.SuppressKeyPress = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub CustomDataGridView1_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles CustomDataGridView1.CellEndEdit
Dim Vozac, Relacija, Vozilo As New KontrolaPodataka_DataSetTableAdapters.T_KONTROLA_CFTableAdapter
Dim KCID = Login.KC_ID
If e.ColumnIndex = 0 Then
For i As Integer = 0 To Me.CustomDataGridView1.RowCount - 1
For j As Integer = i + 1 To Me.CustomDataGridView1.RowCount - 1
If CustomDataGridView1.Rows(i).Cells(0).Value = CustomDataGridView1.Rows(j).Cells(0).Value Then
MessageBox.Show("dupli unos " & CustomDataGridView1.Rows(i).Cells(0).Value)
SendKeys.Send("{left}")
SendKeys.Send("{left}")
End If
Next
Next
If Val(CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) > 0 Then
If Not IsNothing(Vozac.VozacImePrezime(CInt(Val(CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value)), KCID)) Then
CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex + 1).Value = Vozac.VozacImePrezime(CInt(Val(CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value)), KCID)
CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex + 4).Value = "Redovna posada"
Else
If Not String.IsNullOrEmpty(CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) Then
If Not String.IsNullOrEmpty(Trim(CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value.ToString())) Then
MessageBox.Show("PogreÅ¡an ID vozača ili vozač ne pripada odabranom KC")
SendKeys.Send("{left}")
SendKeys.Send("{left}")
End If
End If
End If
End If
End If
'If e.ColumnIndex = 2 Then
'
'
' 'On Error Resume Next
' If Val(CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) > 0 Then
'
'
' CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex + 1).Value = Vozac.VozacImePrezime(CInt(Val(CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value)), KCID)
'
' CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex + 2).Value = "Dupla posada"
'
' End If
'
'End If
'
'
'
'' On Error Resume Next
'If e.ColumnIndex = 5 Then
'
' If Val(CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) > 0 Then
'
' CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex + 1).Value = Relacija.RelacijaNaziv(CInt(Val(CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value)))
'
' End If
'
'End If
'
'If e.ColumnIndex = 7 Then
'
' If Val(CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) > 0 Then
'
' CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex + 1).Value = Vozilo.VoziloRegistracija(CInt(Val(CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value)))
'
' End If
'
'End If
End Sub
Private Function CleanInputNumber(ByVal str As String) As String
Return System.Text.RegularExpressions.Regex.Replace(str, "91", "1")
End Function
Private Sub KNT_DF_DATUMTextBox_Leave(sender As Object, e As EventArgs) Handles KNT_DF_DATUMTextBox.Leave
Dim myCulture As System.Globalization.CultureInfo = Globalization.CultureInfo.CurrentCulture
Dim dayOfWeek As DayOfWeek = DateTime.Parse(KNT_DF_DATUMTextBox.Text).DayOfWeek
Dim dayName As String = myCulture.DateTimeFormat.GetDayName(dayOfWeek)
TXT_Dan.Text = dayName
txt_KCID.Text = Login.KC_ID
End Sub
Private Sub KNT_DF_IDTextBox_TextChanged(sender As Object, e As EventArgs) Handles KNT_DF_IDTextBox.TextChanged
Dim myCulture As System.Globalization.CultureInfo = Globalization.CultureInfo.CurrentCulture
Dim dayOfWeek As DayOfWeek = DateTime.Parse(KNT_DF_DATUMTextBox.Text).DayOfWeek
Dim dayName As String = myCulture.DateTimeFormat.GetDayName(dayOfWeek)
TXT_Dan.Text = dayName
End Sub
Private Sub CustomDataGridView1_CellLeave(sender As Object, e As DataGridViewCellEventArgs) Handles CustomDataGridView1.CellLeave
End Sub
Private Sub CustomDataGridView1_CellValidating(sender As Object, e As DataGridViewCellValidatingEventArgs) Handles CustomDataGridView1.CellValidating
'If CustomDataGridView1.CurrentRow.Cells("KNT_CF_VOZAC_ID").IsInEditMode Then
'
' Dim c As Control = CustomDataGridView1.EditingControl
'
' Select Case CustomDataGridView1.Columns(e.ColumnIndex).Name
'
' Case "KNT_CF_VOZAC_ID"
' c.Text = CleanInputNumber(c.Text)
'
' 'Case "yColumn"
' ' c.Text = CleanInputAlphabet(c.Text)
'
' End Select
'End If
'If CustomDataGridView1.Columns(e.ColumnIndex).DataPropertyName = "KNT_CF_VOZAC_ID" AndAlso e.FormattedValue.ToString() <> CustomDataGridView1(e.ColumnIndex, e.RowIndex).Value.ToString() Then
'
' Dim dt As DataTable = CType(CustomDataGridView1.DataSource, DataTable)
'
' Dim rows As DataRow() = dt.Select("KNT_CF_VOZAC_ID = " & e.FormattedValue)
'
' If rows.Length > 0 Then
'
' MessageBox.Show("This value is already used.")
'
' e.Cancel = True
'
' End If
'
'End If
'If e.Column.Name = "KNT_CF_VOZAC_ID" AndAlso e.Row.Cells("Column1").Value = "Age" AndAlso IsNumeric() = False Then
' 'we will prevent the user from leaving the cell unless s/he entered numeric value for this cell
' e.Cancel = True
'End If
End Sub
End Class