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

.NET (Core and Framework)

 
GeneralRe: Impossibility to start a VB application on another PC Pin
Rob Graham30-Dec-04 14:58
Rob Graham30-Dec-04 14:58 
GeneralRe: Impossibility to start a VB application on another PC Pin
Ritesh12347-Jan-05 3:30
Ritesh12347-Jan-05 3:30 
GeneralProblem running release build on non-development machine Pin
rahmanasdf30-Dec-04 7:12
rahmanasdf30-Dec-04 7:12 
GeneralRe: Problem running release build on non-development machine Pin
Mike Dimmick31-Dec-04 4:31
Mike Dimmick31-Dec-04 4:31 
GeneralRe: Problem running release build on non-development machine Pin
rahmanasdf2-Jan-05 5:23
rahmanasdf2-Jan-05 5:23 
GeneralChild windows Form issue Pin
mkennedy7730-Dec-04 6:18
mkennedy7730-Dec-04 6:18 
GeneralRe: Child windows Form issue Pin
Robert Rohde31-Dec-04 2:54
Robert Rohde31-Dec-04 2:54 
GeneralRe: Child windows Form issue Pin
mkennedy7731-Dec-04 12:15
mkennedy7731-Dec-04 12:15 
Okay, I call the new form passing it a dataset. In the new form, I call a method to initialie the datagrid; here is that code. The Alternating back color, the mousedown events, and the column width seem to be ignored. Seems like I'm missing something simple here:

The steps I'm taking in the constructor of the new form are:

public ClientActivity(DataSet ds)
{
//
// Required for Windows Form Designer support
//
this.gridMouseDownTime = DateTime.Now;
this.ds = ds;
this.WSID = WSID;
InitializeComponent();
InitializeDataGrid(ds,WSID);
//
// TODO: Add any constructor code after InitializeComponent call
//

}



private void InitializeDataGrid(DataSet ds)
{
try
{
//AddCustomDataStyle(ds);
dataGrid1.DataSource = ds.Tables[0];
dataGrid1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dataGrid_MouseDown);

int rowCount = ds.Tables[0].Rows.Count;

DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.MappingName = "ClientActivity";
tableStyle.AlternatingBackColor = System.Drawing.Color.Gold;
//tableStyle.BackColor = System.Drawing.Color.White;
tableStyle.GridLineStyle = System.Windows.Forms.DataGridLineStyle.Solid;
tableStyle.GridLineColor = Color.Red;
tableStyle.SelectionBackColor = System.Drawing.Color.Blue;
// tableStyle.SelectionForeColor = System.Drawing.Color.Blue;


int numCols = ds.Tables[0].Columns.Count;

DataGridTextBoxColumn aColumnTextColumn ;
for(int i = 0; i < numCols; ++i)
{
aColumnTextColumn = new DataGridTextBoxColumn();
aColumnTextColumn.HeaderText = ds.Tables[0].Columns[i].ColumnName;

aColumnTextColumn.MappingName = ds.Tables[0].Columns[i].ColumnName;
//add handler
//MessageBox.Show(ds.Tables[0].Columns[i].ColumnName);
aColumnTextColumn.TextBox.MouseDown += new MouseEventHandler(TextBoxMouseDownHandler);
aColumnTextColumn.TextBox.Width = 100;
aColumnTextColumn.TextBox.DoubleClick += new EventHandler(TextBoxDoubleClickHandler);

tableStyle.GridColumnStyles.Add(aColumnTextColumn);
}

label1.Text = label1.Text + " For " + WSID;

dataGrid1.TableStyles.Add(tableStyle);

}
catch (Exception e)
{
MessageBox.Show(e.StackTrace);
}

}
GeneralRe: Child windows Form issue Pin
Robert Rohde31-Dec-04 16:38
Robert Rohde31-Dec-04 16:38 
GeneralQuestion about the Garbage collector Pin
t_ariel30-Dec-04 2:25
t_ariel30-Dec-04 2:25 
GeneralRe: Question about the Garbage collector Pin
Charlie Williams30-Dec-04 5:30
Charlie Williams30-Dec-04 5:30 
GeneralRe: Question about the Garbage collector Pin
Robert Rohde30-Dec-04 22:35
Robert Rohde30-Dec-04 22:35 
Generalpocket pc application Pin
vksrisridhar29-Dec-04 23:11
vksrisridhar29-Dec-04 23:11 
GeneralRe: pocket pc application Pin
Identity Undisclosed30-Dec-04 5:04
Identity Undisclosed30-Dec-04 5:04 
GeneralRe: pocket pc application Pin
vksrisridhar30-Dec-04 16:59
vksrisridhar30-Dec-04 16:59 
GeneralRe: pocket pc application Pin
zagzagzag3-Jan-05 1:21
zagzagzag3-Jan-05 1:21 
GeneralWindows CE - instrument Pin
Sarvesvara (BVKS) Dasa29-Dec-04 7:43
Sarvesvara (BVKS) Dasa29-Dec-04 7:43 
GeneralRe: Windows CE - instrument Pin
zagzagzag3-Jan-05 1:11
zagzagzag3-Jan-05 1:11 
GeneralPerformance Pin
lhi29-Dec-04 0:36
lhi29-Dec-04 0:36 
GeneralRe: Performance Pin
Robert Rohde29-Dec-04 3:31
Robert Rohde29-Dec-04 3:31 
General.NET Framework on NT 4.0 Pin
sevan28-Dec-04 22:03
sevan28-Dec-04 22:03 
GeneralRe: .NET Framework on NT 4.0 Pin
Mike Dimmick31-Dec-04 4:38
Mike Dimmick31-Dec-04 4:38 
Generalquestion about static Type.GetType(string) Pin
Member 103504428-Dec-04 10:41
Member 103504428-Dec-04 10:41 
GeneralRe: question about static Type.GetType(string) Pin
Robert Rohde28-Dec-04 23:42
Robert Rohde28-Dec-04 23:42 
GeneralRe: question about static Type.GetType(string) Pin
Member 103504429-Dec-04 6:41
Member 103504429-Dec-04 6:41 

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.