[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

disabling Infragistics NetAdvantage UltraWinGrid selections

Posted on 2006-05-19
11
Medium Priority
?
9,127 Views
Last Modified: 2008-05-31
`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?  
0
Comment
Question by:craigsweet
  • 7
  • 3
11 Comments
 
LVL 19

Expert Comment

by:Fahad Mukhtar
ID: 16731773
this.gridChatInfo.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.False;
0
 

Author Comment

by:craigsweet
ID: 16733473
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?
0
 

Author Comment

by:craigsweet
ID: 16733646
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.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 19

Expert Comment

by:Fahad Mukhtar
ID: 16733953
In "UltraWinGrid Designer", select "Selection" then "Row Selection" then click "Dont Allow"
0
 

Author Comment

by:craigsweet
ID: 16739413
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.  
0
 

Author Comment

by:craigsweet
ID: 16739477
OK,

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.

0
 
LVL 19

Accepted Solution

by:
Fahad Mukhtar earned 375 total points
ID: 16739970
virtually the row is not selectable..
you can set the background color of SelectedRow to White
0
 

Author Comment

by:craigsweet
ID: 16740039
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?
0
 

Author Comment

by:craigsweet
ID: 16740066
Highlighted is a bad word, it's really a bunch of dots.  
0
 

Author Comment

by:craigsweet
ID: 16742347

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.
0
 
LVL 1

Expert Comment

by:charliearcuri
ID: 21686045
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

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Integration Management Part 2
Loops Section Overview
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question