Click here to Skip to main content
16,004,192 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to group a column of string in vb.net report? Pin
Member 103570799-Feb-16 21:54
Member 103570799-Feb-16 21:54 
AnswerRe: How to group a column of string in vb.net report? Pin
Gilus'17-Feb-16 18:46
Gilus'17-Feb-16 18:46 
QuestionMake application's forms independent from Screen resolution Pin
satc7-Feb-16 1:47
satc7-Feb-16 1:47 
AnswerRe: Make application's forms independent from Screen resolution Pin
Eddy Vluggen7-Feb-16 8:11
professionalEddy Vluggen7-Feb-16 8:11 
GeneralRe: Make application's forms independent from Screen resolution Pin
satc7-Feb-16 8:17
satc7-Feb-16 8:17 
GeneralRe: Make application's forms independent from Screen resolution Pin
Eddy Vluggen7-Feb-16 8:37
professionalEddy Vluggen7-Feb-16 8:37 
GeneralRe: Make application's forms independent from Screen resolution Pin
satc7-Feb-16 8:41
satc7-Feb-16 8:41 
GeneralRe: Make application's forms independent from Screen resolution Pin
Eddy Vluggen7-Feb-16 8:56
professionalEddy Vluggen7-Feb-16 8:56 
GeneralRe: Make application's forms independent from Screen resolution Pin
satc7-Feb-16 9:18
satc7-Feb-16 9:18 
GeneralRe: Make application's forms independent from Screen resolution Pin
Eddy Vluggen7-Feb-16 9:23
professionalEddy Vluggen7-Feb-16 9:23 
GeneralRe: Make application's forms independent from Screen resolution Pin
satc7-Feb-16 9:24
satc7-Feb-16 9:24 
GeneralRe: Make application's forms independent from Screen resolution Pin
Eddy Vluggen7-Feb-16 9:40
professionalEddy Vluggen7-Feb-16 9:40 
GeneralRe: Make application's forms independent from Screen resolution Pin
satc7-Feb-16 8:54
satc7-Feb-16 8:54 
SuggestionRe: Make application's forms independent from Screen resolution Pin
Richard Deeming8-Feb-16 2:20
mveRichard Deeming8-Feb-16 2:20 
GeneralRe: Make application's forms independent from Screen resolution Pin
satc9-Feb-16 5:24
satc9-Feb-16 5:24 
QuestionDatagridview date sort - Tons of examples online, no answers Pin
Dan Chapin5-Feb-16 3:09
Dan Chapin5-Feb-16 3:09 
I have an xml file that I am loading into a datagridview. Pretty simple and loads with no problem.

<?xml version="1.0" encoding="utf-8"?>
<!--Project Time Tracking-->
<TimeTracking>
  <Ticket Client="150-338" Code="Overview" Call="33685" Start_Time="1/12/2015 10:04:56 AM" Stop_Time="1/12/2015 2:09:04 PM" TimeNote="">04:04:08</Ticket>
  <Ticket Client="150-310" Code="Documents" Call="32201" Start_Time="11/20/2014 11:42:20 AM" Stop_Time="11/20/2014 3:21:04 PM" TimeNote="install and test 1099 again internally.">04:39:44</Ticket>
  <Ticket Client="609-327" Code="Misc Implementation" Call="34453" Start_Time="2/20/2015 10:15:36 AM" Stop_Time="2/20/2015 10:45:36 AM" TimeNote="Help with docusign and discuss Trust account">00:30:00</Ticket>
</TimeTracking>


Now, as you can see there is a Start_Time and Stop_Time column. Like tons of other folks, I am trying to sort the date columns Descending with no luck. When I use the grid to sort, or add my own programmatic sorting, it does not sort in date order, but in text format. From what I have read, this is because the data is being seen as a string and not a date.

Below is my simple code to load the xml

Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
       Dim myXMLTime As String = "C:\myBSG\myBSGTimeclock.xml"
       DataGridView2.Columns.Clear()
       DataGridView2.Rows.Clear()

       dsTime.ReadXml(myXMLTime)
       DataGridView2.DataSource = dsTime
       DataGridView2.DataMember = "Ticket"

       DataGridView2.Sort(DataGridView2.Columns(6), System.ComponentModel.ListSortDirection.Descending)
   End Sub


I have played with literally hundreds of examples I have found online which attempt to address this problem with no success. Some have loaded the data into a datatable or a Dataset in an attempt to sort it there and then use that to load the datagridview. Either they did not work or were to complex for me to understand as a beginner. I cannot imagine that this could be THAT difficult as there have to be plenty of folks that need to sort by date in the Datagridview.

I need to sort load the grid with ReadXML and then be able to modify as necessary and write it back to xml using WriteXML

Any help that could be offered would be greatly appreciated!

Dan
Dan Chapin

AnswerRe: Datagridview date sort - Tons of examples online, no answers Pin
Dave Kreskowiak5-Feb-16 4:09
mveDave Kreskowiak5-Feb-16 4:09 
AnswerRe: Datagridview date sort - Tons of examples online, no answers Pin
Richard Deeming5-Feb-16 4:24
mveRichard Deeming5-Feb-16 4:24 
QuestionHow to set textbox readonly from Selected value from Combobox Pin
Reginald_13-Feb-16 2:14
Reginald_13-Feb-16 2:14 
AnswerRe: How to set textbox readonly from Selected value from Combobox Pin
Dave Kreskowiak3-Feb-16 2:45
mveDave Kreskowiak3-Feb-16 2:45 
GeneralRe: How to set textbox readonly from Selected value from Combobox Pin
Reginald_19-Feb-16 7:54
Reginald_19-Feb-16 7:54 
GeneralRe: How to set textbox readonly from Selected value from Combobox Pin
Dave Kreskowiak9-Feb-16 8:31
mveDave Kreskowiak9-Feb-16 8:31 
AnswerRe: How to set textbox readonly from Selected value from Combobox Pin
ZurdoDev9-Feb-16 8:15
professionalZurdoDev9-Feb-16 8:15 
Questionvb Pin
Member 123040962-Feb-16 18:34
Member 123040962-Feb-16 18:34 
GeneralRe: vb Pin
PIEBALDconsult2-Feb-16 18:34
mvePIEBALDconsult2-Feb-16 18:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.