Click here to Skip to main content
15,898,222 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Filtering a Datagridview with an external Combo Box Pin
Wendelius2-Feb-09 6:54
mentorWendelius2-Feb-09 6:54 
GeneralRe: Filtering a Datagridview with an external Combo Box Pin
Kumungi2-Feb-09 17:17
Kumungi2-Feb-09 17:17 
GeneralRe: Filtering a Datagridview with an external Combo Box Pin
Kumungi3-Feb-09 1:44
Kumungi3-Feb-09 1:44 
GeneralRe: Filtering a Datagridview with an external Combo Box Pin
Wendelius3-Feb-09 7:01
mentorWendelius3-Feb-09 7:01 
Questionset up project Pin
hrishiS31-Jan-09 2:10
hrishiS31-Jan-09 2:10 
Question[Message Deleted] Pin
svt gdwl30-Jan-09 23:11
svt gdwl30-Jan-09 23:11 
AnswerCross-post Pin
Wendelius30-Jan-09 23:33
mentorWendelius30-Jan-09 23:33 
QuestionNumber formats Pin
PIEBALDconsult30-Jan-09 16:16
mvePIEBALDconsult30-Jan-09 16:16 
I'm working on a utility that will allow the user to query some data from a database and output it.
I would like to support allowing the user to provide a format for the numbers, particularly if hexadecimal representation is desired.
Ideally I could simply do ((System.IFormattable) datarow [ columnname ]).ToString ( format , null ), but when hexadecimal is requested the user may (should) want to tack on a leading "0x" and I've been unable to form a format that will do that.

What should work is "'0x'X4", the '0x' should be copied to the output and then the value should be formatted with X4.

From the documentation:
"
'ABC' "ABC"
Literal string
Characters enclosed in single or double quotes are copied to the result string, and do not affect formatting.
"

Bull-pucky; they do affect formatting, they screw it up!


The closest I've gotten is string.Format ( format , datarow [ columnname ] ) with a format of "0x{0:X4}", but the user shouldn't need to specify the braces and such.

I'm considering using a Regular Expression and pre-processing the format to remove literal text before passing it to ToString, and concatenating the thing back together afterward.


I'm hoping someone here has a better solution.
AnswerRe: Number formats Pin
Wendelius30-Jan-09 23:56
mentorWendelius30-Jan-09 23:56 
GeneralRe: Number formats Pin
PIEBALDconsult31-Jan-09 3:48
mvePIEBALDconsult31-Jan-09 3:48 
GeneralRe: Number formats Pin
Wendelius31-Jan-09 4:05
mentorWendelius31-Jan-09 4:05 
GeneralRe: Number formats Pin
PIEBALDconsult31-Jan-09 5:33
mvePIEBALDconsult31-Jan-09 5:33 
GeneralRe: Number formats Pin
Wendelius31-Jan-09 6:01
mentorWendelius31-Jan-09 6:01 
GeneralRe: Number formats Pin
PIEBALDconsult31-Jan-09 11:18
mvePIEBALDconsult31-Jan-09 11:18 
GeneralRe: Number formats Pin
Wendelius31-Jan-09 11:26
mentorWendelius31-Jan-09 11:26 
GeneralRe: Number formats Pin
PIEBALDconsult31-Jan-09 11:28
mvePIEBALDconsult31-Jan-09 11:28 
GeneralRe: Number formats Pin
Wendelius31-Jan-09 11:31
mentorWendelius31-Jan-09 11:31 
GeneralRe: Number formats Pin
PIEBALDconsult31-Jan-09 15:50
mvePIEBALDconsult31-Jan-09 15:50 
GeneralRe: Number formats Pin
PIEBALDconsult1-Feb-09 16:39
mvePIEBALDconsult1-Feb-09 16:39 
QuestionHooking into Visual Studio 2008 Designer drag events Pin
astibich230-Jan-09 9:55
astibich230-Jan-09 9:55 
AnswerRe: Hooking into Visual Studio 2008 Designer drag events Pin
Thomas Stockwell1-Feb-09 14:23
professionalThomas Stockwell1-Feb-09 14:23 
QuestionOwner of a file Pin
pedefetoll29-Jan-09 22:08
pedefetoll29-Jan-09 22:08 
AnswerRe: Owner of a file Pin
Dave Kreskowiak30-Jan-09 10:31
mveDave Kreskowiak30-Jan-09 10:31 
AnswerRe: Owner of a file Pin
Jon Rista3-Feb-09 9:49
Jon Rista3-Feb-09 9:49 
QuestionDistributed computing and multithreaded primers Pin
Member 260377229-Jan-09 18:39
Member 260377229-Jan-09 18:39 

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.