disabling Infragistics NetAdvantage UltraWinGrid selections

`I'm trying to create a Infragistics UltraWinGrid with the following characteristics:

1. The user is able to add a row using a fixed column.  Obviously each cell in the add row allows for individual entries to be typed in
2. The grid is bound to a DataTable within a DataSet
3. The grid is initially either blank or populated with pre-existing records.
4. The grid doe snot allow for selections.  By that I mean that it almost appears as if it's disabled (but not).  There is no reason to edit records, just add new ones.

I have everything working except for the #4.  No matter what I do the user is able to select a row.  When selected there is a blue highlight on that row, etc.  

Can anyone tell me how to get an UltraWinGrid to not allow users to select a row but still allow for new records to be added?  
Who is Participating?
Fahad MukhtarConnect With a Mentor Distinguished EngineerCommented:
virtually the row is not selectable..
you can set the background color of SelectedRow to White
Fahad MukhtarDistinguished EngineerCommented:
this.gridChatInfo.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.False;
craigsweetAuthor Commented:
That doesn't work.  That's the first thing I tried.  I've tried both setting that from the designer as well as setting e.Layout.Override.AllowUpdate from _InitializeLayout.

Is it possible that some other setting is interfering?
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

craigsweetAuthor Commented:
Actually, this solved part of the problem.  With that code it's true that a user cannot modify the data.  But, they can still select the row.  Even though they can't change anything I don't want them to be able even select a row.  Basically, it should look like a view-only listing of grid data - no highlighted row or cell when clicked.
Fahad MukhtarDistinguished EngineerCommented:
In "UltraWinGrid Designer", select "Selection" then "Row Selection" then click "Dont Allow"
craigsweetAuthor Commented:
I already tried that.  It still allows me to select a row.

I'm using a dataset that's not tied directly to the database.  Not sure if that makes a difference.  
craigsweetAuthor Commented:

I decided to start from scratch, just to prove to myself that I didn't alter something since I'm really sure this should work.  I did the following

1.  Created a new form called test
2. Placed a new ultraGrid.  I just clicked "Finish" when the designer popped up so no schema was specified.
3. In the form's load event I called the stored procedure that gets my data (returns a DataTable) and assigned to ultraGrid1.DataSource
4. Added an event handler for InitializeLayout and typed in "e.Layout.Override.AllowUpdate = Infragistics.Win.DefaultTableBoolean.False"
5, Entered the designer and on the "Feature Picker" tab, under Selection, chose "Don't Allow" for Row Selection, Column Selection and Cell Selection

It's true that I can't update the contents of a cell.  but when I click on the cell the row is highlighted (except for the cell, which has its text selected).  I can keep the latter issue from happening by entering e.layout.override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect; into InitializeLayout but that doesn't help much.  

I still get a blue highlight on the active row.  What I really want is for the user to not even be able to activate a row.  Resizing columns and scrolling are fine but selecting a row is not.

craigsweetAuthor Commented:
What do you mean by "virtually the row is not selectable"?

I set the background color of the selected row to white and it didn't do anything.  I set the background color of the active row and that at least got me closer.  Now the row's border is highlighted when you click on that row (but at least the color is gone).  Same effect though.  Do you know what property handles that?
craigsweetAuthor Commented:
Highlighted is a bad word, it's really a bunch of dots.  
craigsweetAuthor Commented:

It turns out that what I want to do is not supported.  I received an email from Infragistics tech support with a work around that doesn't solve the problem but at least I can stop searching for a solution.

Thanks for your help.  I'll accept your last answer since technically the only solution appears to be playing around with background colors, etc.
For Infragistics 2007 vol 3, I was able to solve a similar problem:

By default, the first row in an UltraGrid is "selected" and "active".  The default ActiveRow appearance causes the dark blue background.  To turn off this appearance for the active row, open the property window in Visual Studio and go to the UltraGrid's properties.

Expand DisplayLayout.
Expand Override.
Right-click the ActiveCellAppearance property and choose Reset.
Reset the ActiveRowAppearance property as well.

This has the effect of removing the following lines from the "InitializeComponent" section of the form.
         this.warningsGrid.DisplayLayout.Override.ActiveCellAppearance = appearance5;
         this.warningsGrid.DisplayLayout.Override.ActiveRowAppearance = appearance6;

Additionally, you may want to prevent row, column and cell selection:

         this.warningsGrid.DisplayLayout.Override.SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType.None;
         this.warningsGrid.DisplayLayout.Override.SelectTypeCol = Infragistics.Win.UltraWinGrid.SelectType.None;
         this.warningsGrid.DisplayLayout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.None;

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.