02/04/10 8:30
Thejuster
uhm il problema e che un linguaggio va studiato.
va appreso e sopratutto in ogni suo minimo particolare per ottenere
i risultati sperati.
queste sono operazioni basilari, del tipo cambiare il nome dei campi di un Datagrid.
se non sei in grado di fare semplici operazioni come queste,
dubito che riuscirai a sviluppare programma del genere completo.
cmq ti basta andare sulle proprietà del controllo e da li puoi rinominare i campi come meglio credi.
va appreso e sopratutto in ogni suo minimo particolare per ottenere
i risultati sperati.
queste sono operazioni basilari, del tipo cambiare il nome dei campi di un Datagrid.
se non sei in grado di fare semplici operazioni come queste,
dubito che riuscirai a sviluppare programma del genere completo.
cmq ti basta andare sulle proprietà del controllo e da li puoi rinominare i campi come meglio credi.
mire.forumfree.it/ - Mire Engine
C# UI Designer
C# UI Designer
02/04/10 8:36
Il Totem
Il codice funziona, solo che non lo sai usare nel modo corretto.
Per mettere i numeri a lato, basta impostare correttamente il valore HeaderCell.Value di ogni riga. Ad esempio così:
Un "esempio concreto" varrebbe a dire che dovrei scriverti tutto il codice...
Per mettere i numeri a lato, basta impostare correttamente il valore HeaderCell.Value di ogni riga. Ad esempio così:
Dim Camere As Int32() = {101, 102, 108, 203, 207} For Each Row As DataGridViewRow In Data.Rows If Row.Index < Camere.Length Then Row.HeaderCell.Value = Camere(Row.Index) End If Next
Un "esempio concreto" varrebbe a dire che dovrei scriverti tutto il codice...
aaa
03/04/10 8:53
Il Totem
Il for enumera le righe della datagridview: peccato che all'inizio non ce ne siano, dato che il controllo è vuoto. Prime le devi aggiungere.
aaa
03/04/10 12:59
okins
scusate se ve lo chiedo...non è che me lo puoi correggee e mandarmelo?Per favore...
aaa
03/04/10 17:14
salva94
Io ho cercato di fare il code sono arrivato fin qui :
Ho utilizzato un Datatimepicker per gestire le griglie , e fin qui tutto bene , però salvare e individuare particolari colonne mi viene molto difficile , non avendo utilizzato mai il DateGrid non so come individuare ad esempio una cella su cui si scrive....
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Label1.Text = DateTimePicker1.Value.Month Dim giorni As Int32 giorni = DateTime.DaysInMonth(DateTimePicker1.Value.Year, DateTimePicker1.Value.Month) For i As Integer = 1 To giorni Data.Columns.Add("Colonna", i) Next End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click For i As Integer = 1 To TextBox1.Text Data.Rows.Add() Next End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Data.Rows.Clear() Data.Columns.Clear() Dim giorni As Int32 giorni = DateTime.DaysInMonth(DateTimePicker1.Value.Year, DateTimePicker1.Value.Month) For i As Integer = 1 To giorni Data.Columns.Add("Suti", i) Next Try For i As Integer = 1 To TextBox1.Text Data.Rows.Add() Next Catch ex As Exception End Try End Sub Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged Label1.Text = DateTimePicker1.Value.Month End Sub Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click If Label1.Text = "1" Then Label1.Text = "Gennaio" End If If Label1.Text = "2" Then Label1.Text = "Febbraio" End If If Label1.Text = "3" Then Label1.Text = "Marzo" End If If Label1.Text = "4" Then Label1.Text = "Aprile" End If If Label1.Text = "5" Then Label1.Text = "Maggio" End If If Label1.Text = "6" Then Label1.Text = "Giugno" End If If Label1.Text = "7" Then Label1.Text = "Luglio" End If If Label1.Text = "8" Then Label1.Text = "Agosto" End If If Label1.Text = "9" Then Label1.Text = "Settembre" End If If Label1.Text = "10" Then Label1.Text = "Ottobre" End If If Label1.Text = "11" Then Label1.Text = "Novembre" End If If Label1.Text = "12" Then Label1.Text = "Dicembre" End If End Sub Private Sub Data_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles Data.CellEndEdit Dim cella As Int32 cella = Data.Rows.Count * Data.Columns.Count For i As Integer = 1 To cella Next End Sub
Ho utilizzato un Datatimepicker per gestire le griglie , e fin qui tutto bene , però salvare e individuare particolari colonne mi viene molto difficile , non avendo utilizzato mai il DateGrid non so come individuare ad esempio una cella su cui si scrive....
aaa