Solved

Populating the values of subsequent columns in an Infragistics UltraWebGrid, based on the first column's selected value in a ValueList/Dropdownlist

Posted on 2008-10-16
5
2,459 Views
Last Modified: 2013-12-14
I'm using a Infragistics UltraWebGrid.  I have a couple of columns in a grid, the first column has a dropdownlist in it.  When the user adds a new row, the row is empty which is correct, i want all the columns of the new row to be populated with the first column's default data which is found in it.

Steps that the user will perform when adding a new row to the grid:
1)  The user adds a new row to the grid, the row is now empty.
2)  The user clicks on the first column of new row, and dropdown appears with customer items.
3)  The user selects an cutomer item in the dropdown.
4)  After he selected an item from the dropdown, the rest of the columns must display the customer's default data, like CustomerID, Address, Telephone, etc based on the selected item.

The dropdown/valuelist is already populated in the new row, I don't know what event to use, to fill the subsequent columns based on the value of the first columns dropdownlist after the user chose an item.  The grid's "AddRow" event is not sufficient since this only gets fired once the user entered all the data and moves to another row, and in order for the user to add the data, he needs the default data in the cells, and then he can modify it.

I've considered using the Dropdownlist's "SelectedIndexChanged" event, but since the user is busy adding a new row, there is no way for me to find the new row being added, because the "code" does not know of this new row yet.

The dropdownlist in the first Column is a WebCombo control also from infragistrics.  So this will allow me to add all the neccessary customer data in it, since it is has a multicolumn grid.

I have seen some solutions solving this using a UltraWinGrid which is the Window Application version of Infragistics, but not for an UltraWebGrid which is used in ASP.Net.

I envision that some javascript will be neccessary to perform the following:
1) Find the selected row in the first columns dropdownlist
2) Get all the default data stored in that selected row (Since this is a row of a multicolumn grid)
3) Display the values in the the subsequent columns.

When the user finished with editing the default values, he can click on another row, and i can use the "AddRow" event to find all the data that he entered and submit it to my dataset.

I'm new to using the Infragistics control suite, and can't seem to find any good code references and solutions to programming questions.

thanks
0
Comment
Question by:Caroline_Swart
  • 2
  • 2
5 Comments
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
Comment Utility
>>>> I've considered using the Dropdownlist's "SelectedIndexChanged" event,
>>>> but since the user is busy adding a new row, there is no way for me to
>>>> find the new row being added, because the "code" does not know of this new row yet.

That seems a wrong conclusion for me. I don't know where the user added the new row but most likely it is below the other rows. Hence, retrieving the count of rows from the grid would tell you where the the new row was added. Moreover, when handling Dropdownlist's "SelectedIndexChanged", there will be methods - unfortunately I don't know UltraWebGrid but any grid would provide such methods - to find out where the current drop-down control was located within the grid. S, in any case you would be able to find out whether it was the new empty row hwhere the drop-down was made or whether it was a change for any of the other rows.

0
 

Author Comment

by:Caroline_Swart
Comment Utility
You are correct that the new row gets added beneath the existing rows. The UltraWebGrid gives you almost the same functionality as the "grids" used in access, if you click on the last empty row, it inserts a new row into the grid.  However this new row gets added client side, so the server does not yet know that the row exists - Now i don't know if this is where my problem is - maybe the server does know, and it's me who don't know what method to use..

I was considering Javascript since the row was added clientside. I don't understand what you mean by "there will be methods - unfortunately I don't know UltraWebGrid but any grid would provide such methods - to find out where the current drop-down control was located within the grid", if you can maybe be more specific.

0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 500 total points
Comment Utility
I mean that if you can handle an event like SelectedIndexChanged that there are methods to find out which row and column the active combobox currently has. Normally this information was passed to the handler (or a handle was passed which could be used for a query).
0
 

Author Closing Comment

by:Caroline_Swart
Comment Utility
thanks i never thought of that
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now