Click here to Skip to main content
15,889,034 members
Home / Discussions / C#
   

C#

 
GeneralRe: Write CDs Pin
Jeremy Kimball25-Sep-03 20:17
Jeremy Kimball25-Sep-03 20:17 
GeneralRe: Write CDs Pin
Tomas Petricek25-Sep-03 9:51
Tomas Petricek25-Sep-03 9:51 
GeneralSending GET to a web service Pin
Ed K24-Sep-03 9:34
Ed K24-Sep-03 9:34 
GeneralWindows Form DataGrid Pin
devvvy24-Sep-03 8:21
devvvy24-Sep-03 8:21 
GeneralRe: Windows Form DataGrid Pin
ankita patel24-Sep-03 8:37
ankita patel24-Sep-03 8:37 
GeneralRe: Windows Form DataGrid Pin
devvvy24-Sep-03 8:47
devvvy24-Sep-03 8:47 
GeneralRe: Windows Form DataGrid Pin
ankita patel24-Sep-03 11:48
ankita patel24-Sep-03 11:48 
GeneralRe: Windows Form DataGrid Pin
sumeat24-Sep-03 14:32
sumeat24-Sep-03 14:32 
You can show controls in DataGrid, for e.g. showing a button control in a column by adding those controls to the grid.

// Create a control
Button myButton = new Button();
myButton.Visible = false;

// Add the button to the data grid
myDataGrid.Controls.Add(myButton);

// Now handle the Paint event of the grid
OnDataGridPaint(..)
{
if (myDataGrid.CurrentCell.ColumnNumber = <columnnumber>)
{
myButton.width = myDataGrid.GetCurrentCellBounds().Width;
}
}

// CurrentCellChange event
OnDataGridCurrentCellChangeEvent(..)
{
if (myDataGrid.CurrentCell.ColumnNumber = <columnnumber>)
{
myButton.Location = myDataGrid.GetCurrentCellBounds().Location;
myButton.Visible = true;
}
else
{
myButton.Visible = false;
}
}

// Handle Layout and Scroll events of DataGrids
OnDataGridLayout(..)
{
OnDataGridCurrentCellChangeEvent();
}

OnDataGridScrolled(..)
{
OnDataGridCurrentCellChangeEvent();
}

This is just psuedo code. You may have to do some more tweaking for this to work. But this is generally how it is done (or how I have done it!)

Hope this helps.

Suhas
GeneralRe: Windows Form DataGrid Pin
devvvy24-Sep-03 17:41
devvvy24-Sep-03 17:41 
GeneralVS.NET does not see my assemblies Pin
Le centriste24-Sep-03 8:10
Le centriste24-Sep-03 8:10 
GeneralRe: VS.NET does not see my assemblies Pin
James T. Johnson24-Sep-03 9:15
James T. Johnson24-Sep-03 9:15 
GeneralSystem.UnauthorizedAccessException Pin
Le centriste24-Sep-03 8:08
Le centriste24-Sep-03 8:08 
GeneralRe: System.UnauthorizedAccessException Pin
ich_bins25-Sep-03 0:01
ich_bins25-Sep-03 0:01 
GeneralRe: System.UnauthorizedAccessException Pin
Le centriste25-Sep-03 3:02
Le centriste25-Sep-03 3:02 
GeneralMouseHover logic Pin
Arun Bhalla24-Sep-03 7:43
Arun Bhalla24-Sep-03 7:43 
GeneralRe: MouseHover logic Pin
J. Dunlap24-Sep-03 8:27
J. Dunlap24-Sep-03 8:27 
GeneralRe: MouseHover logic Pin
Arun Bhalla24-Sep-03 10:23
Arun Bhalla24-Sep-03 10:23 
GeneralRe: MouseHover logic Pin
J. Dunlap24-Sep-03 10:54
J. Dunlap24-Sep-03 10:54 
GeneralRe: MouseHover logic Pin
Arun Bhalla24-Sep-03 11:02
Arun Bhalla24-Sep-03 11:02 
GeneralRe: MouseHover logic Pin
J. Dunlap24-Sep-03 11:11
J. Dunlap24-Sep-03 11:11 
GeneralRe: MouseHover logic Pin
Arun Bhalla24-Sep-03 11:18
Arun Bhalla24-Sep-03 11:18 
GeneralRe: MouseHover logic Pin
J. Dunlap24-Sep-03 11:19
J. Dunlap24-Sep-03 11:19 
GeneralRe: MouseHover logic Pin
Arun Bhalla24-Sep-03 11:23
Arun Bhalla24-Sep-03 11:23 
GeneralLimiting characters entered into a textbox Pin
ecopilot24-Sep-03 6:24
ecopilot24-Sep-03 6:24 
GeneralRe: Limiting characters entered into a textbox Pin
Wjousts24-Sep-03 6:41
Wjousts24-Sep-03 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.