Hi All,
I am new to the Infragistics software and am currently experimenting with the UltraWebGrids and WebCombos. I currently have a working WebCombo existing alone, and a working UltraWebGrid. I wanted to add the WebCombo into a cell(s) of the data grid. I thought that it would be as easy as taking the working product, creating a new column (for example) and copying the working WebCombo into the new column. This did seem to work, except that I cannot click on the droplist in the columns cells and have it activate. Nothing happens. I'm not sure if the data is no longer getting read into the WebCombo (everything is linked to an SQL database), or if there's some issue with how I put the WebCombo in the UltraWebGrid.
Here is how I have it currently structured if it is the ladder:
<igtbl:UltraWebGrid ...> <bands> <igtbl:UltraGridBand ...> <Columns> <igtbl:TemplateColumn ...> <CellTemplate> <igcmbo:WebCombo ...>
Any insight would be extremely helpful for me learning these Infragistic tools!
Hi raxus,
You need to do a couple of things. First, set the grid.DisplayLayout.AllowUpdate=yes. That will allow you to actually edit a cell in the grid. This is set to no by default. You'll also want to set the grid.DisplayLayout.CellClickAction to enable editing. Lastly, to hook up a custom editor like the Webcombo, you want to set the column's type to "Custom" and set the column's EditorControlID = the webcombo's clientID. There should also be document in the help which cover these topics (look for editing data or embeddeable editor).
Hope this helps,
-Tony
Thanks for the reply Tony,
I did all as you said, but still no luck, perhaps I did something incorrectly? I put theses likes in the .cs file under the "UltraWebGrid1_InitializeLayout(object, LayoutEventArgs)" function:
UltraWebGrid1.Columns[1].AllowUpdate = Infragistics.WebUI.UltraWebGrid.AllowUpdate.Yes; UltraWebGrid1.Columns[1].Type = Infragistics.WebUI.UltraWebGrid.ColumnType.Custom; UltraWebGrid1.Columns[1].EditorControlID = WebCombo1.ClientID; UltraWebGrid1.DisplayLayout.CellClickActionDefault = Infragistics.WebUI.UltraWebGrid.CellClickAction.Edit;
Was this along the lines of what you were describing before?
Yes, that should be all you need to do. What's happening when you click on a cell in the specified column? Does a dropdown appear, or does it just act like a static html table?
Each cell in the column has the dropdown button already visible even when the cell is not in focus, and clicking on the button does nothing. Clicking on the cell (i.e. the data section of the droplist) works similarly to a textbox.
Edit:
On a debugging note, I realized that my UltraWebGrid1_InitializeLayout function with the statements I added with your suggestion was not getting fired off. I then added an OnInitializeLayout attribute to the <igtbl:UltraWebGrid ..> tag to correct this, and for my troubles, got a runtime error before the page loaded saying "Object reference not set to an instance of an object"
I believe that this means I was trying to access the table rows with the statements before the table was actually populated by the SqlDataSource. Since then I've tried moving the code to various places to try and work around the error, even tried putting <% [statements] %> in the .aspx file after the code for the grid...no luck. I'll keep working on it as I go, let me know if you have any ideas what I could be doing wrong.
The initializeDatasource event is only fired after a datasource is bound to the grid. So, as long as the event is firing, the structure should be present. Is it possible that you have AutoGenerateColumns=false set on the grid? that would prevent the grid from automatically creating the columns requred to bind the data. Try this..
Add a WebGrid to your form
Add a WebCombo to your form
Add A SqlDataSource to your form (this could be accessdatasource, objectdatasource, etc.)
Bind the SqlDataSource to a sql table (try to bind it to the Northwind database, Orders table)
Through the WebGrid's designer, set the DataSourceID = SqlDataSource1 (it should be in the dropdown list)
Now go into the WebGrid's smart tag (click on the arrow on the top right side of the control). Click on "Edit Structure"
Go into the "Bands And Columns" editor and find a column where you want to use an editor.
Set the "EditorControlID" property on the specified column, to the id of your editor ("WebCombo1")
At this point, you should have an editor hooked up for the column. now you just need to bind up the webcombo to some data. You can set the WebCombo's DataSourceID property to bind it to a foreign key field, or populate it manually.
There's a help topic which does a much more thorough job of explainint this as well. You can look at that here - https://help.infragistics.com/Help/Doc/ASPNET/2010.3/CLR4.0/html/WebGrid_Display_WebCombo_in_a_Cell.html?_ga=2.154711672.197774204.1563810735-1320467891.1559052143&_ga=2.154711672.197774204.1563810735-1320467891.1559052143
Hey, your link is dead..
Hi Daryl007,
Here is an updated link for setting a WebCombo as an Editor in UltraWebGrid:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.3/CLR4.0/html/WebGrid_Display_WebCombo_in_a_Cell.html
Please let me know if you have any questions.
Best Regards, Petar Ivanov Developer Support Engineer Infragistics, Inc. http://es.infragistics.com/support