RadGrid MVC Column Formationg - asp.net-mvc

I am using the following line of code to format the data in my RadGrid column:
columns.Bound(p => p.Price).Format("${0:0.00}");
It works fine when the item has a price but throws a NullReferenceException when the price field is null.

If you have your model defined to accept null for the Price field, there is nothing in the RadGrid that should throw a NullReferenceException. Just to make sure I build a dummy grid that has a bound column that matches the code in your question. In my model, I set the value of the price field to null for one of the items. The result was just an empty cell for that item.

Related

adds leading zero to a column value Etext template

How to format the column so that it adds leading zero to a column value.
for example , in the etext template i want to add this logic. using which function can i do this ?
that is if job_code is 2900 then it should come as 002900. I tried adding "0000000" under the format column, but it didnt work.
You could format the column in Data Model sql so it comes to the template already formated..
Select LPAD(COLUMN_NAME, 6, '0') as ALIAS...
Here is an example of LPAD function: ERROR: Function SUBSTR requires a character expression as argument 1. and adding zeroes in front of data

Is there any formula to select the column dynamically in the below case?

Refer the worksheet here - https://docs.google.com/spreadsheets/d/1g3mthqijmB7lySfKUvt2NjYT-zVA5oyXr1hJKcJZkdc - Feel fee to edit.
I'm currently trying to get data from a specific column each time the data validation is changed.. It should pull the Names corresponding to FALSE values.. Currently I'm achieving this using multiple IF functions.. If there is a way to directly match the validation input to the row header and then get the values, it would be super great.
See my duplicate sheet ("Erik Help"):
=FILTER(E2:E,FILTER(F2:J,F1:J1=B2)=FALSE)
In plain English, this reads as follows: "Return any names in Column E where the header in in Columns F to J matches the value in cell B2 and where the corresponding value for the name is FALSE."
This formula is written flexibly, assuming that you will have more than two names in Column E within your real sheet. If there are more columns, just extend both instances of J to match the new rightmost column.

Google Sheets COUNTIF

I have a Google Sheet with a column of Names and some columns of Values
I also have a column of total available Names
This Sheet is connected to a Google Form and i need to check if users have filled any value in Values Columns
I need a formula that indicates if there are any missing names (of total available Names) from the NAMES Column and also if a Name appears give a warn that this name has no values in its row
Here is a screenshot of what i mean
Here is a shared form to give it a try
https://docs.google.com/spreadsheets/d/1N2CCD7MdKBO0faj8akfdtX-K_JZ6o7hD0tZSVfnbrAs/edit?usp=sharing
I have added a new sheet ("Erik Help") with this formula:
=ArrayFormula(IFERROR(VLOOKUP(FILTER(J3:J,J3:J<>""),{C3:C,IF(D3:D&E3:E&F3:F&G3:G<>"","OK","Missing Values")},2,FALSE),"Missing Name"))
This looks up every value in the full names list (FILTERed to remove blanks) within a virtual array with names from form submissions in column 1 and a concatenation of all form VALUES per row in column 2.
If a name from the full list is not found within the form submissions, VLOOKUP throws an error, which is replaced with "Missing Name" by the IFERROR outer wrap.
If a name is found and the concatenation of all values fields is not blank (i.e., if there is even one value present in that row), "OK" is returned. Otherwise, "Missing Values" is returned.
I think you need to use COUNTA. It worked for me in your testfile.
COUNTIF counts numbers, COUNTA also counts text.
=IF(COUNTA(D3:G3)<>0,"OK", "MISSING NAME")

creating a checkbox in a grid

I have to create a grid in mvc which will have the following columns
select -- checkbox,
Invoice date,
Invoice Number,
Acct Number,
Amount,
Amount due
Users will be able to click on a checkbox under select column for a line of record. I am new to Mvc. How do I write a viewmodel for this? Do I include the first column "select" in the viewmodel? How will I also represent this in my html?
Information about webgrid
Your ViewModel is just a normal model:
Boolean, DateTime, int, int, int, DateTime (I guess). And your select is just plain text; it is not going to vary from record to record.

Indexing with a Date field (as a String) in ClientDataSet

on Delphi XE2,
I have a ClientDataSet which have many fields as Name, ...
It have a field named Date, as value type String. Containing a Date (dd/mm/yyyy)
I want to print content of ClientDataSet, using FastReport.
I want before to sort content ascending according to the Date field. I'm using index.
But when doing this, sorting does only sorts fields according to the content of the Date string before the "/".
form example dates like : 12/11/2012, 15/10/2012, 01/12/2012 are sorting like this : 01/12/2012 - 12/11/2012 - 15/10/2012.
ny idea how doing this correctly ?!
The sorting is correct! As you have a string field, the sorting is made like strings are sorted i.e. from left to right. If you want it sorted by Date you need either a date field or sort the string representation like yyyy/mm/dd.
You have some options:
Bring the field as a DateTime field. You would have to change the original SQL to that.
Do what Marjan suggested, bringing that string field formatted on an ISO-like style (which allows for the field to be ordered cronologically when string sorting is aplied) and creating an calculated field for user-display formatting.
Creating a new field on the TDatasetProvider's OnGetRecords event and populating it as a Date field.
Similar as above but creating a string field with the date formatted in ISO-Like style.
I personally suggest the first approach if possible.

Resources