We were using the Infragistics NetAdvantage 11.1 suite of controls and adding a row on the server side use to be very simple, with the code below.
Dim oEndorsementRow As UltraGridRow, oEndorsementCell As UltraGridCell
oEndorsementRow = New UltraGridRow oEndorsementCell = New UltraGridCell(True) With oEndorsementCell .Key = "EndorsementKey" .Value = 1 End With oEndorsementRow.Cells.Add(oEndorsementCell) oEndorsementCell = New UltraGridCell(True) With oEndorsementCell .Key = "EndorsementNumber" .Value = "ML-55" End With oEndorsementRow.Cells.Add(oEndorsementCell) myDataGrid.Rows.Add(oEndorsementRow)
We are using this approach to add data to unbound grid at several places in our project and it has worked really well. Above is just a simplified example for illustrarion. However with the newer WebDataGrid I cannot seem to find corresponding objects to UltraGridRow and UltraGridCell. Have scoured the forum and cannot believe that such useful objects would have been take out of the API structure. We are in the process of converting our project to start using the NetAdvantage 2014 Volume 1 and it's Aikido controls.
Can someone please guide me in the right direction on how to accomplish this and what are the corresponding objects? I must add these rows on the server side.
Thank you.
Hello Vineet,
By design the WebDataGrid requires an underlying datasource. You do not need to display the fields of this datasource and can make use of UnboundColumns, but you still need to have some form of DataSource that will be used to determine the number of rows that will be rendered.
For a good explanation of this along with a sample please see the following forum thread:
http://es.infragistics.com/community/forums/p/76764/389470.aspx#389470
Hi Jason,
Thank you for your reply. However I have a couple of counter questions. While I understand that the controls have been completely rewired from ground-up and they no longer work like the classic controls. This is causing a lot of problems for the developers like myself who had been using the classic controls like UltraWebGrid and UltraTab. They had a very rich feature set and were very flexible in their usage. The corresponding WebDataGrid and WebTab seem to be very constricted in their design and simple features require a complex approach.
For eg, I have been trying to work with unbound columns, and what I have been seeing is when I add an unbound column in design mode and wire up my grid at runtime to a datasource and check the option to auto-generate columns, the unbound column is no longer available. I use the same grid to show different datasets, based on some application logic, so hard-coding the bound/unbound columns during design time is not an option for me.
I have also tried to add an unbound column column during run time int he INIT event of the webgrid. Even that does not seem to work. Are we allowed to add unbound columns dynamically? If so is the INIT event is the recommended place to do it? I just cannot get this to work, how I need it to.
I cannot believe that a very useful event like InitializeLayOut would be taken away from the developers. We used it very much to our advantage through out the application. May be you guys had good reason to change everything, but I think some of these really helpful properties/methods should have been retained. So that application developers like myself could focus on the business logic instead of chasing our tail. We have been Infragistics users for over a decade now, and this transition is probably the toughest for us.
Also can you please point me to a good resource which explains and illustrates the CSOM (properties and methods) for the WebDataGrid and WebTab. I was able to get something on your website but it did not lay our all the properties and methods, only some common ones were mentioned there. We use client side handling extensively.
Your help will be very much appreciated.
Vineet,
I have attached a small sample that demonstrates using a mix of UnboundFields and autogenerated columns. I bind the grid in the code behind in the PageLoad event and create one of the UnboundFields in the markup and one in PageInit. I also manipulate the UnboundFields in various ways in the InitializeRow event. Please let me know if this sample demonstrates everything you wanted to see or let me know if I may be of other help.
As for the CSOM, the best place to look is in the Infragistics ASP.NET Client-Side Object Model Reference Guide. On that link you'll see three sections: ASP.NET AJAX CSOM, ASP.NET CSOM, and jQuery API. The AJAX link contains information on the AJAX controls such as the WebDataGrid and WebTab (anything in the Infragistics.Web assembly). The jQuery API contains information about the jQuery based controls such as the WebUpload or WebVideoPlayer (anything in the Infragistics.Web.jQuery assembly). The ASP.NET CSOM contains information for the non-AJAX controls such as the WebSchedule or WebHtmlEditor (anything not contained in the previous two assemblies).
When you click through to the ASP.NET AJAX CSOM you should see a list of controls including a link to WebDataGrid and a link to the WebTab as requested. When you click on these you are taking to a page that contains the namespace that includes those controls. Click on the namespace link to see all objects that are contained within that namespace.
It is important to note that if you are using any of the Infragistics AJAX controls you will most likely need to come back to this list of objects. For example, if you want to do something with the EditingCore behavior you'd want to be on this list and click on EditingCore. If you just want info about the WebDataGrid you can click on the WebDataGrid at the end of the list.
Once you select an object it'll take you to the class page for that object. From here you will most likely want to go to the members page to see all the various client API, so click on either "Members" at the top of the page or the "<class name> Members" link at the bottom. On the Members page you will then see a list of public properties and methods. This is the main CSOM you'll be working with and everything should have a description on how its used and details on the parameters that they take. Please note that for the public properties that these implemented as getter and setters. This means that instead of calling something like myGrid.id you would instead use myGrid.get_id() or myGrid.set_id(value). You can see this if you click on any of the public properties.
In addition to the CSOM, we also have examples on many of the client events, though this is accessible through the API Reference Guide rather than the CSOM Reference Guide. For example, if you go to the TabClientEvents and select the ActiveTabChange event you'll see this page:
http://help.infragistics.com/Doc/ASPNET/Current/CLR4.0/?page=Infragistics4.Web.v15.1~Infragistics.Web.UI.LayoutControls.TabClientEvents~ActiveTabChange.html
If you don't want to navigate through by clicking you should be able to find anything you know the name of through the Search box as well.
Please let me know if this is enough information to get you started or let me know if I may be of any other help in regards to using the Infragistics documentation.
Just one more thing in continuation to my last reply. I would basically like to have a grid which will have mostly bound columns. With the binding being dun at runtime in the code. In addition to this, I need to be able to add one or two unbound columns dynamically in the code.
Can you please provide me with some sample code?