Click here to Skip to main content
16,012,611 members
Home / Discussions / C#
   

C#

 
QuestionQuestion about passport authentication Pin
Johny Ng7-Dec-06 15:13
Johny Ng7-Dec-06 15:13 
Questionspecial DataGridView column Pin
jesarg7-Dec-06 12:32
jesarg7-Dec-06 12:32 
AnswerRe: special DataGridView column Pin
~~~Johnny~~~8-Dec-06 2:05
~~~Johnny~~~8-Dec-06 2:05 
QuestionRun query in MS Access and get requested data Pin
yonidebest7-Dec-06 12:01
yonidebest7-Dec-06 12:01 
QuestionAny ideas? Pin
yonidebest8-Dec-06 1:02
yonidebest8-Dec-06 1:02 
QuestionHow to use Sql Transactions in Client/Server Database ? Pin
hdv2127-Dec-06 11:43
hdv2127-Dec-06 11:43 
AnswerRe: How to use Sql Transactions in Client/Server Database ? Pin
Guffa7-Dec-06 14:58
Guffa7-Dec-06 14:58 
QuestionHelp with a datagrid Pin
~~~Johnny~~~7-Dec-06 11:33
~~~Johnny~~~7-Dec-06 11:33 
The following code works well, when I tab trought the emptyDataGrid the cells are in edit mode but when the form shows up, the emptyDataGrid seems to be focused because if I tab I fall in the second cell of the grid but if I just type it doesn't put the keystrokes in the first cell, it is like the first cell is not in edit mode. Tried multiple things but nothing works. Not sure what to do.

The result that should be obtained is as soon as the form shows up, at the first keystroke the first cell of emptyDataGrid should be in edit mode and registering keystrokes of course.

Thanks for any help. (Writing a good finder is definitely the worst thing I never tackled in programming)


public void SetFinder(ref ComplexObject finderObject)
{
finderObject.Read();
complexObject = finderObject;
dataGrid = finderObject.FinderDatagrid;
dataGrid.ColumnHeadersVisible = false;
datagridSplit.Panel2.Controls.Add(dataGrid);
foreach (DataColumn column in finderObject.Tables[0].Columns)
{
if (column.ColumnMapping == MappingType.Element)
{
emptyTable.Columns.Add(new DataColumn(column.ColumnName, column.DataType));
}
}
emptyTable.Rows.Add(emptyTable.NewRow());
emptyTable.AcceptChanges();
emptyDataGrid.DataSource = emptyTable;
emptyDataGrid.AllowUserToAddRows = false;
emptyDataGrid.AllowUserToResizeRows = false;
emptyDataGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
emptyDataGrid.Dock = DockStyle.Fill;
emptyDataGrid.RowHeadersVisible = false;
emptyDataGrid.ScrollBars = ScrollBars.None;
datagridSplit.Panel1.Controls.Add(emptyDataGrid);
datagridSplit.SplitterDistance = emptyDataGrid.PreferredSize.Height + 5;
emptyDataGrid.EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(emptyDataGrid_EditingControlShowing);
emptyDataGrid.CellLeave += new DataGridViewCellEventHandler(emptyDataGrid_CellLeave);
emptyDataGrid.CellEnter += new DataGridViewCellEventHandler(emptyDataGrid_CellEnter);
dataGrid.Scroll += new ScrollEventHandler(dataGrid_Scroll);
emptyDataGrid.Scroll += new ScrollEventHandler(emptyDataGrid_Scroll);
emptyDataGrid.ColumnHeaderMouseClick += new DataGridViewCellMouseEventHandler(emptyDataGrid_ColumnHeaderMouseClick);
}

void emptyDataGrid_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
if (emptyDataGrid.SortOrder == SortOrder.Ascending) { dataGrid.Sort(dataGrid.Columns[emptyDataGrid.SortedColumn.Name], ListSortDirection.Ascending); }
else { dataGrid.Sort(dataGrid.Columns[emptyDataGrid.SortedColumn.Name], ListSortDirection.Descending); }
}

void emptyDataGrid_CellEnter(object sender, DataGridViewCellEventArgs e)
{
emptyDataGrid.BeginEdit(true);
}

QuestionAdding text to RichTextBox in form from another class Pin
NZSmartie7-Dec-06 11:13
NZSmartie7-Dec-06 11:13 
AnswerRe: Adding text to RichTextBox in form from another class Pin
Judah Gabriel Himango7-Dec-06 11:59
sponsorJudah Gabriel Himango7-Dec-06 11:59 
GeneralRe: Adding text to RichTextBox in form from another class Pin
NZSmartie7-Dec-06 12:00
NZSmartie7-Dec-06 12:00 
QuestionGCHandle... Pin
Shy Agam7-Dec-06 8:22
Shy Agam7-Dec-06 8:22 
AnswerRe: GCHandle... Pin
Judah Gabriel Himango7-Dec-06 9:34
sponsorJudah Gabriel Himango7-Dec-06 9:34 
GeneralRe: GCHandle... Pin
Shy Agam7-Dec-06 9:41
Shy Agam7-Dec-06 9:41 
GeneralRe: GCHandle... Pin
Judah Gabriel Himango7-Dec-06 11:58
sponsorJudah Gabriel Himango7-Dec-06 11:58 
QuestionResearching new project: Ability to speak answer phone calls via a PC? Pin
Goalie357-Dec-06 7:54
Goalie357-Dec-06 7:54 
QuestionHiding your computer's mouse Pin
Marc Clifton7-Dec-06 7:24
mvaMarc Clifton7-Dec-06 7:24 
AnswerRe: Hiding your computer's mouse Pin
Stefan Troschuetz7-Dec-06 7:38
Stefan Troschuetz7-Dec-06 7:38 
GeneralRe: Hiding your computer's mouse Pin
Marc Clifton7-Dec-06 8:24
mvaMarc Clifton7-Dec-06 8:24 
AnswerRe: Hiding your computer's mouse Pin
Ravi Bhavnani7-Dec-06 9:05
professionalRavi Bhavnani7-Dec-06 9:05 
GeneralRe: Hiding your computer's mouse Pin
Marc Clifton7-Dec-06 9:38
mvaMarc Clifton7-Dec-06 9:38 
AnswerSuccess! [modified] Pin
Ravi Bhavnani7-Dec-06 9:54
professionalRavi Bhavnani7-Dec-06 9:54 
GeneralRe: Success! Pin
Marc Clifton7-Dec-06 10:04
mvaMarc Clifton7-Dec-06 10:04 
GeneralRe: Success! Pin
Ravi Bhavnani7-Dec-06 10:10
professionalRavi Bhavnani7-Dec-06 10:10 
GeneralRe: Success! Pin
Marc Clifton7-Dec-06 11:48
mvaMarc Clifton7-Dec-06 11:48 

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.