Kendo UI Grid data bind to two table DB - asp.net-mvc

I am trying to figure out two things. First, is it even possible. Second, am I on the correct path?
I am making an ASP.net Kendo UI Grid that just needs a very simple two table, inner join from an Entity Framework model. The issue is that one of the fields is incredibly large. It requires me to set the value to the json object size to max int value just to be able to return a single table result.
Because the resulting set is so large, I do not seem to be able to use a view model. It just returns a size limit error on that as well. Is there a way to return a very large dataset from two tables to a single Kendo UI grid? I have tried every suggestion from every existing answer on Stack Overflow and the Telerik forums.

I don't really think that some user need information which cannot be handled by default json object size.
May be should load first 50-100 characters from that field to grid and if user click on cell load rest of the data.
Another way is using virtual scroll or paging.
If kendo model cant handle your field size, you can add columnt to each row with view large data button and open window with text field loaded from db on click.

Related

Recommended way to do the search and populating the grid in ASP.NET Core MVC 6

I am creating a project where I need to create a view with search textboxes and a dropdown which would be populated from the server. Same view also have a grid which would be populated based on the search criteria enter/selected by user.
I want to know what would be the design of the page in terms of showing both on same page. Should I create a partial view for the grid or Search panel or add both in the single view?
Note that dropdown list would need to be populated from the ViewModel. So what is the common practice in the situation. I am new to this I have done few pages but with lot of code, session and ViewBags and I think I am not following recommended practice.
Actually, the design for your web application is according to your requirement.
For example, if you want grid to work with other datasource or view, you could build it as a component, then if you want to use it, you could directly use this component to avoid write the same codes for multiple time.
If you want to use same grid to show in some other page, you could build it a partial view, then you could directly call this view to show something.

is there anyway to force durandal to recreate view/controls on view revisits(invoke view attched event) while caching enabled

I am using a kendo UI grid on a view, which is part of durandal 2.0 app using knockout for mvvm.
On a specific view, there is need to display a kendo grid having dynamic number of columns,
so every time view is visited, grid columns may have different count than the last visits.
Now as caching is enabled(applicable to this view too), so for subsequent visits grid rows are changing to reflect data change, but grid header(including number of columns) remains as it was during very first visit to view.
Note: if i disable caching for compose which is used to compose this view, grid loads fine with varying number of columns every time, but can't disable caching just because one control is not loading fine, and due to business needs.
so i wanted to know is there any way i can tell durandal to run viewattached event every time a specific view is visited, if not possible then is it possible that i can ask Durandal to recreate kendo grid control on every visit(so it doesn't uses what it created and having in cache of view)... i also tried always run viewattached on comose, but that brings a flicker when visiting the view hence i feel kind of disables caching for compose(but i can't do that a this compose is common for more than a view, which all should use caching)
Your viewmodel should return a constructor function instead of an object literal. But without seeing your code, it is difficult to identify your specific problem.

Blackberry list field without canvas

Is it possible to create a customized list field in BB, where each row will have 4 different labels, and a bitmap field, without implementing the drawListRow method?
Since drawListRow uses canvas I want to avoid it. Because, I need to display a browser field in list row. Or is it possible to add label fields in list row?
You probably aren't going to be able to implement this the way you want - try putting more than one BrowserField on a screen at once and you'll soon run into multiple issues. I'd suggest creating a custom Field to act as a row instead, or try and get the desired look n feel using Field Managers.

TDBGrid columns design time or run time?

I am using TDBGrid for the first time.
I didn't even notice the Columns property in the object inspector and everything went just fine: the grid was filled.
Then I saw the Columns property and tried it. When I use the object insector to add items to the Columns property of the grid, they do not all of them show up at run time. To me, it looks like the FieldName property is important. It looks like it is correct, but there are no values in some columns.
If I leave this property blank (no columns at all) it seems that the control populates it itself at run time and I do see all the columns. I could live with that. When I set column titles at run time it works, but setting column width does not.
[Update] Thanks for the feedback. I am learning slowly. Now I see what is happening. I wanted three of the five columns to be calculated. Two are gotten from INNER JOINs and the third from an SQL 'cast' of SELECT ... FROM_UNIXTIME(<table>.time_stamp).
If I do not define the columns at design time then these values are populated at run time when I execute my SELECT. Cnn anyone tell me how to set things up at design time? Thanks
There is no difference in functionality between runtime and designtime set up columns. That is: what can be done designtime can also be done runtime, and vice versa.
When te Columns property is kept empty, the grid fills it by default with all fields it finds in the linked dataset, once the dataset is opened. All column specific settings, such as alignment, width, title caption, etc... are set to default, based on the type, length and name of the corresponding field. This is the lazy way which sure could be sufficient.
You could deside to use your own setup or modification of the columns property, for one or more of the following reasons:
Change the order of the dataset fields in which they must appear in the grid,
Truncate the width of text fields (especially VarChar fields or Char fields with a large length normally result in colums that are too wide for normal presentation and/or user interaction),
Change the alignment of the fields (normally numeric fields are right aligned by default),
Hide one or more fields from the dataset,
Etc...
These own settings can be done desingtime as well as runtime.
Using the designtime columns editor is the preferred and RAD way in need of these customizations. Open the editor by double clicking the grid or the property, or via the grid's context menu. If the linked dataset is active then the command Add all fields is enabled, which does exactly the same as if you did not select any field at all, i.e. the default behaviour as described in the second paragraph.
The best way to define the columns on a dbGrid is to doubleclick the dataset in order to create variables that the form knows about (persistent fields). You can edit various properties of these variables such as DisplayLabel, DisplayWidth and DisplayFormat.
You can also add calculated fields by double clicking on the dialog box which appears when you double click on the client dataset.

dynamically set smart gwt list grid header

I have created a smartgwt list grid. The grid headers are static and the content is filled with server side data.
The code looks something like this
ListGrid grid = new ListGrid();
grid.setFields();//set columns names..
grid.setData();//pass datasource..
On page load, it first initialize the grid object, set field names (columns) and when the server side data is available, it populates the grid.
This approach is fine when the columns/headers are static. However, I am trying to modifying the grid so that headers are set dynamically. To be more specific, server data will include information about grid header (number of columns of the grid, column names etc). One way to do this, put the header information in a grid content cell and design that cell to look like header.
I want to know if there is any better approach to do this ?
did you see this:
http://www.smartclient.com/smartgwt/showcase/#grid_top_header

Resources