小编Sik*_*e12的帖子

如何使用Kendo UI Grid的SetDataSource方法

有没有人能够使用kendo UI网格的setdatasource方法?我相信这用于分配可以在以后阶段分配给网格的数据源,也可以用于网格刷新目的.但是我找不到任何适当的文档来解释如何使用这种方法并制作可刷新的网格.

我试图通过远程ajax调用更新我的数据源.我还假设通过将autosync属性设置为true来更新源时应该自动刷新.每次我点击日历控件我都会将日期值传递给GetRemoteData函数,以便通过ajax请求更新数据.

目前这不起作用.关于什么是解决方案的任何线索?

我的看法

    $('#calendarContainer').kendoCalendar({
        format: "dd/MM/yyyy",
        culture: "en-GB",
        change: onDateChange
    });


 function onDateChange() {
        var selectedDate = kendo.toString(this.value(), 'dd/MM/yyyy');

        GetRemoteData(selectedDate);
        /*
         $("#grid").data("kendoGrid").dataSource.data(bob);
         $("#grid").data("kendoGrid").dataSource.read();
        */
    }



   $('#grid').kendoGrid({

            dataSource:GetRemoteData(date),

            scrollable: {
                virtual: true
            },
            navigatable: true,
            groupable: true,
            sortable: true,
            selectable: "row",
            pageable: true,

            pageable: {
                input: true,
                numeric: false
            },

            resizable: true,
            reorderable: true,
            filterable: {
                extra: false
            },
            columns: [
                {
                    field: "DealNumber",
                    width: 150,
                    title: "DealNumber",
                    filterable: {
                        operators: {
                            string: {
                                startswith: "Starts With",
                                contains: "Contains" …
Run Code Online (Sandbox Code Playgroud)

javascript jquery html5 kendo-ui kendo-grid

9
推荐指数
2
解决办法
4万
查看次数

在身份验证过程中,ApplicationSignInManager类为null

以下代码正在ASP.NET MVC 5项目中使用.每次运行以下代码时,ApplicationSignInManager类始终为null,从而导致空引用异常.作为一个相当新手我不明白代码调用AccountController类的构造函数调用usermanager实例和登录管理器.也许这是我需要关注的地方,但事实是我无法找到代码的那一部分.有人帮忙吗?

确切地说,从HTTPost登录方法抛出异常.signInManager始终为null.

var result = await SignInManager.PasswordSignInAsync(model.UserName, model.Password,
                                     model.RememberMe, shouldLockout: false);
Run Code Online (Sandbox Code Playgroud)

下面是c代码

[Authorize]
public class AccountController : Controller
{
    private ApplicationUserManager _userManager;
    private ApplicationSignInManager _signInManager;

    public AccountController()
    {
    }

    public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager)
    {
        UserManager = userManager;
        SignInManager = signInManager;
    }

    //
    // GET: /Account/Login
    [AllowAnonymous]
    public ActionResult Login(string returnUrl)
    {
        ViewBag.ReturnUrl = returnUrl;
        return View();
    }


    public ApplicationSignInManager SignInManager
    {
        get
        {
            return _signInManager ?? HttpContext.GetOwinContext().Get<ApplicationSignInManager>();
        }
        private set { _signInManager = value; }
    }

    // …
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net

9
推荐指数
1
解决办法
1万
查看次数

通过SMTP客户端发送电子邮件时出错

这可能对你来说非常微不足道,但我无法弄清楚为什么我在运行我的代码时收到此错误消息.我查看了同一网站上的一些相关问题,例如 通过带有C#的Gmail SMTP服务器发送电子邮件, 但没有一个是有帮助的.有人愿意帮忙吗?使用不同的组件也是可以接受的 所以如果有人得到一个可以理解的工作解决方案.

错误消息= SMTP服务器需要安全连接或客户端未经过身份验证.服务器响应为:5.5.1需要身份验证.了解更多信息

这是我的代码

System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();      
message.From = new MailAddress("bob@googlemail.com");
message.To.Add("bob@hotmail.com");
message.Subject = "Hello";
message.Body = "Hello Bob ";
message.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;

SmtpClient smtpClient = new SmtpClient("smtp.gmail.com", 587);
smtpClient.EnableSsl = true;
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = new NetworkCredential("MyGoogleMailAccount", 
                                               "mygooglemailpassword");

smtpClient.Send(message.From.ToString(), message.To.ToString(), 
                message.Subject, message.Body);   
Run Code Online (Sandbox Code Playgroud)

.net c# smtp smtpclient web

7
推荐指数
1
解决办法
2万
查看次数

在Neo4j中使用多个关系中的Where子句

显然,似乎以下WHERE子句不起作用,因为我们的查询中有两个关系(WorksAt和ResponsibleFor).如果只有一种关系,那么这就像魔法一样.在下面的查询中,查询返回部门科学中的所有课程,但它不会过滤掉Maria Smith教授的课程.我想做的只是获得在科学系工作的Maria Smith教授的课程.我遇到了似乎是潜在候选条款的WITH和Start子句,使其可以在将查询的一部分过滤掉之前将其发送到另一部分.
http://neo4j.com/docs/stable/query-with.html
但我还没有掌握这个概念.有人帮忙吗?

MATCH (d:Department)<-[w:WorksAt]-(t:Tutor)-[r:ResponsibleFor]->(c:Courses) 
WHERE d.name='Science' 
AND  t.name='Maria Smith'
return  c,r
Run Code Online (Sandbox Code Playgroud)

neo4j graph-databases cypher

4
推荐指数
1
解决办法
2899
查看次数

WPF telerik TreeView控件中的mscorlib.dll中发生了未处理的"System.StackOverflowException"类型异常

这是我的xaml

<Window.Resources>
    <sampleData:MainWindow  x:Key="DataSource"/>
    <DataTemplate x:Key="CustomComponentParameter">
        <TextBlock Text="{Binding Name}" />
    </DataTemplate>
    <HierarchicalDataTemplate x:Key="CustomComponent" ItemTemplate="{StaticResource CustomComponentParameter}"
       ItemsSource="{Binding Parameters }">
        <TextBlock Text="{Binding Name}" />
    </HierarchicalDataTemplate>
</Window.Resources>
Run Code Online (Sandbox Code Playgroud)

用于telerik控制

    <telerik:RadTreeView ItemsSource="{Binding Source={StaticResource DataSource},Path=SummaryViewCollection}"  ItemTemplate="{StaticResource CustomComponent}" HorizontalAlignment="Left" Height="77" Margin="345,482,0,0" VerticalAlignment="Top" Width="449">

    </telerik:RadTreeView>
Run Code Online (Sandbox Code Playgroud)

这是我的Codebehind课程

主要Codebehind类MainWindow.xaml.cs的代码

 public partial class MainWindow : Window
 {
    public ObservableCollection<CustomComponent> SummaryViewCollection { get; set; }
    public MainWindow()
    {          
       this.SummaryViewCollection = //code to fill in the details 
    }           
 }
Run Code Online (Sandbox Code Playgroud)

这是CustomComponentClass的代码

public class CustomComponent
{

    private ObservableCollection<CustomComponentParameter> parameters = new ObservableCollection<CustomComponentParameter>();


    public string Name …
Run Code Online (Sandbox Code Playgroud)

.net c# wpf xaml telerik

0
推荐指数
1
解决办法
1万
查看次数