Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2225
Issue with empty datasource
posted

using vs2010, c#, MVC3, and Razor;

I have an igCombo that pulls data by specifying the datasource. If there is data, all works as intended. However, if the result is empty, there is an error the first time you try to drop down the list: "Invalid Argument"

The view code looks like this:

 @(Html.Infragistics().Combo()
    .ID(
"igComboID")
    .TextKey(
"Name")
    .Width(
"200")
    .ValueKey(
"TableID")
    .AllowCustomValue(
false)
    .EnableClearButton(
false)
    .Mode(Infragistics.Web.Mvc.
ComboMode.DropDown)
    .MultiSelection(Infragistics.Web.Mvc.
ComboMultiSelection.Off)
    .DataSourceUrl(Url.Action(
"GetMyData"))
    .DataBind()
    .Render())

The Controller code looks like this: 

[ComboDataSourceAction]
public ActionResult GetMyData()
{
   
var myData = from d in db.GetMyData
                  
where 1 == 2
                 select d;
   
return View(myData.AsQueryable());
}
 

The 1 == 2 ensures an empty data set.

Thanks,
Tony

Parents
No Data
Reply
  • 23953
    Offline posted

    Hello Anthony,

    I tried to reproduce your problem, but with no success.

    Can you provide me with more info about your test scenario like:

    1. What version of the NA for jQuery you use? I suppose it is 11.2 SR.
    2. This error "Invalid argument" is it raised on server? If yes can you post the stack trace?
    3. Did you sync js files and Infragistics.Web.Mvc.dll to be the same version?
    4. In JSON response do you get empty JSON or a stack trace message?

     

     

    Best Regards,

    Martin Pavlov

    Infragistics, Inc.

Children