I am new to using the WebHierarchicalDataGrid. I have a grid based on a XML file. One field in the XML is EstimatedDepartTime. In the XML is stored as "02/24/2012 4:30:00 AM". I want only the time to appear. However, the full Date and Time appears when I run my WebHierarchicalDataGrid.
This is the Markup language I have:<ig:BoundDataField DataFieldName="EstimatedDepartTime" Key="EstimatedDepartTime" DataFormatString="{0:t}" Header-Text="Estd Departure"></ig:BoundDataField>
I have also tried DataFormatString="{0:hh:mm}
Neither works. I would appreciate any help in resolving this.
Thank you.
Hi Dawson Lewis,
What if you put DataType="System.DateTime" on the field? XML doesn't really have types, so everything is returned as a string. You need to tell the grid how to treat this data.
regards,David Young
Thank you but that did not work. I tried this but no change.<ig:BoundDataField DataFieldName="EstimatedDepartTime" Key="EstimatedDepartTime" datatype="System.DateTime" DataFormatString="{0:hh:mm}" Header-Text="Estd Departure"></ig:BoundDataField>
I should have said in the original post that I am also using XML for the first time. I based the design of the XML file on a sample from Infragistics. It could be that I have not set that up correctly. Below is a sample.
<?xml version="1.0" encoding="utf-8" ?><Flights> <Flight AircraftName="King Air 90" Legs="2" FlightDate="08/21/2012" DefaultSeatNbr="7" > <Legs LegNbr="1" AirportFrom="Pierre" AirportTo="Vermillion" LegDate="02/21/2012" EstimatedDepartTime="02/21/2012 5:00:00 AM" ArrivalTime="02/21/2012 5:48:00 AM" /> </Legs> </Flight></Flights>