Click here to Skip to main content
15,910,009 members
Home / Discussions / C#
   

C#

 
GeneralRe: converting vb.net code to c# Pin
Heath Stewart22-Jun-04 8:18
protectorHeath Stewart22-Jun-04 8:18 
GeneralRe: converting vb.net code to c# Pin
vijju0422-Jun-04 10:28
vijju0422-Jun-04 10:28 
GeneralRe: converting vb.net code to c# Pin
Heath Stewart22-Jun-04 10:36
protectorHeath Stewart22-Jun-04 10:36 
GeneralRe: converting vb.net code to c# Pin
Heath Stewart22-Jun-04 8:29
protectorHeath Stewart22-Jun-04 8:29 
GeneralRe: converting vb.net code to c# Pin
LongRange.Shooter22-Jun-04 10:00
LongRange.Shooter22-Jun-04 10:00 
GeneralRe: converting vb.net code to c# Pin
Heath Stewart22-Jun-04 10:32
protectorHeath Stewart22-Jun-04 10:32 
GeneralAuto adjust column width Pin
vcorn22-Jun-04 7:44
vcorn22-Jun-04 7:44 
GeneralRe: Auto adjust column width Pin
Heath Stewart22-Jun-04 8:12
protectorHeath Stewart22-Jun-04 8:12 
There is no automatic adjustment for the DataGrid like there is for the ListView (not data-bindable). You must either guess at design-time, or when the DataGrid is loading, enumerate the DataGrid.TableStyles collection property, and enumerate each's GridColumnStyles collection property. Get the text and use Graphics.MeasureString using the Font property of the DataGrid. Set the current column's Width accordingly.

This only works when 1) you're using explicitly defined table and column styles before data is bound, or 2) after data is bound to the DataGrid.

 

Microsoft MVP, Visual C#
My Articles
GeneralHelp me with an e-mail. Pin
svenakela22-Jun-04 7:36
svenakela22-Jun-04 7:36 
Generalconverting vb.net code to c# Pin
vijju0422-Jun-04 7:35
vijju0422-Jun-04 7:35 
GeneralRe: converting vb.net code to c# Pin
Heath Stewart22-Jun-04 8:06
protectorHeath Stewart22-Jun-04 8:06 
GeneralSaving a collection of a class into form`s code. Pin
Member 114126622-Jun-04 6:41
Member 114126622-Jun-04 6:41 
GeneralRe: Saving a collection of a class into form`s code. Pin
Heath Stewart22-Jun-04 8:04
protectorHeath Stewart22-Jun-04 8:04 
GeneralRe: Saving a collection of a class into form`s code. Pin
Member 114126622-Jun-04 20:00
Member 114126622-Jun-04 20:00 
GeneralRe: Saving a collection of a class into form`s code. Pin
Heath Stewart22-Jun-04 20:11
protectorHeath Stewart22-Jun-04 20:11 
QuestionSuppress click at load??? Pin
betterc22-Jun-04 6:39
betterc22-Jun-04 6:39 
AnswerRe: Suppress click at load??? Pin
Heath Stewart22-Jun-04 8:02
protectorHeath Stewart22-Jun-04 8:02 
GeneralWindows Service Problem (Capture screen) Pin
Milos.Sakovic22-Jun-04 5:15
Milos.Sakovic22-Jun-04 5:15 
GeneralRe: Windows Service Problem (Capture screen) Pin
Heath Stewart22-Jun-04 6:22
protectorHeath Stewart22-Jun-04 6:22 
QuestionPropertyGrid for Remote object? Pin
zericsson22-Jun-04 5:15
zericsson22-Jun-04 5:15 
GeneralDirectPlay Pin
bouli22-Jun-04 4:32
bouli22-Jun-04 4:32 
GeneralRe: DirectPlay Pin
Heath Stewart22-Jun-04 4:57
protectorHeath Stewart22-Jun-04 4:57 
GeneralRe: DirectPlay Pin
bouli22-Jun-04 5:04
bouli22-Jun-04 5:04 
GeneralRe: DirectPlay Pin
Heath Stewart22-Jun-04 5:37
protectorHeath Stewart22-Jun-04 5:37 
GeneralRe: DirectPlay Pin
bouli22-Jun-04 5:24
bouli22-Jun-04 5:24 

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.