I am using QueryCellInfo to load combobox lists depending on the selected item in other comboboxes. In general this works, but when adding more dependent columns to the grid, the response time explodes. I have been trying to cut this time down by using a "the list for this row/column has already been created" matrix. The matrix is first initialized to "run", and then set to "completed" in QueryCellInfo. What I am seeing is that the dependent comboboxes are now displaying the ValueMember instead of the DisplayMember and the list is empty even though I watched it load in the debugger. It seems that the QueryCellInfo code must be executed multiple times to sync up the list and the value to be displayed. Is this an accurate accessment? Any thoughts as to how I can cut down on the hits in QueryCellInfo?
Ken
AD
Administrator
Syncfusion Team
June 7, 2004 05:46 PM UTC
There is no way to control how may times QueryCellInfo will be hit.
You may want to try populating your lists in CurrentCellShowingDropDown. In this way, the lists will only be populated when they are needed for the dropped list. Here is a KB that discusses one way you can do this. http://www.syncfusion.com/Support/article.aspx?id=567.
KJ
Kenneth Johnson
June 8, 2004 08:40 AM UTC
That link took me to a post regarding smart client deployment. We're using the data bound grid. I had previously been told that the only way to revise the datasource was in QueryCellInfo.
KJ
Kenneth Johnson
June 8, 2004 08:42 AM UTC
My bad on the post. I now see that the link is different.
KJ
Kenneth Johnson
June 8, 2004 09:13 AM UTC
Correct me if I'm wrong. The DataTable is loaded with all the reference data. A DataView is the datasource of the combobox, and the filter is revised in the CurrentCellShowingDropDown event to view the required rows from the DataTable? I'll give it try and see how it goes. The only down side may be loading the entire table. Over 20,000 rows will be coming through a web service.
I'll let you know.
Ken
As always, thanks for the response.
AD
Administrator
Syncfusion Team
June 8, 2004 09:48 AM UTC
You do have the idea of that sample.
If you do not want to load the 20K rows initially, you could just create a DataTable with the values being initially displayed in the grid, and set this as teh columns datasource. (If there more than 20K rows in the grid, then this would not save you anything...).
Then in CurrentCellShowingDropDown, don''t use a DataView.Filter to get the values, but instead retrieve a new DataTable holding just the required values through your web service.
This would add a web hit on each dropdown, so it may not gain much...
KJ
Kenneth Johnson
June 9, 2004 11:49 AM UTC
More issues to resolve.
The grid has three columns, part number, finish, and color. Part number is defined as a string, finish and color as Int32. I use the DisplayMember to display a string representing the finish/color, but the integer id is what is saved. Now that I am building the combobox lists in CurrentCellShowingDropDown with a DataView instead of in QueryCellInfo, existing parts display the numeric finish/color id when the grid is first displayed. How do I get the DisplayMember to display after first loading the grid?
Also, after selecting the finish for a part, I get the error message "'finish string' is not a valid value for Int32." Both the DisplayMember and ValueMember properties are set in CurrentCellShowingDropDown. What am I missing?
Thanks.
Ken
KJ
Kenneth Johnson
June 9, 2004 11:54 AM UTC
Are DisplayMember and ValueMember set to the corresponding DataView column names?
ex.
DisplayMember = "FinishName";
ValueMember = "FinishId";
Ken
AD
Administrator
Syncfusion Team
June 9, 2004 12:11 PM UTC
Yes.
In addition to setting these in CurrentCellShowingDropdown for the drop list, you also have to set these properties in the GridBoundColumn.StyleInfo for the column. In addition, you probably will have to set GridBoundColumn.StyleInfo.DataSource to a two-column datatable (DisplayMember & ValueMember) for the initial values that are shown in the grid. It is this action that would allow the grid to initially display the Displaymember instead of the ValueMember.
KJ
Kenneth Johnson
June 9, 2004 01:22 PM UTC
Exactly what the doctor ordered. You da man.
Ken