I have been using AweomeGrid for about 2 mvc4 Projects Now and It has been working fine, However I am completely bumped when I tried the mvc5 Branch. I basically have a grid and controller setup as follows
#Html.Awe().Grid("grdZone")
.Groupable(false)
.Url(Url.Action("ZoneRead", "Setup"))
.PageSize(20)
.Columns(
new Column(){ Name = "Id", Width = 70 },
new Column(){ Name = "Name" },
new Column(){ Name = "GCount", Header = "Group Count", Width = 100})
And the controller listing is as follows
public ActionResult ZoneRead(GridParams g)
{
var model = _zoneService.GetAll().Select(i => new ZoneListModel
{
Id = i.Id,
GCount = i.Groups.Count(),
Name = i.Name
});
return Json(new GridModelBuilder<ZoneListModel>(model, g)
{
Key = "Id",
Map = o => new
{
o.Id,
o.Name,
o.GCount
}
}.Build());
}
The problem is that The controller actually returns the data but somehow strangely, The Grid just displays empty table cells without any values at all. The number of empty rows displayed however corresponda to the records returned by the controller method
Please what Am I doing wrong
A speedy answer will be appreaciated
it's possible that on mvc5 you're using minification, and the minification broke the script, try adding AwesomeMvc.js without including it in a script bundle
(btw using version 4.7 this shouldn't happen anymore)
Related
I am trying to generate a document from scriban template but no data is present in the output:
var template = Template.Parse("{{model.Data}}");
var renederdContent = template.Render(new {
model = new {
Data = "some string"
}
});
Yet the output is empty. This used to work perfectly on .net framework whereas on .net core I've got a problem.
It seems the behavior of Scriban is different here in .net core. It changes names by default to a different case. For instance "Data" is changes to "data" and "PriceChanged" changes to "price_changed". To left the names unchanged you need to call Render method like this:
var renederedContent = template.Render(new {
model = new {
Data = "some string"
},
m => m.Name
});
Anyone had any luck with this?
I'm using 9.04.01 on DNN 9.
There doesn't appear to be a way to add a question unlike it's previous version.
The previous version had a + sign in the menu on the right to add a new question. This version doesn't. Is there a different way to add questions in this version?
Images http://robertveale.com/
Thanks.
You actually ran into something different. Please check http://2sxc.org/en/blog/post/12-differences-when-templating-data-instead-of-content to understand this
Your first view shows a list of content-assigned-to-the-module so you have the inline +.
The second view shows a list querying the DB, so hitting + wouldn't add it below that but anywhere else, so it's not part of the item-toolbar. If you need a + on the query-view, then the most common solution is to provide a separate + button - see for example how the blog-app does it here: https://github.com/2sic/app-blog/blob/master/_1%20Main%20blog%20view.cshtml#L24-L38
#* toolbar for add / manage posts *#
#Edit.Toolbar(toolbar: new object[] {
new {
command = new {
action = "new",
contentType = "BlogPost"
}
},
new {
command = new {
action = "contentitems",
contentType = "BlogPost"
},
showCondition = true
}
}, settings: new { hover="left", show = "hover" })
I am new to ASP.Net I added a list box in asp.net , I need to get the option set values from ms crm to list box
I don't know how to return the value for this can anybody help me
public static string GetMtefrecord()
{
var service = CRMWrapper.GetCRMService();
RetrieveEntityRequest retrieveBankAccountEntityRequest = new RetrieveEntityRequest
{
EntityFilters = EntityFilters.Entity,
LogicalName = "tec_new_mtfmtir",
};
RetrieveEntityResponse retrieveBankAccountEntityResponse = (RetrieveEntityResponse)service.Execute(retrieveBankAccountEntityRequest);
//return retrieveBankAccountEntityResponse.LogicalName.ToString();
}
If your optionset is a global optionset, you can retrieve it using the RetrieveOptionSetRequest message. Here is a bit of sample code
RetrieveOptionSetRequest retrieveOptionSetRequest =
new RetrieveOptionSetRequest
{
Name = _globalOptionSetName //Put your optionsetname here
};
// Execute the request.
RetrieveOptionSetResponse retrieveOptionSetResponse =
(RetrieveOptionSetResponse)_serviceProxy.Execute(
retrieveOptionSetRequest);
OptionMetadata[] optionList =
((OptionSetMetadata) retrieveOptionSetResponse.OptionSetMetadata).Options.ToArray();
I'm attempting to follow the logic describe here: https://msdn.microsoft.com/en-us/library/gg309282.aspx for creating associated entities using the RelatedEntities Property. Problem is, no Associated Entities are getting created. I'm attempting to perform this action from within a Pre=Operation plugin... Is it not supported within a PreOperation Plugin? What am I doing wrong if it?
Here is the code:
var collection = new EntityCollection();
collection.Entities.AddRange(incentives.Select(e => e.ToSdkEntity()));
target.RelatedEntities.Add(new Relationship(new_LeadProduct.Fields.new_lead_new_leadproduct_LeadId), collection);
Since a pre-create plugin executes before the target entity has been created in the database you will not be able to create related entities referencing the target. You should execute related entity logic in a post-create plugin.
Edit:
This answer applies if you are trying to create related records associated with the Target in a plugin operation. Your question did not specify otherwise but based on the code in your answer it looks like this is not what you are trying to do.
Here is the code from the MSDN Example:
//Define the account for which we will add letters
Account accountToCreate = new Account
{
Name = "Example Account"
};
//Define the IDs of the related letters we will create
_letterIds = new[] { Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() };
//This acts as a container for each letter we create. Note that we haven't
//define the relationship between the letter and account yet.
EntityCollection relatedLettersToCreate = new EntityCollection
{
EntityName = Letter.EntityLogicalName,
Entities =
{
new Letter{Subject = "Letter 1", ActivityId = _letterIds[0]},
new Letter{Subject = "Letter 2", ActivityId = _letterIds[1]},
new Letter{Subject = "Letter 3", ActivityId = _letterIds[2]}
}
};
//Creates the reference between which relationship between Letter and
//Account we would like to use.
Relationship letterRelationship = new Relationship("Account_Letters");
//Adds the letters to the account under the specified relationship
accountToCreate.RelatedEntities.Add(letterRelationship, relatedLettersToCreate);
//Passes the Account (which contains the letters)
_accountId = _service.Create(accountToCreate);
After some additional testing, the Related Entities Collection must be populated before the PreOperation stage. So registering this to run on PreValidation works as expected.
So my initial need is that I need to display two properties in the MVC control ListBoxFor. Basically I want to do something like this:
#Html.ListBoxFor(m => m.ContractLocations, new SelectList(Model.ContractLocations, "CUSTNMBR", "CUSTNAME" + " - " + "CUSTNMBR" ), new { #class = "form-control row marb10", size = 15 })
But obviously it won't let me do that. So I am assuming that I need to create a custom property in my ViewModel? But I'm not really sure how to combine two strings within my model? Basically I want to create something similar to a ko.computed where it adds the two values together and then I can display it on my ListBox control. Although I might be thinking about this all wrong and maybe there is an easier alternative?
So what is the best option to accomplish this?
Add a list property to your model:
public IEnumerable<SelectListItem> ContractLocationsList { get; set; }
In your Action, build your list, something like:
myModel.ContractLocationsList = new List<SelectListItem>() {
new SelectListItem() { Value = Customer.Id, Text = Customer.Name + " - " + Customer.Number }
};
And now in your View, you can simply:
#Html.ListBoxFor(m => m.ContractLocations, Model.ContractLocationsList, ...)
Notice that ContractLocationsList holds the list of values to select from, while ContractLocations holds the actual selected values.