Get DynamicData value from Document
How do i get Dynamic Data value from database.
For e.g
When i create module i created Dynamic Column using SetValue ("Column1", "valueofcolumn1")
at the same time i want to retrieve that Column1 value i.e valueofcolumn1 using
IQueryable<Document> &
App.WorkWith()
.Documents()
.Where(item => item.Column1)
.get()
or some other method is there to retrieve data?
Is it possible to Convert IQueryable<Document> to DataTable?
Hello RAFIQ,
You can use Telerik.Sitefinity.Model.DataExtensions.GetValue
model.GetValue(dynamicField.FieldName)
Best wishes,
Ivan Dimitrov
the Telerik team
Is there any way to get all DynamicData Value from particular row?
also is it possible to convert IQueryable<Document> to DataTable?
Hi,
IQueryable<Document> GetApplications have some data.when i am bind in Grid and mapping the dynamic data column It is Showing the values from DB.
i want to get those value in code behind itself with out bind in grid.
Hi RAFIQ,
I have some trouble understanding what you mean, so I will rephrase your questions the way I understand them.
Q: How can I convert IQueryable<T> to DataTable?
A: This is highly ineffective and inadvisable, because there is no way to accomplish this without executing the query. If this is what you want to do, here is a sample implementation from StackOverflow:
public
static
DataTable AsDataTable(
this
IQueryable value, DataTable table)
var reader = value.GetEnumerator();
while
(reader.MoveNext())
var record = (Customer)reader.Current;
table.Rows.Add(record.CustomerID, record.City);
return
table;
Are you able to do something like
App.WorkWith()
.Documents()
.Where(item => item.Column1 == "someValue")
.get()