C# DataGridView extensions for drag n drop.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shrek
    New Member
    • Feb 2007
    • 13

    #1

    C# DataGridView extensions for drag n drop.

    I found some code that extends the standard datagrid view to allow rows or columns to be dragged and droped within the grid

    the code can be found at :-http://www.danielsoper .com/programming/DataGridViewDra gDropRowsColumn s.aspx

    Has any one else used/had expereience of using this control?

    I drop the new grid object onto the form and add the DataSource and and DataMember, all works fine. What I can't seem to do is rename the columns! If I rename Column1 to Name when I come out of the properties it reverts to being called Column1..
    I can do it via code
    Code:
    MyObj.Columns[0].HeaderText = "Name";
    When I run my form the object seem to append a number of blank columns to the begining of my data.

    Any help would be appreciated
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Baed on the source code provided on that site, I would say you are using it verbatim.
    I think you will need to modify that code to get what you require. It appears that that was just an example of "how to do it" not actually "what should be done".

    For starters, I see in there that the column headertexts are being manually overwritten in some functions.

    Comment

    Working...