A
Anthony
Hi Folks,
I'm adding some columns to my datagrid which are of Combo Box type. I'm
inheriting DataGridTextBoxColumn and doing all the usual stuff to get them
populated. This is working fine. I have added some functionality where if
the user right clicks the combobox a context menu will appear, saying "Fill
the complete column with value 'XXX'". This value is the value they selected
from the combobox. This is also working fine.
However, to get this working generically for any datagrid, I'm running into
problems. I overload the constructor to pass in the datagrid (by ref) and
datatable, but I need to know the column the user clicked which I'm not
really sure how to do this.
I had this working before for one particular datagrid in my app. I passed in
a reference to the class containing the datagrid when the columns were
created but I'm trying to make it generic now so any datagrid can uses this
context menu function.
The reason I need to know the column selected is when I loop thru all the
rows and columns I know which cell to update.
I'm still fairly green with vb.net (win), ...do I need to get an event to
fire off, ..or add a addhandler to the constructor? The problem is I can't
do the HitTest for the datagrid within the "DataGridComboBoxColumn" class.
Again : I need to know the column the user clicked on the datagrid.
Hope I've explained this well enough. Any help would really be appreciated,
cause this one has got me for days.
Thanks,
Anthony
I'm adding some columns to my datagrid which are of Combo Box type. I'm
inheriting DataGridTextBoxColumn and doing all the usual stuff to get them
populated. This is working fine. I have added some functionality where if
the user right clicks the combobox a context menu will appear, saying "Fill
the complete column with value 'XXX'". This value is the value they selected
from the combobox. This is also working fine.
However, to get this working generically for any datagrid, I'm running into
problems. I overload the constructor to pass in the datagrid (by ref) and
datatable, but I need to know the column the user clicked which I'm not
really sure how to do this.
I had this working before for one particular datagrid in my app. I passed in
a reference to the class containing the datagrid when the columns were
created but I'm trying to make it generic now so any datagrid can uses this
context menu function.
The reason I need to know the column selected is when I loop thru all the
rows and columns I know which cell to update.
I'm still fairly green with vb.net (win), ...do I need to get an event to
fire off, ..or add a addhandler to the constructor? The problem is I can't
do the HitTest for the datagrid within the "DataGridComboBoxColumn" class.
Again : I need to know the column the user clicked on the datagrid.
Hope I've explained this well enough. Any help would really be appreciated,
cause this one has got me for days.
Thanks,
Anthony