Telerik Forums
Kendo UI for jQuery Forum
2 answers
56 views
Hello:

Here is the Razor view of Grid declaration:

@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(cols =>
{
    cols.Bound(c => c.OrgID).Template(e => { });
    cols.Bound(c => c.UserID);
    cols.Bound(c => c.IsAssigned);
 
})
.RowTemplate(@<text>
@item.OrgName<br />
@item.City, @item.ProvinceText, @item.CountryText
 
</text>)
 
)
There are 3 columns, the one currently in RowTemplate only applies to the 1st column, I also need the 2nd column to be 'templated', which shows a photo and name of the User (accessable by @item.ImgURL, @item.FullName).
I am not sure how to do that, because if I put <tr> or <td> within RowTemplate @<text> block, it complains that those elements cannot be nested.  if I don't have <tr> or <td>, the html output puts colspan="3", so no way for me to come up 3 column structure.

Please advise,

Thank you,
HSO
Top achievements
Rank 2
 answered on 12 Apr 2013
1 answer
1.4K+ views
Hi,

I'm using the MVC wrappers with ajax binding and I cannot find a way to maintain row selection after an automatic timer initiated grid refresh. The timer is working just fine, but the row selection is lost after the refresh. I think it would be very good to get an example from Telerik as I've spent quite a bit of time searching the internet and this must surely be a common requirement.

Can someone please help with the following code?:

var timer = $.timer(function () {
        
    // -- find currently selected row --
    var grid = $("#Grid").data("kendoGrid");
    var row = grid.select();
    var uid = row.data("uid");
        
    // -- refresh grid --
    grid.dataSource.read();
        
    // -- reselect row --
    var row2 = grid.table.find('tr[data-uid="' + uid + '"]');
    row2.addClass('k-state-selected');
    
});
timer.set({ time: 5000, autostart: true });

Thanks in advance
Dimiter Madjarov
Telerik team
 answered on 12 Apr 2013
1 answer
84 views
With the hierarchical grid setup. Can I disable or prevent the child grid on a row by row basis? Or do I need to use brute force and remove the expand/collapse class on the column?
Dimiter Madjarov
Telerik team
 answered on 12 Apr 2013
1 answer
199 views
I have this grid, It's created through viewmodel that returns two objects, one of them is in a list form and create  columns dynamically. I don't have trouble setting values, I can do this perfectly using javascrip. But, when I click to save returns the controller only null values in the list, could set values in a list like this?
Thanks

Grid:
@(Html.Kendo().Grid(Model)
    .Name("Programas")
    .Columns(columns =>
    {
        columns.Bound(t => t.Programa.ProgramaId).Title("Programa");
   
        for (var i = 0; i < ViewBag.num; i++)
        {
            columns.Bound(e => e.Empresas[i].Selected).ClientTemplate("#=funcao(Empresas[" + i + "])#");
               
                
        }
    })
    .Filterable()
    .ToolBar(tb => tb.Save()
    .Editable(ed => ed.Mode(GridEditMode.InCell))
    .DataSource(data => data
        .Ajax()
            .Model(mod => {
                mod.Id(m => m.Programa.ProgramaId);
                  
            })
        .Batch(true)
        .Read(read =>read.Action("GetProgramas","ProgramaRede", new { id = ViewBag.RedeId}))
        .Update(up =>up.Action("UpdateProgramas","ProgramaRede", new { id = ViewBag.RedeId })
        )))
JS:
function set(line, checkbox) {
   
    var state = $(line).is(':checked');
    var grid = $('#Programas').data().kendoGrid;
    var dataSource = grid.dataSource.view()[line.id]
       
   
    for (var c = 0; c < dataSource.Empresas.length; c++)
        if (dataSource.Empresas[c].Value == checkbox) {
               
            dataSource.Empresas[c].set("Selected", state)
               
            dataSource.dirty = true;
   
        }
}
   
function funcao(emp, prog) {
       
    retorno = "<input type='checkbox' onclick='set(this,\"" + emp.Value + "\")'  class='chkbx' id=" + prog + " " + ((emp.Selected) ? "checked = 'checked'" : '') + " class='chkbx' />";
       
    return retorno;
}
Update Controller:
        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult UpdateProgramas(short id, [DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]  IEnumerable<ProgramaRedeViewModel> model)
        {
///////function to editing
}
Petur Subev
Telerik team
 answered on 12 Apr 2013
2 answers
183 views
Is it possible to bind a complex object to both the master grid and the subgrid using the html helper?  For example, if I have a collection of Employers, and each Employer contains a collection of Employees, and these collections share a EmployeeId.  Is it possible to bind the Employer to the master grid, and have the subgrid bound to Employees?  I need this to all be bound simultaneously so that the main and subgrids can both be displayed when the page loads.  Thanks.
Wayne
Top achievements
Rank 1
 answered on 12 Apr 2013
0 answers
42 views
Hi
I successfully bind from chrome but not from explorer 9.
do you know about this ?
I can see in fiddler that the json url is not called, why ?
Thanks


var items = new kendo.data.DataSource({
schema: {data: "GetProdByBizResult.RootResults"},
type: "json",
serverFiltering: true,
transport: {
read: {
url:"http://www.yelotag.com/light/BizRef-Web-DomainService1.svc/JSON/GetProdByBiz",
datatype:"json",
data: {bizId: window.bizId,
lg: window.lg
}
}
}
});
Michal Revivo
Top achievements
Rank 1
 asked on 12 Apr 2013
2 answers
43 views
After you enter text in the filter field (from a filterable mobile listview) the cancel icon that is supposed to display to the right of the field is not the correct icon.
Kenneth
Top achievements
Rank 1
 answered on 12 Apr 2013
0 answers
100 views
Hi
With aspx you can pass parameter in the url like
http://www.mytestapp.com/asp/default.aspx?lg=0&bizId=46958&name=nathaliePastry.com

how you can pass parameters for an html page

http://www.myTestapp.com/my/sushi.html ??????

Thanks
Michal Revivo
Top achievements
Rank 1
 asked on 11 Apr 2013
0 answers
93 views
Hi
I am testing the sample sushi web.
How I can debug the javacript and display the number of items for example.
It's running in chrome but nor in explorer.
I try to use F12 for explorer but didn't succeed to display the number of items.
Could you help ?
Thanks

var items = new kendo.data.DataSource({
      schema: {data: "GetProdByBizResult.RootResults"},
                        type: "json",
      serverFiltering: true,
      transport: {
                            read: {
        url:"http://www.yelotag.com/light/BizRef-Web-DomainService1.svc/JSON/GetProdByBiz",
        datatype:"json",
         data: {bizId: window.bizId,
          lg: window.lg
         }
        }
                        }
                    });
Michal Revivo
Top achievements
Rank 1
 asked on 11 Apr 2013
0 answers
87 views
Hi Everyone,

I am new to kendo ui, and past two weeks I was working on some grid functionality using ASP.Net web Api, LINQ to Entity and Kendo UI. I am able to do serverFiltering, serverPaging and serverSorting, but i have a difficulty in the serverGrouping: true.

It would be really helpful if you share the idea, if someone already did this functionality.

Your help is greatly appreciated.

Pandian
Pandiyarajan
Top achievements
Rank 1
 asked on 11 Apr 2013
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?