I want to put these images in the RowSelector column depending upon these states:
inactive/not selected - nothing
inactive/selected - check mark
active/not selected - triangle
active/selected - check mark and triangle
How can this be done (preferably through the properties, in code if not).
Hi,
Setting the Image in InitializeRow seems like a good idea. But I'm not entirely sure that IniitalizeRow will fire for all the states you have here. For example, I don't think InitializeRow fires when a row goes from being Active to Inactive. Or Selected to Unselected.
So you will probably need to handle this in the Before/AfterRowActivate, Before/AfterRowDeactivate, and SelectionChange events.
haggard said:How can this be done (preferably through the properties, in code if not).
There is no way to do this via properties.
In IntializeRow you can set an image in the row selector this way:
e.Row.RowSelectorAppearance.Image = Properties.Resources.attribute_write_32.ToBitmap();
(The reason for the ToBitmap method being called in my case was the usage of icon files that needed to converted to an image type, your situation might be different if you already use a regular image)
Depending on how many rows you have in this table, you may experience a performance slow down while the grid is loading the rows and updating the row selector images. Once that has completed everything should be back up to speed.
I can see how that might apply to an active row that is either selected or not-select, but how does it do anything for an inactive row? I do not see any image attributes for rows that are not active.
This documentation article titled, "Styling Row Selector Images for Different States of a Row" would get you started on how to use your images in the row selectors.
http://help.infragistics.com/NetAdvantage/WinForms/2010.3/CLR2.0/?page=WinGrid_Styling_Row_Selector_Images_for_Different_States_of_a_Row.html
Then you'll need to take a look at your requirements to see what events you want to wire up to (e.g. InitializeRow, AfterExitEditMode, etc). The InitializeRow event would be used to get those intial selectors set up, and then events like AfterExitEditMode would give you the opportunity to update the selector image if the proper change took place.