Click here to Skip to main content
15,913,722 members
Home / Discussions / C#
   

C#

 
GeneralRe: Did you know that '&' can be a logical AND operator? Pin
Luc Pattyn4-Dec-09 11:12
sitebuilderLuc Pattyn4-Dec-09 11:12 
GeneralRe: Did you know that '&' can be a logical AND operator? Pin
harold aptroot4-Dec-09 11:14
harold aptroot4-Dec-09 11:14 
GeneralRe: Did you know that '&' can be a logical AND operator? Pin
Luc Pattyn4-Dec-09 11:16
sitebuilderLuc Pattyn4-Dec-09 11:16 
GeneralRe: Did you know that '&' can be a logical AND operator? Pin
Abhinav S4-Dec-09 21:58
Abhinav S4-Dec-09 21:58 
QuestionVisual Studio addin - code color Pin
LimitedAtonement4-Dec-09 8:33
LimitedAtonement4-Dec-09 8:33 
AnswerRe: Visual Studio addin - code color Pin
LimitedAtonement4-Dec-09 9:04
LimitedAtonement4-Dec-09 9:04 
QuestionHow to make MouseHover and Tab selected on a tab control with images only Pin
sushantkaura4-Dec-09 8:27
sushantkaura4-Dec-09 8:27 
QuestionWinForms - DataGridView AutoResizeColumns not working. Pin
Sir Dot Net4-Dec-09 6:20
Sir Dot Net4-Dec-09 6:20 
I have a simple class (just contains automatic properties, nothing special), and a Form w/ a datagridview on it. It is binding directly to the class, and is working fine in every respect, however I want to autosize the columns to the data within them after bind (but retain it's current column sizing mode of 'None' afterwords so the user can resize them)
I call AutoResizeColumns and pass DataGridViewAutoSizeColumnsMode.DisplayedCells
(I've also tried 'AllCells'). The datagrid doesn't resize though! Am I missing something?

private void PopulateUI() {
   this.dataGridViewHistory.AutoGenerateColumns = false;
   this.dataGridViewHistory.DataSource = this.Project.Modifications;
   //the next line doesn't appear to do anything
   this.dataGridViewHistory.AutoResizeColumns( DataGridViewAutoSizeColumnsMode.DisplayedCells );
}


// 
// dataGridViewHistory initialization code (from designer.cs)
// 
this.dataGridViewHistory.AllowUserToAddRows = false;
this.dataGridViewHistory.AllowUserToDeleteRows = false;
this.dataGridViewHistory.AllowUserToOrderColumns = true;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.PapayaWhip;
this.dataGridViewHistory.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridViewHistory.ColumnHeadersHeightSizeMode =
   System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridViewHistory.Columns.AddRange( new System.Windows.Forms.DataGridViewColumn[] {
            this.ColumnUserID,
            this.ColumnUserName,
            this.ColumnDate,
            this.ColumnFileName} );
this.dataGridViewHistory.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGridViewHistory.Location = new System.Drawing.Point( 6, 16 );
this.dataGridViewHistory.Name = "dataGridViewHistory";
this.dataGridViewHistory.ReadOnly = true;
this.dataGridViewHistory.RowHeadersVisible = false;
this.dataGridViewHistory.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridViewHistory.Size = new System.Drawing.Size( 550, 236 );
this.dataGridViewHistory.TabIndex = 0;

QuestionHow to combine two datatables into single datatable Pin
K V Sekhar4-Dec-09 6:10
K V Sekhar4-Dec-09 6:10 
AnswerRe: How to combine two datatables into single datatable Pin
PIEBALDconsult4-Dec-09 6:54
mvePIEBALDconsult4-Dec-09 6:54 
AnswerRe: How to combine two datatables into single datatable Pin
Shameel4-Dec-09 7:01
professionalShameel4-Dec-09 7:01 
GeneralRe: How to combine two datatables into single datatable Pin
K V Sekhar6-Dec-09 4:22
K V Sekhar6-Dec-09 4:22 
GeneralRe: How to combine two datatables into single datatable Pin
Shameel7-Dec-09 7:00
professionalShameel7-Dec-09 7:00 
QuestionSignature panel with Mobile 2003.... Pin
Jacob Dixon4-Dec-09 5:00
Jacob Dixon4-Dec-09 5:00 
AnswerRe: Signature panel with Mobile 2003.... Pin
Jacob Dixon4-Dec-09 8:10
Jacob Dixon4-Dec-09 8:10 
QuestionHow to read the mail from OutLook Express using UIAutomation in C# 3.0 Pin
bruze4-Dec-09 4:20
bruze4-Dec-09 4:20 
QuestionHow to mock up a paging event? Pin
halifaxdal4-Dec-09 4:14
halifaxdal4-Dec-09 4:14 
AnswerRe: How to mock up a paging event? Pin
freakyit4-Dec-09 4:19
freakyit4-Dec-09 4:19 
GeneralRe: How to mock up a paging event? Pin
halifaxdal4-Dec-09 4:26
halifaxdal4-Dec-09 4:26 
QuestionSet cursor in textbox Pin
Wheels0124-Dec-09 3:42
Wheels0124-Dec-09 3:42 
AnswerRe: Set cursor in textbox Pin
freakyit4-Dec-09 4:00
freakyit4-Dec-09 4:00 
GeneralRe: Set cursor in textbox Pin
Wheels0124-Dec-09 4:16
Wheels0124-Dec-09 4:16 
QuestionControls on form shrinks Pin
Ganesh_T4-Dec-09 3:24
Ganesh_T4-Dec-09 3:24 
AnswerRe: Controls on form shrinks Pin
EliottA4-Dec-09 3:53
EliottA4-Dec-09 3:53 
GeneralRe: Controls on form shrinks Pin
Ganesh_T6-Dec-09 18:27
Ganesh_T6-Dec-09 18:27 

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.