Telerik Forums
Kendo UI for jQuery Forum
1 answer
61 views
In the URL
http://docs.kendoui.com/getting-started/introduction
under the section "Kendo UI Mobile" there is a code that if you copy and paste it does not work.
"Here is the complete example:"
<script>
var app = new kendo.mobile.Applilcation();
</script>

I changed that code for 
        <script>
             var app = new kendo.mobile.Application(document.body);
        </script>

and it worked.
Petyo
Telerik team
 answered on 12 Apr 2013
2 answers
232 views
Hello:

@(Html.Kendo().Grid<projectInfoViewModel>()
.Name("grid2")
.Columns(cols =>
{
    cols.Bound(e => e.OrgID).Tital("View Detail").Template(e => { }).ClientTemplate(" ");
    cols.Bound(e => e.OrgName).Title("Organization");
})
.DataSource(dataSource => dataSource
.Ajax()
                 .Read(read => read.Action("Index", "Summary"))
    )
     .ClientRowTemplate(
            "<tr>" +
                "<td>" +
                       @Html.ActionLink("#: OrgID#", "Index", "Info", new orgViewModel { oID = int.Parse("#: OrgID#"), uID = int.Parse("#: UserID#") }, null) +
                "</td>" +
                "<td>" +
                    "#: City #<br/>" +
                   "#: ProvinceText#<br/>" +
                    "#: CountryText# " +
                "</td>" +                
             "</tr>"
        )  
 )

I'd like to format the 1st column as Hyperlinks like: <a href="~/Info/Index?oID=999&uID=22">999</a>

however, i am having problem assign value to RouteValue:
new orgViewModel { oID = int.Parse("#: OrgID#"), uID = int.Parse("#: UserID#") }

oID and uID are both int, if I don't have int.parse(), it will complain that 'Cannot implicitly convert type 'string' to 'int'', I've tried Convert.ToInt32(), Int32.Parse(), int.Parse() all give error: Input string was not in a correct format. 

Please advise,
Thank you
HSO
Top achievements
Rank 2
 answered on 12 Apr 2013
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
85 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
203 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
187 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
47 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
50 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
105 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
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
Dialog
Chat
DateRangePicker
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
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?