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,476 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
ID: 22748165
>>>> 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
ID: 22755717
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
ID: 22756421
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
ID: 31506682
thanks i never thought of that
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…

776 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