ellipsis button on a DataGridView cell

I know I am missing something simple. . .

I have an unbound column on a DataGridView. I want it to display some data derived from a non-visible key field of the dataTable the Grid is bound to. I want an ellipsis button on the text box, so the user can open a form to define the data that wll be set in the key field, then I will update the Unbound column.

Does that make sense am I going about this the wrong way




Answer this question

ellipsis button on a DataGridView cell

  • Eric Waterhouse

    an example in visial studio is,

    drop a DataGridView on a form and on the Properties tab, property grid for it, select the Columns property . . . see the little button to the right [...]

    I want to do something similar in my form's grid.

    GridColumn1   GridColumn2    GridColumn3      
    DataCol1      DataCol2       DerivedData [...]

    DerivedData is derived from DataCol3. clicking the ellipsis pops up a form that is used to find a piece of data that will be pushed into DataCol3.

    Make sense

     



  • splyf

    cool. . . thanks!

  • Mark_Wilhelm

    You can convert the code to VB fairly easily. There's probably other tools out there or more elegant ways to do it, but I did it by loading the assembly into Lutz Roeders .NET reflector and using the FileDisassembler add-in to decompile it into VB code. It is because all .NET languages compile down into the same IL code that this is possible. Hope this helps.
  • bthumber

    Hey, this is what i want but i cant open it because is CSharp im using VB.net express 2005. Anyone have the vb version


  • Chris Skor

    Yeah, I was just thinking with the fantastic enhancements in the grids in v.2, it might be there.

  • ChSchmidt

    Ah. I havent had much time to look at DataGridViews yet, but what I have done in the past with DataGrids is override DataGridColumnStyle with a custom class that would implement this functionality. It would show the ellipsis button when the cell goes into edit mode and hide it when the cell goes out of edit mode. The button click event would fire a popup form which would allow the user to select the data, and then that data would be set as the data for the column cell. You can do something similar with combo-boxes, if you dont need a whole pop-up form. Its not exactly simple, but its not too terribly complicated either.

  • Sonkit

    Mark,

    Very nice implementation of the textbox and a button.
    How would you make the button visible all the time

    Thanks,

    Buster95


  • Ted Paulakis

    Not sure what you are going for. Can you give a slightly more concrete example

  • Ashu283

    What CommonGenius mentions is very similar to what you need to do for the DataGridView. Check out http://www.windowsforms.net/blogs/markrideout/FilePathSample.zip for an unsupported sample that has a user control that contains a textbox and a "..." button.< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

     

    -mark

    DataGridView Program Manager

    Microsoft

    This post is provided "as-is"-mark

     


  • ellipsis button on a DataGridView cell