Telerik Forums
UI for ASP.NET MVC Forum
1 answer
658 views
Hi -

I have the grid below and am trying to get the value of a certain column to dynamically render a set of workflow buttons based on that value.  Is it possible to do this?


Html.Kendo().Grid<ViewModelName>()
   .Name("GridName")
   .ToolBar(commands => commands.Create())
   .DataSource(ds => 
  ds.Ajax()
  .Read("Select", "EmpActivitySummary", new { EmpActivityId = RouteData.Values["id"] })
  .Update("Update", "EmpActivitySummary", new { EmpActivityId = RouteData.Values["id"] })
  .Destroy("Delete", "EmpActivitySummary")
  .Create("Insert", "EmpActivitySummary", new { EmpActivityId = RouteData.Values["id"] })
  .Model(m =>
  {
  m.Id(x => x.Id);
  m.Field(x => x.EmpActivityId).Editable(false);
  m.Field(x => x.Id).Editable(false);
  m.Field(x => x.Approved).Editable(false);
  })
   )  
   .PrefixUrlParameters(false)
   .Columns(r =>
   {           
r.Command(com =>
{
com.Edit();
com.Destroy();

var currentStatus = r.Template(model => model.Approved);  // <--------------- I'm trying to get the value of this column
var utilities = new WorkflowUtilities("Workflow Name");
var steps = utilities.GetSteps(currentStatus);

foreach (var step in steps.Where(step => Roles.IsUserInRole(step.RequiredRole)))
{
com.Custom(step.ButtonText).Click("ProcessWorkflowStep").SendDataKeys(true);                        
}

}).Title("Commands").Width(60);
r.Bound(x => x.Id).Width(100);
r.Bound(x => x.Field);
r.Bound(x => x.Quantity);
r.Bound(x => x.Price).AsCurrency();
r.Bound(x => x.Date);
r.Bound(x => x.Approved);
    
   })
   .Render();
Dimiter Madjarov
Telerik team
 answered on 10 Oct 2014
1 answer
93 views
Hi,

How to export to excel after having re-ordered the columns, with the new column order

Thanks,
Annie
Atanas Korchev
Telerik team
 answered on 10 Oct 2014
1 answer
169 views
Hi There,

I am facing an issue when trying to use multi-select control in grid filter.

I have gone through the following link - http://www.telerik.com/forums/multi-select-in-grid-filter-template

The UI of multiselect does not persist the value when I filter the multiselect column and go to some other column and filter it and come back to multiselect column it does not display values on UI but it retains the values on multiple columns search with other filters.

It works when I remove data-bind but I cannot apply filter simultaneously with other filters.

Please help me to achieve both persistent search and filtering multiple columns simultaneously.

Petur Subev
Telerik team
 answered on 10 Oct 2014
1 answer
120 views
Hi,

I am using kendoGrid() to display data, which receives from database in MVC model.

In this kendoGrid, we included "Edit" feature given by kendoGrid.  But when trying to update the data,  the cursor is going into the controller, but the parameter(model) for that action contains null data. i.e. the data is not getting posted from view to controller.

for your reference, I have attached the code files.

Thanks in advance.

Swarnalatha
Alexander Popov
Telerik team
 answered on 09 Oct 2014
3 answers
214 views
Hi,

Is there a sample code for adding a MVC kendo UI grid in a partial view, and setting its datasource and columns in a view

Thanks,
Annie
Dimiter Madjarov
Telerik team
 answered on 09 Oct 2014
1 answer
1.0K+ views
In one of my pages I am trying to load data when DropDown
Value is changed. However I have hard time in call contoller’s action method on
dropdown’s onchange event. If you have any sample available please share with
me.

Georgi Krustev
Telerik team
 answered on 09 Oct 2014
1 answer
383 views
I would like to position the refresh button at the top of the grid. Is that possible? The grid below is a sample of the code. (mostly default values)

@(Html.Telerik().Grid(Model.DeleteableRules)

         
.Name("DeleteableRulesGrid")

         
.DataKeys(dk => dk.Add(dr => dr.ListID))

         
.Selectable()

         
.Columns(columns =>

          {

             
columns.Bound(dr => dr.ListID).HtmlAttributes(new
{ style = "width:100px;" });

             
columns.Bound(dr => dr.OrganizationID).HtmlAttributes(new { style = "width:100px;"
});

             
columns.Bound(dr => dr.RuleName).HtmlAttributes(new
{ style = "width:300px;" });

             
columns.Bound(dr => dr.CurrentState).HtmlAttributes(new
{ style = "width:300px;" });

          })

 

          )



Dimo
Telerik team
 answered on 08 Oct 2014
2 answers
250 views
Hello

I want to change the DateHeaderTemplate from the standard "ddd MM/dd" format to "ddd dd/MM". How do I do this in MVC?
I couldn't find an example for MVC in the docs, only for javascript.

BR
Jonas
Jonas
Top achievements
Rank 1
 answered on 08 Oct 2014
3 answers
445 views
I found help from http://docs.telerik.com/kendo-ui/api/javascript/ui/tooltip in getting this far.  However, we are using Kendo MVC Widgets so, the line of code
below "return target.text() is never populated.  I did find by poking around in debugger that e.target.context.value had the values for each generated <input> tag in both the Html.Kendo().TextBox() and Html.Kendo().ComboBox().

Here's the code that displays a Kendo Tooltip for every input html element within a specific div.

$(document).ready(function () {
        $("#project-tabs").kendoTooltip({
             filter: "input",
             content: function (e) {
                     var target = e.target; // the element for which the tooltip is shown
                     //return target.text(); // set the element text as content of the tooltip --> This does not work on MVC.
                     return e.target.context.value;  // This does work on MVC Widget
            }
    });
});

Is there a better way?
Petur Subev
Telerik team
 answered on 08 Oct 2014
1 answer
132 views
You surely are all aware of the T4MVC service, very helpful in avoid 'magic strings'.
Now, I would like to use it in a kendo template, but I found difficult to understand how parameters must be written.
Right now, I have this sample template:

<script id="agenda-event-template" type="text/x-kendo-template">
    <div>
        <a href='/Controller/Action?id=#: currentid#'>#: title #</a>
    </div>
</script>

(where I stripped out non relevant code).

If I want to use T4MVC, I have to rewrite the previous code as in:

<script id="agenda-event-template" type="text/x-kendo-template">
    <div>
        <a href='@MVC.Controller.Action(??????)>#: title #</a>
    </div>
</script>

But how can I pass the 'currentid' parameter in the action?
Thanks in advance...
Andrea

T. Tsonev
Telerik team
 answered on 08 Oct 2014
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?