First, it's not clear to me how the samples are supose to work. Here's an example:
http://ko.infragistics.com/products/aspnet/sample/data-menu/data-binding
The code example listed above has references to stuff in ~SampleCommon, such as the DataSourceControl.ascx. Where am I suppose to find this?
Second, the download sample applications don't have examples of all the controls. For instance, I cannot find an example of how the WebDataMenu is used. All I can do is try and search the forums for vague and incomplete examples from the problems others have posted. Am I not aware of some other place on the website that provides more comprehensive examples and documentation?
Lastly, I can't seem to find any complete documentation on how to use the Javascript OM API. I see links like this:
http://help.infragistics.com/NetAdvantage/ASPNET/2012.1/CLR4.0/
but the documentation are lax and minimalistic in how to actually use the API. For instance, the parameter descriptions are usually self-descriptive and example usage are usually useless one-linerer. Example:
var resultVar = instanceOfWebDataMenu.find(String);
Is this just the way things are or am I missing something?
Hello Anthony ,
Thank you for posting in our forum.
Generally the code snippets you see in the samples are directly copied from the code in the samples browser. The sample browser uses some common assemblies, user controls and other things while the code underneath the online sample usually contains only the mark-up page(aspx) and the code behind(cs/vb) without the additional resources it’s possible to be a bit ambiguous .
If you have the samples installed locally however you should be able to find any of the additional resources you might want to see.
Generally the downloaded samples should contain the same samples that are available in the online one. I can see that there are a dew samples for the WebDataMenu here:
http://ko.infragistics.com/products/aspnet/data-menu
Are you looking a specific sample?
Generally you might be able to find the different properties and methods if you check the members of a specific class. Here’s a list of all the classes for the WebDataMenu for example:
http://help.infragistics.com/NetAdvantage/ASPNET/2012.1/CLR4.0/?page=WebDataMenu~Infragistics.Web.UI_namespace.html
So for example if you select WebDataMenu object at the bottom you can see a link to the Members. The members contain all of the public methods and properties for that object:
http://help.infragistics.com/NetAdvantage/ASPNET/2012.1/CLR4.0/?page=WebDataMenu~Infragistics.Web.UI.WebDataMenu_members.html
Let me know if you’re looking for something specific but you’re not able to find it.
Let me know if you have any questions or if there’s anything else I can do to assist you.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://ko.infragistics.com/support
Hi Maya,
Thanks for your time and help. I've been referring to the same samples and API reference you've linked to. For instance, the data-binding example for the WebDataMenu:
Has the following code in the .aspx file:
<%@ Register Src="~/SamplesCommon/aspnet/Common/UserControls/DataSourceControl/DataSourceControl.ascx" TagName="DataSourceControl" TagPrefix="uc1" %>
Where is that reference in the samples/example applications? Also, when I change the drop-down for "Select a Data Source" I do not see anything change in the code. For instance, I continue to see the use of an XML data source even after choosing IEnumerable. Actually, in fact, I cannot find an example of the WebDataMenu in any of the showcase applications (InfraProperties, InfraShop, MyMail). Is there a complete, end-to-end working example of the WebDataMenu that I can download or look at available on this site? I run into similar issues with other controls, too. I'm just using the WebDataMenu as an example.
Lastly, I understand the basics of how to navigate the API reference. What I was asking/pointing out was that the references themselves seem to lack the thoroughness and clarity I'd expect from a premium product like this. The example I gave was a method example with a parameter. The documentation wasn't very helpful because if a method/property is called "get_property" it's redundant documentation to simply say "Gets the property." If a parameter is called "objectID" it's redundant to document it as "The ID of the object." Furthermore, it's redundant in the documentation to show the method usage as such a simple one-line example like "object.get_property()" because it's already fairly well understood how methods and properties are generally invoked. I think what's missing are context and practical examples. I suppose I'm too used to Microsoft, where every piece of the API has a thoroughly documented explanation with complete code-in-context examples. I was asking if that was truly all there is to the API documentation or if I'm missing something else that's more thorough.
Lastly, one of the things I really wish I could find would be more complete examples using the Javascript API features with the controls without having to hunt the forums for them. Is there a repository of examples using the Javascript API?
Thanks again for your help.
Hello Anthony,
Do you have the samples source code downloaded locally? As I mentioned the online samples don’t contain the full code for the resources used.
If you have it you should be able to find it by default in Document/Infragistics/ NetAdvantage 2012.2/ASP.Net/Samples.
It contain all such additional resources.
As for the data source settings it seems it’s also done in an external class. Basically this:
void SelectedDataSource_DataSourceChanged(object sender, EventArgs e)
{
new WebMenuDataCommand().SetDataSource(this.WebDataMenuSample, this.SelectedDataSource.DataSource);
}
Which is an event of the user control DataSourceControl.ascx makes a call to a method of a class WebMenuDataCommand and passes the WebDataMenu control . And the method itself looks like this:
public void SetDataSource(WebDataMenu target, Common.DataSourceTypes dataSourceType)
switch (dataSourceType)
case Common.DataSourceTypes.ICollection:
case Common.DataSourceTypes.IEnumerable:
target.DataSourceID = null;
target.DataSource = this.GetMenuData();
target.DataBind();
break;
case Common.DataSourceTypes.IBindingList:
target.DataSource = new BindingList<MenuItem>(this.GetMenuData());
case Common.DataSourceTypes.Xml:
default:
target.DataSourceID = "MenuDataSource";
So basically that’s how the data source is changed.
Otherwise regarding the javascript Api there isn’t really any other documentation or specific samples. If you have any specific questions you can ask on the forum or open support requests and we’ll do our best to answer them.
Thank you for your feedback on the documentation and samples. I’ll relay your feedback to our management team so that they may consider improvements for them in the future.
Let me know if there’s anything else I can help you with.
I’m just following up to see if you have any questions or concerns or if you need further assistance please let me know.
Developer Support Engineer
The online samples use the same code like the ones you download locally. Basically in all cases the data for the grid comes from the same place . The GetMenuData() method reads the xml file MenuData.xml and create an IList<MenuItem>.
So if the selection from the user controls is ICollection or IEnumerable that’s the data that’s returned . So it’s basically bound the menu to a IList<MenuItem>.
If it’s IBindingList a new BindingList is created from the result returned from the GeMenuData method:
And in the last case- Xml it just sets the DataSourceID of the menu to ” MenuDataSource” which is actually the id of the XmlDataSource control which on the sample’s page.
So the type of the data source does change. It’s just not obvious since those additional resources are not added in samples source files in the code view section. Due to this I would recommend that you browse the local samples where you have all those resource.
Let me know if you have any questions.
Thank you. I think that clarifies the confusion. I was looking at the showcase applications, not the samples. I didn't know they were two different downloads.
I still think there is a bug on your site with the WebDataMenu example. When you change the data source type, it does not change the code being displayed to show how the new data source is being used.
If you open the source code for the samples locally you should see something like in the attached image. You should have all the local resources like user controls and additional classes and methods.
As you can see in the image the user control that was used is under the SamplesCommon/aspnet/Common/UserControls/DataSourceControl folder.
Generally you can download the source from our website by following these steps:
1) Go to http://ko.infragistics.com/ and log in with your account.
2) Select “Account”. This will open the “My keys and downloads” page.
3) Select your product .
4) From the tabs under the product select “Documentation and samples”
5) Select the NetAdvantage for Asp.net samples
6) Once that downloads install it and you should be able to open the samples locally now.
Let me know if you have any questions or concerns.
Are we talking about the same samples? I already mentioned I searched the 3 Infra showcase applications and couldn't find an example of the WebDataMenu. Perhaps I don't have the "complete" source code for some reason or searching for "WebDataMenu" is the wrong search term?
As for the second part, I think there was a misunderstanding of what the problem is: the problem isn't that I need to see the code you're using to switch data sources, the problem is that I was under the impression that -- on the sample page -- changing the data source in the drop down was suppose to refresh the source code with example code for using that data source type. The problem is that the same source code is displayed no matter what data source is chosen (it's always the XML data source). But at any rate, even in the code you showed me, it's incomplete. For instance, where is "GetMenuData()"? Why can't we see the entire DataSourceContorl.ascx file???
Lastly, I think everyone would be excited to see more comprehensive documentation for both the server and client APIs. Thanks for all your help!