Click here to Skip to main content
15,902,492 members
Home / Discussions / C#
   

C#

 
AnswerRe: Converting Characters in Numbers.....Encryption Pin
Guffa26-Oct-06 10:39
Guffa26-Oct-06 10:39 
AnswerRe: Converting Characters in Numbers.....Encryption Pin
led mike26-Oct-06 9:21
led mike26-Oct-06 9:21 
GeneralRe: Converting Characters in Numbers.....Encryption Pin
Lord Kixdemp26-Oct-06 10:57
Lord Kixdemp26-Oct-06 10:57 
AnswerRe: Converting Characters in Numbers.....Encryption Pin
sapsboy26-Oct-06 9:24
sapsboy26-Oct-06 9:24 
QuestionScrolling in ListView Pin
kozu26-Oct-06 8:27
kozu26-Oct-06 8:27 
AnswerRe: Scrolling in ListView Pin
led mike26-Oct-06 8:32
led mike26-Oct-06 8:32 
GeneralRe: Scrolling in ListView Pin
kozu26-Oct-06 8:53
kozu26-Oct-06 8:53 
QuestionRemoving Focus from Cell in Datagrid Pin
Rabbit1726-Oct-06 7:30
Rabbit1726-Oct-06 7:30 
I have a datagrid that is using table styles. I want to allow users to select which columns are visible through a basic column selction form.

The problem I am having is that whatever cell is currently selected when I launch my columnselction form stays selected and will never lose focus! I can select other cells afterwards but the original cell always stays selected. If I launch the columnselection form additional times, whatever cell has focus then also stays focused. Hence, I can have 25 cells with permanent focus if I launched my columnselection form 25 times.

My code is as follows:

//Mainform code to get current visible columns and to launch columnselection form
ArrayList columns = new ArrayList();
for(int i=0; i<this.cdatagrid.tablestyles[0].gridcolumnstyles.count; i++)
{
string="" temp="this.cDataGrid.TableStyles[0].GridColumnStyles[i].MappingName;
columns.Add(temp);
}
vc" =="" new="" viewablecolumnsfordg(this,="" columns);
this.enabled="false;
vc.Show();


//Code" in="" vc="" after="" selecting="" columns
private="" void="" selectbutton_click(object="" sender,="" system.eventargs="" e)
{
="" mainform.cdatagrid.suspendlayout();
="" this.columns.clear();
="" for(int="" i="0;" <="" cboxlist.count;="" i++)
="" {
="" checkbox="" cb="(CheckBox)cBoxList[i];
" if(cb.checked)
="" columns.add(cb.text);
="" }

="" mainform.viewablecolumns="this.columns;
" mainform.cdatagrid.tablestyles.clear();
="" mainform.setctablestlye();
="" mainform.enabled="true;
" mainform.bringtofront();
="" mainform.cdatagrid.refresh();
="" mainform.cdatagrid.update();
="" mainform.cdatagrid.resumelayout();
="" this.close();
}

="" mainform="" code="" for="" setctablestlye();
public="" setctablestlye()
{
="" datagridtablestyle="" tblstyle="new" datagridtablestyle();
="" tblstyle.mappingname="mainData" ;
="" viewablecolumns.count;="" j="0;" standardcolnames.count;="" j++)
="" datagridtextboxcolumn="" dgcol="createDataGridColumn((string)viewableColumns[i]);
" tblstyle.gridcolumnstyles.add(dgcol);
="" tblstyle.rowheadersvisible="false;
" }
="" cdatagrid.tablestyles.add(tblstyle);
}

="" createdatagridcolumn
private="" createdatagridcolumn(string="" mappingname)
{
="" datagridtextboxcolumn();
="" dgcol.mappingname="mappingName;
" dgcol.headertext="mappingName;"
="" dgcol.width="115;
" dgcol.nulltext="String.Empty;
" dgcol.textbox.click="" +="new" system.eventhandler(openc_clicked);
="" dgcol.textbox.keydown="" system.windows.forms.keyeventhandler(openc_enterkey);
="" dgcol.readonly="true;
" return="" dgcol;
}

i'm="" sure="" this="" is="" really="" simple="" but="" can't="" find="" a="" way="" to="" unfocus="" the="" column="" Smile | :)

thanks!=""

<div="" class="ForumSig">RABB17

"Nothing fancy needed, please just solve all our problems as quickly as possible."

QuestionBizzare behavior with win2k and global keyboard/mouse hooks Pin
Dan Neely26-Oct-06 5:59
Dan Neely26-Oct-06 5:59 
QuestionCan I port C# Add-In to Mac? [modified] Pin
wasek200126-Oct-06 4:57
wasek200126-Oct-06 4:57 
AnswerRe: Can I port C# Add-In to Mac? Pin
ednrgc27-Oct-06 2:44
ednrgc27-Oct-06 2:44 
QuestionSudend Display events Pin
tcss26-Oct-06 4:55
tcss26-Oct-06 4:55 
Questionannoying null problems Pin
gus_br26-Oct-06 4:55
gus_br26-Oct-06 4:55 
AnswerRe: annoying null problems Pin
tcss26-Oct-06 4:59
tcss26-Oct-06 4:59 
GeneralRe: annoying null problems Pin
gus_br26-Oct-06 5:02
gus_br26-Oct-06 5:02 
GeneralRe: annoying null problems Pin
Judah Gabriel Himango26-Oct-06 5:10
sponsorJudah Gabriel Himango26-Oct-06 5:10 
GeneralRe: annoying null problems Pin
gus_br26-Oct-06 6:09
gus_br26-Oct-06 6:09 
AnswerRe: annoying null problems Pin
Guffa26-Oct-06 7:24
Guffa26-Oct-06 7:24 
GeneralRe: annoying null problems Pin
tcss26-Oct-06 19:23
tcss26-Oct-06 19:23 
AnswerRe: annoying null problems Pin
Leslie Sanford26-Oct-06 5:10
Leslie Sanford26-Oct-06 5:10 
AnswerRe: annoying null problems Pin
PlayByTheRules26-Oct-06 5:55
PlayByTheRules26-Oct-06 5:55 
GeneralRe: annoying null problems Pin
gus_br26-Oct-06 6:15
gus_br26-Oct-06 6:15 
AnswerRe: annoying null problems Pin
Keith Barrow26-Oct-06 7:01
professionalKeith Barrow26-Oct-06 7:01 
QuestionVS2005 - ReferencePaths Pin
AJ12326-Oct-06 4:45
AJ12326-Oct-06 4:45 
AnswerRe: VS2005 - ReferencePaths Pin
gus_br26-Oct-06 5:00
gus_br26-Oct-06 5:00 

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.