c# - Get all the values of a dataGridTextboxColumn -


I have a datagrid view that has a date called column, which is a type of system. Datetime I want to put these dates in a month, do I have to iterate through the column? Do I need to put it?

To get the date from each column, you have to iterate from all the rows, as in the column If you are displaying dates in the form of text you will need to parse by using the DateTime.Parse or DateTime.TryParse methods.

Edit: - It is believed that the applications of forms I have used a DataGridView , a MonthCalendar and a button Added I was able to get the date from Gridview and could make the selected dates bold in the month.

  Public form 2 () {InitializeComponent (); CreateData (); } Private Zero CreateData () {var dtb = New DataTable (); Dtb.Columns.Add ("column1"); Dtb.Columns.Add ("Column2"); Dtb.Columns.Add ("Column 3"); Var dt = DateTime.Now; Var rand = new random (); (Var i = 0; i & lt; 10; i ++) for {var r = dtb.NewRow (); R.ItemArray = New Object [] {dt.ToString ("ddd"), DT ToString ("MMM"), dt}; Dt = dt.AddDays (rand.Next (30)); Dtb.rows.Add (r); } DataGrid View1.DataSource = dtb; } Private Zero Button 1_Click (Object Sender, EventEurge E) {var BDS = New list & lt; DateTime & gt; (); Forex Currency (DataGridViewRow in the DataGridView1.Rows) {DateTime dt; Var B = DateTime Trips (row Seals [row.Cell number -1]. Value + "", DT out); If (! B) will continue; Bds.Add (DT); } Cal.BoldedDates = bds.ToArray (); }  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -