Telerik Forums
Kendo UI for jQuery Forum
2 answers
450 views

Hi

I want to bind my Kendo Grid with custom dropdown... but the dropdown list items would be binded on demand or selection. not at the  "Index" action result

 

My ViewModel

public class GridShowClaimDetails
{
    public int PkEobDetailId { get; set; }
    public int PkClaimId { get; set; }
    public int FkEncounterId { get; set; }
    public int FkInsId { get; set; }
    public int FkCompanyId { get; set; }
    public int FkLocationId { get; set; }
    public int FkClaimBatchId { get; set; }
    public int PkClaimDetailId { get; set; }
    public bool IsElectronic { get; set; }
    public bool EobCompleted { get; set; }
    public bool ClaimRefiled { get; set; }
    public bool TempClosed { get; set; }
 
    //Encounter Values
    public DateTime EncounterDate { get; set; }
    public string CodeValue { get; set; }
    public decimal Cost { get; set; }
    public int Unit { get; set; }
    public decimal Charges { get; set; }
 
    //Patient Details
    public int FkPatientMpId { get; set; }
    public string PayerName { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
 
    public int IsFirstClaim { get; set; }
 
    #region Patient Liablity Section
     
    public decimal Deductible { get; set; }
    public decimal CoPayment { get; set; }
    public decimal CoInsurance { get; set; }
    public decimal Other { get; set; }
 
    #endregion
 
 
    //Grid Editable Fields
    [Range(0, 99999.99)]
    public decimal RemainingAmt { get; set; }
 
 
    [Range(0, 99999.99)]
    public decimal Allowed { get; set; }
 
    [Range(0, 99999.99)]
    public decimal Payment { get; set; }
 
    [Range(0, 99999.99)]
    public decimal Adjustment { get; set; }
 
    [Range(0, 99999.99)]
    public decimal TransferBalance { get; set; }
 
    //DropDown Properties
    [UIHint("_AdjustmentType")]
    public AdjustmentTypeViewModel AdjustmentType { get; set; }
 
 
    [UIHint("_CoverageType")]
    public CoverViewModel CoverageType { get; set; }
 
    [UIHint("_PatientResponsiblity")]
    public PatientResponsibilityViewModel PatientResponsible { get; set; }
 
    //Combined Properties
    /// <summary>
    /// FullAddress used to Bind the Grid on Practice Page
    /// </summary>
    public string FullName
    {
        get { return string.Format("{0}, {1}", FirstName, LastName); }
    }
 
    //Used for Posting the Gird Data.
    public string EncDate
    {
        get { return EncounterDate.ToString(Constants.KDateFormat); }
    }
 
    public GridShowClaimDetails()
    {
        //Intialize the new AdjustmentType everytime as when binding with MVC Kendo Grid it was getting null.
        //Intializing new at the time of getting ShowClaimDetails-EobController resolved the issue.
        AdjustmentType = new AdjustmentTypeViewModel();
        CoverageType = new CoverViewModel();
        PatientResponsible = new PatientResponsibilityViewModel();
    }
 
    //Used to Store and Retreive back the DropDown values
    public int FkCoverageTypeId { get; set; }
    public int? FkDisallowedTypId { get; set; }
    public int FkResponsibleTypeId { get; set; }
}
 
 
public class AdjustmentTypeViewModel
{
 
    public Int64? ChargeId { get; set; }
    public string Name { get; set; }
}
 
public class CoverViewModel
{
    public int? CoverageId { get; set; }
    public string CoverStatus { get; set; }
}
 
public class PatientResponsibilityViewModel
{
    public int PkInsuranceId { get; set; }
    public string PayerName { get; set; }
}

 

My  Partial View

@using System.Collections
@using Kendo.Mvc.UI
 
@model Csmr.Model.ViewModel.Billing.PatientResponsibilityViewModel
 
@(Html.Kendo().DropDownListFor(m => m)
      .Name("patientResponsible")
          .DataValueField("PkInsuranceId")
          .DataTextField("PayerName")
              .BindTo((IEnumerable)ViewData["patientResponsiblity"])
 )

//ShowClaimDetails is called when "Patient is seached"
//Get the Patient Claim Details and Binds it's Patient Responsibility.
public ActionResult ShowClaimDetails(int patientId = 0, int? claimId = null)
{
    var gridClaims = _eobService.GetAllClaimDetails(patientId, claimId);
    if (gridClaims.Count > 0)
    {
        BindPatientResponsiblity(patientId);
    }
 
    return Json(gridClaims, JsonRequestBehavior.AllowGet);
}
 
 
 
private void BindPatientResponsiblity(int patientId)
{
    var patientResponsiblity = _eobService.GetPatientResponsiblity(patientId);
    ViewData["patientResponsiblity"] = patientResponsiblity;
    ViewData["defaultPatientResponsiblity"] = patientResponsiblity.FirstOrDefault();
}

 

 

My Main Grid

@(Html.Kendo().Grid<GridShowClaimDetails>() // Specify the type of the grid
      .Name("gridClaimData")
      .Columns(columns =>
      {
          columns.Bound(p => p.CoverageType).ClientTemplate("#=CoverageType.CoverStatus#").Title("Coverage. Type").Width(50);
          columns.Bound(p => p.PkClaimId).Title("ClaimNo").Width(40);
          columns.Bound(p => p.PayerName).Title("Insurance").Width(50);
          columns.Bound(p => p.FullName).Width(50);
          columns.Bound(p => p.EncDate).Title("Date").Width(50);
          //.ClientTemplate("#= kendo.toString(kendo.parseDate(EncounterDate), 'MM/dd/yyyy') #");
          columns.Bound(p => p.CodeValue).Title("CPT").Width(40);
          columns.Bound(p => p.Unit).Title("Units").Width(40);
          columns.Bound(p => p.Charges).Title("Bill. Amt($)").Format("{0:0.00}").Width(40);
          columns.Bound(p => p.RemainingAmt).Title("Rem. Amt($)").Format("{0:0.00}").Width(40).Hidden();
          columns.Bound(p => p.Allowed).Title("Allowed($)").Format("{0:0.00}").Width(40);
          //columns.Group(group => group.Title("<strong><center>Patient Liablity</center></strong>")
          //    .Columns(info =>
          //    {
          //        info.Bound(x => x.Deductible).Title("Deducitble($)").Format("{0:0.00}").Width(40);
          //        info.Bound(x => x.CoPayment).Title("Co-Payment($)").Format("{0:0.00}").Width(40);
          //        info.Bound(x => x.CoInsurance).Title("Co-Insurance($)").Format("{0:0.00}").Width(40);
          //        info.Bound(x => x.Other).Title("Other($)").Format("{0:0.00}").Width(40);
          //    }));
          columns.Bound(p => p.Payment).Title("Payment ($)").Format("{0:0.00}").Width(40);
          columns.Bound(p => p.Adjustment).Title("Adjustment ($)").Format("{0:0.00}").Width(40);
          columns.Bound(p => p.AdjustmentType).ClientTemplate("#=AdjustmentType.Name#").Title("Adj.Type").Width(50);
          columns.Bound(p => p.TransferBalance).Title("Trans.Bal ($)").Format("{0:0.00}").Width(40);
          columns.Bound(p => p.PatientResponsible).ClientTemplate("#=PatientResponsible.PayerName#").Title("Pat.Resp").Width(50);
          columns.Command(command => command.Custom("Claim Details").Click("showDetails")).Width(50);
          columns.Bound(p => p.FkEncounterId).Hidden();
          columns.Bound(p => p.PkEobDetailId).Hidden();
          columns.Bound(p => p.FkInsId).Hidden();
          columns.Bound(p => p.FkCompanyId).Hidden();
          columns.Bound(p => p.FkLocationId).Hidden();
          columns.Bound(p => p.FkPatientMpId).Hidden();
          columns.Bound(p => p.FkClaimBatchId).Hidden();
          columns.Bound(p => p.IsElectronic).Hidden();
          columns.Bound(p => p.EobCompleted).Hidden();
          columns.Bound(p => p.ClaimRefiled).Hidden();
          columns.Bound(p => p.TempClosed).Hidden();
          columns.Bound(p => p.IsFirstClaim).Hidden();
          columns.Bound(p => p.PkClaimDetailId).Hidden();
      })
      .Pageable()
      .Editable(editable => editable.Mode(GridEditMode.InCell))
      .Scrollable(scroll =>
      {
          scroll.Enabled(true);
          scroll.Height(240);
      })
      .Selectable(sel => sel.Type(GridSelectionType.Row))
      .Events(events => events
          .Save("onSave")
        //.Edit("OnGridProcedureEdit")
      )
      .DataSource(dataSource => dataSource
          .Ajax()
          .Batch(true)
          .PageSize(20)
          .ServerOperation(false)
                  //.Read(read=>read.Action("EobClaim_Read", "Eob", new { area = "Billing" }).Data("additional_Info"))
          .Model(model =>
          {
              model.Field(p => p.CoverageType).DefaultValue(
                  ViewData["defaultcoverage"] as CoverViewModel);
              model.Id(p => p.PkEobDetailId);
              model.Field(p => p.PkClaimId).Editable(false);
              model.Field(p => p.PayerName).Editable(false);
              model.Field(p => p.Charges).Editable(false);
              model.Field(p => p.RemainingAmt).Editable(false);
              model.Field(p => p.CodeValue).Editable(false);
              model.Field(p => p.Unit).Editable(false);
              model.Field(p => p.Adjustment).Editable(false);
              model.Field(p => p.TransferBalance).Editable(false);
              model.Field(p => p.AdjustmentType).DefaultValue(
                  ViewData["defaultAdjustment"] as AdjustmentTypeViewModel);
              model.Field(p => p.PatientResponsible).DefaultValue(
              ViewData["defaultPatientResponsiblity"] as PatientResponsibilityViewModel);
 
          })
          .Events(events => events
              .Error("error_handler"))
          .PageSize(10)
      )
)

 

Jquery

//Patient Search on Eob. and Binding Claim Details
$("#txtSearchPatient").kendoAutoComplete({
    minLength: 3,
    dataTextField: "FullName",
    dataValueField: "PkPatientInfoId",
    suggest: true,
    filter: "contains",
    headerTemplate: '<div class="dropdown-header k-widget k-header">' +
        '<span>Full Name</span>' +
        '<span>SSN</span>' +
        '</div>',
    template: '<span class="k-state-default">#:data.FirstName#</span>' +
        '<span class="k-state-default">#: data.Ssn #</span>',
    dataSource: {
        serverFiltering: true,
        transport:
        {
            read:
            {
                url: PatientDetails,
                dataType: "json",
                type: "POST"
            },
            parameterMap: function () {
                return { seachPatient: $("#txtSearchPatient").data("kendoAutoComplete").value() };
            }
        }
    },
 
    //select event redirects user to the profile of selected patient
    //Redirecting and Binding to ClaimDetails
    //Gets the Claim Details
    //Gets the Patient Responsibility.
    select: function (e) {
        var dataItem = this.dataItem(e.item.index());
        var patientId = dataItem.FkMpId;
        var claimId = "";
 
        $.ajax({
            url: ShowClaimDetails,
            data: { patientId: patientId, claimId: claimId },
            success: function(data) {
                if (data.length > 0) {
                    //If Patient Search is sucessfull and it contains the claim data specific
                    //Bind to gridClaimData  - on existing Eob
                    var grid = $("#gridClaimData").getKendoGrid();
                    grid.dataSource.data(data);
                    grid.refresh();
                } else {
                    alert("No Claim Exists!!");
                    $("#txtSearchPatient").focus();
                }
            },
            error: function(request, status, error) {
                alert(request.responseText);
            }
        });
    }
});

Attaching Image what exactly I am trying to achieve

 

Boyan Dimitrov
Telerik team
 answered on 14 Jan 2016
3 answers
498 views
I've noticed that when I use the tabstrip, I often see the ul-li list elements briefly before the tabstrip is rendered.  Is there a general approach to prevent this flicker of the list before the tabstrip is rendered?
Dimiter Madjarov
Telerik team
 answered on 14 Jan 2016
3 answers
161 views
Hello,
I search a way to refresh automatically items when i make a drag and drop
i 've seen through firebug trees keep always the same value of  item  although we drag items between trees .
My goal is send  selected item to my server ..but we will talk about that..

Thks to help me

Please check My  attach file

function test() {
    
    console.debug( $("#treeview-right").data("kendoTreeView").options.dataSource);    
}
Alexander Popov
Telerik team
 answered on 14 Jan 2016
1 answer
292 views

Documentation seems lacking in examples of any real value for basic and advanced scenarios..

How to set size of cell in spreedsheet?

How to set cell formula programatically.

How to limit the number of columns?

How to get the spreadsheet control to use 12 columns width I have set with boostrap?

 These are just some of the questions I have and have not been able to find any answers too.

 

 

Petyo
Telerik team
 answered on 14 Jan 2016
1 answer
407 views
I am using kendo grid with with more than 8 columns and made 2 columns as freeze. when i tried to export the grid to pdf, the grid in the pdf is fully collapsed and misaligned. please suggest me the way to export pdf without any alignment issue.
Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 13 Jan 2016
1 answer
136 views

We have issue on Using Donut Chart with multiple segments.

 Say donut contain 6 different segment in that one has 95 % and remaining 5 share 5% then the line and and text are overlapping .

 Please find the attachement.

 Is there any solution for this ?

 Thanks

Elango

 

 

 

Iliana Dyankova
Telerik team
 answered on 13 Jan 2016
2 answers
166 views

Do you have any examples with treemaps with hover tooltip style windows or click events,that can for example show the underlying values, open modals, or more details behind the item using angular?

Thanks

 

Carlos
Top achievements
Rank 1
 answered on 13 Jan 2016
1 answer
124 views

Hello all,

 

I have a Grid that is bound to a DataSource. The schema for the data source is such that there is an embeded (related / expanded) objecting being returned by the API. Everything works fine for the read and update methods. However when the create method is called, the response from the POST method in the API only returns the resource that was created (not the expanded / related data). So when the grid attempts to rebind to the response object it fails because it does not exist in the POST response.

 

Should we simply force our API to provide the expanded object in the response? This seems like a violation to the RESTful paradigm perhaps? 

 

How are others handling this scenario?

 

Thanks.

Dimo
Telerik team
 answered on 13 Jan 2016
4 answers
170 views

Hi. We started having display issue on our "frozen" column since we installed the last update.
We tought it was our fault, but look at this kendo dojo:

http://dojo.telerik.com/ImewA/2

Scroll vertically to the middle, then scroll horizontally.

In version 2015 Q3 (2015.3.930), the "locked" table is continously scrolling from "0" to "current" and is blinking when you move the horizontal scroll bar slowly.

But, in version 2015 Q2 (2015.2.624), everything is fine.

I know that you fixed something related to the scrolling, we had trouble with padding on the right of the grid, and now that bug is fixed.  
I don't know if that "fix" for the right side introduced a bug for the left side!

Thank you.

Edward
Top achievements
Rank 1
 answered on 13 Jan 2016
5 answers
598 views
   Hi there,
   Is that possible to create a chart in the same way which is shown in this example (http://demos.telerik.com/kendo-ui/dataviz/bar-charts/grouped-stacked-bar.html) but where both stack and group properties are read from a JSON file?
  I'm not able to set "stack" property from data loaded from datasource.
  Thanks in advance for your response.
   Best regards.
JL
Luca
Top achievements
Rank 1
Iron
 answered on 13 Jan 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?