Ticket Q435018
Visible to All Users

Grid and LookupEditSettings

created 12 years ago

Please assist me. I had some functionality in ver 11 that I am unable to make work in ver 12.

To replace the functionality, I have stopped trying to use… and am now trying to implement the functionality with the LookupEditSettings.

I have included a sample project with a grid with as a start of the functionality I am looking for.
The items that I am unable to get working are basically adding a new entry (row) to the grid and using the LookupEdit on a column.

Using Northwind db, I am basically selecting a product from the Product table, specifying a quantity and adding it as a row in a List of OrderItems.
The sample will require an instance of Northwind to run.

The details of the functionality that I am unable to get working are:
In the main grid of OrderItems, I need to:

· display only the Procduct Name, Quantity and Notes in grid.
· override the display of Product Name column display ProductName + " " + QuantityPerUnit that is selected from the LookupEditSettings popup.

· I do not want to display the OrderID or ProductID

When clicking in the ProductName I would like the LookupEditSettings popup to display (which it does now). Then, in the LookupEditSettings popup, I want to display only the Product Name, and QuantityPerUnit columns and set the width of the LookupEditSettings window . The search should only check the displayed columns in the LookupEditSettings.

Before making some recent changes to the xaml, I was able to insert a new row using the InitNewRow event handler. Now, it no longer functions, when I click in the “add new row” row of the grid, it simply replaces the value of the existing row below, and does not call the event handler. I would like to know how to regain this functionality .

Thank you so much for your assistance.

Comments (2)

    Thank you!
    If I want to not show any search results until the user has typed in at least two characters, is that possible? If so, can you point me to documentation on this or an example. I've been looking through the SearchLookUpEditStyleSettings documentation and don't see how to accomplish this.
    Should I be creating a new ticket when I have a followup question like this?
    Thanks again,
    Bill

    Alexander E (DevExpress) 12 years ago

      Hi Bill,
      Yes, please, it would be nice to create a separate ticket for this issue since it is a bit different inquiry. I have extracted this issue to the following thread: SearchLookUpEditStyleSettings - I want to not show any search results until the user has typed in at least two characters.
      We greatly appreciate your cooperation. I will answer as soon as possible in the thread I mentioned.

      Answers

      created 12 years ago (modified 12 years ago)

      Hi Bill,
      As for the first issue, I suggest you set the LookUpEditSettings.PopupContentTemplate property in order to define a custom GridControl in the following manner:

      XAML
      <dxg:GridColumn.EditSettings > <dxg:LookUpEditSettings x:Name="lookUp" IsTextEditable="False" DisplayMember="ProductName" ValueMember="ProductName" AutoPopulateColumns="False" > <dxg:LookUpEditSettings.PopupContentTemplate> <ControlTemplate> <dxg:GridControl x:Name="PART_GridControl"> <dxg:GridControl.Columns> <dxg:GridColumn FieldName="ProductName_QuantityPerUnit" UnboundType="String" UnboundExpression="[ProductName]+' '+[QuantityPerUnit]"/> <!--<dxg:GridColumn FieldName="ProductName"/> <dxg:GridColumn FieldName="QuantityPerUnit"/>--> </dxg:GridControl.Columns> <dxg:GridControl.View> <dxg:TableView AutoWidth="True" /> </dxg:GridControl.View> </dxg:GridControl> </ControlTemplate> </dxg:LookUpEditSettings.PopupContentTemplate> <dxg:LookUpEditSettings.StyleSettings> <dxg:SearchLookUpEditStyleSettings /> </dxg:LookUpEditSettings.StyleSettings> </dxg:LookUpEditSettings> </dxg:GridColumn.EditSettings>

      As for the second issue with the NewItemRow functionality, this problem occurs because a plain list is used as a GridControl.ItemsSource. To fix the problem, use the ObservableCollection instead.
      Let me know if you need further assistance.

        Show previous comments (12)
        Alexander E (DevExpress) 12 years ago

          I am glad to hear that! You are welcome!

          GT GT
          Grigoris Tsolakidis 12 years ago

            Hello
            Here is the solution to to the problem in a sample .
            I made a customGridControl and a CustomLookUpEditSettings to achieve what i wanted .
            Posting for Future Use
            Thanks

            Alexander E (DevExpress) 12 years ago

              Hi Dimitris,
              Thank you very much for sharing your results. It may be helpful for others.
              I am glad to hear that now the issue is resolved.
              You are welcome!

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.