Hi,
I just want to use a WinGrid as a simple table to display data that is not to be modified. I know, that was not the intention of a WinGrid but I'm so used to use it and the GUI of the application looks better if there is just one control used to display such data independent if it should be modified or not.
One of the columns contains a hyperlink to a PDF-file so if this is clicked another dialog to show that file should be opened. I followed some nice Infragistics example on howto create the hyperlink, having the text underlined and blue so that is not the problem. My problem is that there is always one row set as active which is under normal conditions displayed with blue background and white foreground which I changed in the Overrides settings for the display layout so that the row looks the same if it is active or not - with one exception: I cannot get the Hyperlink to another color than to the foreground color set in the Overrides as depicted in below picture:
Row 0 is currently active so the cell for File is displayed in black. Row 1 shows how I would like to have it displayed. As you can see the underlining of the text works pretty fine.
The function to initialize the grid layout is depicted below:
private void OnGridInitializeLayout(object sender, InitializeLayoutEventArgs e){ var grid = sender as UltraGrid; if (grid != null) { var column = e.Layout.Bands[0].Columns["File"]; column.CellActivation = Activation.ActivateOnly; column.CellAppearance.ForeColor = Color.Blue; column.CellAppearance.FontData.Underline = DefaultableBoolean.True; column.CellAppearance.Cursor = Cursors.Hand; }}
Is there a possibility to disable activation of rows on a WinGrid at all since in my case I don't need it or is there another way to get it working the way I want to use it?
Not to forget to mention that I'm using NetAdvantage 8.3, changing to 9.1 throughout the next days.
Regards, Wolfgang
Hi Wolfgang,
Try this:
FAQ:How do I turn off the ActiveRowAppearance so that the active row in the grid does not appear selected.
This should completely turn off the ActiveRowAppearance so the active row doesn't look any different than any other row.
You should probably also set SelectTypeRow (on the DisplayLayout.Override) to None if you have not already done so, to prevent the Selection of rows (which can also change the appearance of a row).