General information
Category:
The Mere Mortals .NET Framework
Jim,
Sorry, I didn’t catch that you wanted to manipulate the data before displaying it. You might take a look at the Format and Parse events of the textbox in the column. Another approach could be a calculated column in the dataset! There’s lots of ways to do things in .Net and I have found that best practices are not yet clearly defined.
You will sadly discover, that things that were very easy in VFP, are a Pain in .Net and usually require lots of code. I'm working hard at develping some base classes that should make life easier in the future. The forums have been a great help.
Regards,
Terry Carroll
>Terry,
>
>Thanks for the reply.
>
>The problem with the formatting the data is that it is not as simple as applying a picture to the converted number. There are 60 seconds in a minute, not 100; 60 minutes in an hour. So, I have to do some calculation before I can apply a picture.
>
>I consider this first project primarily a learning experience, but this won't be the last time I have to do something like this. Even more often, I would like to covert an enumerated type or encoded value to a more user friendly string. In VFP I could just put a function in the Refresh method for the textbox. If I were building the datagrid in code without a framework, I can see how to do it when I set the data binding. Now I need to figure out how to do it using the framework to set the binding.
>
>The MM framework is a big help. After taking Kevin's class last month, I sat down and got my first app up with the a simple form accessing a VFP table via OLE DB in just a couple hours. So far, I've spent about 12 hours trying to figure out how to format two columns in a datagrid on that form. I've learned a lot about C# and .Net, but not how to do what I thought should be a simple task once I displayed the raw data.
>
>...Jim
>
>>Hi Jim,
>>
>>Join the club. I think the message I just posted will help: Thread ID 863988. "Adding a Combobox to a DataGrid". Note there is also a format property for the column style. Check out the .Net help by searching on "Custom DateTime Format Strings" to get a handle on how to define the format strings.
>>
>>Regards,
>>
>>Terry Carroll
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only