Why would this be a 'non-standard way of selecting a row' this is how all
listview controls work, look at the inbox of outlook/outlook express you
have a list (with no column headers) which you can hold CTRL and click on
multiple rows to select them.
I guess I could have looked into making a editable ListView but that seems
like a lot more work because the datagrid looks just the same when you hide
the row headers, caption, set the back colour to white etc, then you already
have a listview look that you can edit.
Gavin
> hi Gav,
> may i ask what is your reason for hiding the row headers?
[quoted text clipped - 25 lines]
>>> --------------------------
>>> blog: http://tim.mackey.ie
Gav - 08 Sep 2005 18:29 GMT
A good example of what I'm looking for is the Library list in Windows media
player 10...
> Why would this be a 'non-standard way of selecting a row' this is how all
> listview controls work, look at the inbox of outlook/outlook express you
[quoted text clipped - 37 lines]
>>>> --------------------------
>>>> blog: http://tim.mackey.ie
Tim_Mac - 08 Sep 2005 20:04 GMT
hi Gav,
sorry i didn't know you were using the datagrid to look and behave like a
listview. in the normal datagrid situation, it would be non-standard.
to be honest, i think the listview is the one you want. the WM10 library
list is a listview. you can set LabelEdit = true, View=Details. you've got
your multi-select built in, column sorting, etc.
i couldn't get the items to BeginEdit() reliably on SelectedIndexChanged for
some reason, it would flicker editable and then return to normal. will your
users want to edit the text just by selecting an item in the list, or will
the normal listview renaming functionality be sufficient?
tim
--------------------------
blog: http://tim.mackey.ie
> Why would this be a 'non-standard way of selecting a row' this is how all
> listview controls work, look at the inbox of outlook/outlook express you
[quoted text clipped - 37 lines]
>>>> --------------------------
>>>> blog: http://tim.mackey.ie
Gav - 12 Sep 2005 09:28 GMT
Sorry to be a pain, I know your trying to help, but I do not like the idea
of doing it this way, you cannot bind a datasource to a listview like you
can a datagrid, that was another reason for me to use datagrids over
listview they are easier to use at design time.
I still would have much prefered an answer to my original question, is it
not possible to caption in the onclick that the ctrl key is being held and
multiple select in that way?
Thanks
Gav
> hi Gav,
> sorry i didn't know you were using the datagrid to look and behave like a
[quoted text clipped - 54 lines]
>>>>> --------------------------
>>>>> blog: http://tim.mackey.ie
Tim_Mac - 13 Sep 2005 19:09 GMT
hi Gav,
you're right. i should have just trusted that you knew what you wanted!
i got this code to behave as you have described
private void dataGrid1_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if((Control.ModifierKeys & Keys.Control) == Keys.Control)
this.dataGrid1.Select(this.dataGrid1.CurrentRowIndex);
}
interestingly this code in MouseDown wouldn't select the row. also
datagrid_Click didn't fire for clicks inside the cells.
hope this works for you.
tim
Gav - 15 Sep 2005 16:52 GMT
Thanks for the reply I thought I had been forgotten about for a moment
there...
I have tried this out and all it seems to do is select the whole row that I
click on when I hold down CTRL, it doesn't seem to still keep the selection
on the other rows.
Thanks again
Gav
> hi Gav,
> you're right. i should have just trusted that you knew what you wanted!
[quoted text clipped - 11 lines]
> hope this works for you.
> tim
Tim_Mac - 16 Sep 2005 16:34 GMT
hi Gav,
sorry i thought your original request was just to select the whole row. i
lost track of it with all the posts.
i'm all out of inspiration, except to suggest this control i just found:
http://www.csharphelp.com/archives2/archive341.html. it is an editable
listview control, with Ctrl+click multi select.
if that doesn't work you could try a repost, stating that you have removed
the rowheaders of a datagrid, but want to multi-select using Ctrl + click.
good luck
tim
--------------------------
blog: http://tim.mackey.ie
mikemeamail@net2000.ch - 22 Sep 2005 10:24 GMT
Hi Gav,
I'm actually encountering the same problem as yours, meaning i want to
be able to let users select multiple rows on a datagrid without showing
the
rowheaders with the row selector represented by an arrow.
Could you find any solution to your problem ?
Regards,
Mike
> hi Gav,
> sorry i thought your original request was just to select the whole row. i
[quoted text clipped - 12 lines]
> --------------------------
> blog: http://tim.mackey.ie
Gav - 23 Sep 2005 13:46 GMT
Sorry Mike, I do not have a solution as of yet, but I will surely let you
know when I do.
Regards
Gav
> Hi Gav,
>
[quoted text clipped - 25 lines]
>> --------------------------
>> blog: http://tim.mackey.ie
Tim_Mac - 26 Sep 2005 21:35 GMT
hi gav, did that control not serve your purposes?
http://www.csharphelp.com/archives2/archive341.html
i downloaded and tried it out and it seemed to do what you wanted.
tim
--------------------------
blog: http://tim.mackey.ie