DataGrid column header with a text box for filtering - visual-studio-2010

I'm having a bit of problems creating a DataGrid with a header label AND a text box (at this point I'm not even entirely sure this is possible).
Here's what I want to do:
I need to dynamically create a table (the number of columns can and will change, so the grid needs to be created dynamically and cannot use bindings specified in the XAML code or similar). All the columns however will always be text columns.
Because those will be text columns, I'd like to add a text box to each header to enable simple filtering of the data in the DataGrid. I don't want to add extra text fields to OTHER parts of the Silverlight page, as I want to keep things as compact as possible. Also, since the number of columns is dynamic, adding a large number of text boxes above the DataGrid wouldn't look too good either. ;)
Also, if possible, I'd like to keep a label in each header to display the names of the columns as well.
So far I've tried adding the a TextBox as the Header of a DataGridTextBoxColumn but when I do that in a very simple Silverlight project, the whole DataGrid won't show up.
Please help.
EDIT:
I saw the answer to this question: placing a text box inside the silverlight data grid column header
However, the answer itself didn't give me much to go on (the example is too short, and I'm not too good with XAML yet), and the code on CodePlex just adds extra fields to the Silverlight page. None of it tackles the problem of dynamically creating the DataGrid.

OK, here's what I did that solved my issue...
I had to use a Style to achieve the functionality of having an extra text box inside each column header and filling out the Tag property of each thus created TextBox to later find out which column has been changed.

Related

Hide/remove options from a view's grid header filtering

I've been looking for an approach to remove unwanted values from a views grid column filtering dropdown but I'm not sure if its even possible.
A specific view in our app only displays results where the column will contain 5 values, however the column option set has 20+. Is it possible to remove the unwanted 15 values from being displayed when the view's filter by function is used?
This documentation does not mention any way the values can be hidden.
I have added a web resource to a view column before, to change text values into an image, however I don't think this is an applicable place to add a script to hide filter by values.
I have developed plugins so not against using this medium if the approach works and does not introduce a performance hit.
Unfortunately that header filter is not open for customization/configuration. Though MS mention it as Excel like filter, it is not going to give the filter options for only values from current list. It will load the full options list.
When we had such requirements in the past - we have developed a PCF control with grid + filters and used it instead.

Make Handsontable autocomplete popup wider than the column

The Customer ID column is setup to use autocomplete. The autocomplete values concatenates various customer information together, to aid the user in selecting the correct one. Once selected, the Customer ID is put into the grid.
I cannot figure out how to make the autocomplete popup wider so that it fits the concatenated information.
This is what it needs to look like, which I achieved by tinkering with the elements after they were rendered. Ideally, it would be just wide enough to fit the content.
Try using select2-editor from
https://github.com/trebuchetty/Handsontable-select2-editor
The select2 editor automatically expands to the width of the column text.

JqGrid - Display two text boxes in one cell

Is it possible to display two editable text boxes in one cell of the JqGrid
Sorry, but the description of the problem in the comment to your question still don't contain any examples which shows why you have to display two text boxes in one cell. Moreover you still not answered on the question: which editing mode you use?
The problem is the following: if you use some software product you can use a lot of its standard features. In the case the implementation will be short and you can make very nice solution writing very small code. If you one the other side would try just follow your original imagination of how all should looks like you can spend many time and to write a lot of code. As the result from the point of view of the user who will work with your site all will be almost the same as in the simple solution. Is it really required?
If you would use form editing for example you can easy display additional textboxes, checkboxes or textareas from hidden columns. jqGrid automatically create controls for all hidden columns which have editable: true property. So what you need to do in the case is just to show hidden field in the form with respect of $.show (like in the answer).
I used the same concept in "trirand.com/blog/jqgrid/jqgrid.html#";
There in the Row editing --> Custom edit, JqGrid demo examples, its displaying three buttons on a one cell.

Data binding controls in asp.net

I have to display a set of data in the following manner:
Which ASP.NET 3.5 control best matches my requirement?
If one matches, could you please give me an idea about how to format it to view like the image?
Well, first off you have multiple blocks (multiple rows) so I would suggest a Repeater. Within each block you must display three columns (the image the text and the small images), and you should use a Panel (renders as a ). In the second panel you have multiple lines of text for which you can use Labels because they allow for rendering as a so that you an include a class.
Style everything nicely with CSS and you should be able to remake the above picture.
I think repeater control would be fine for your requirement.

Add an icon instead of a text in a column

in JQGrid 3.8, is it possible to have an icon instead of text in a column ?
I don't think it's possible but if you have a trick, i'd be happy
There are many ways to add icons in the grid. First way is: the data which be placed in the column header (colNames) or inside of the cell data could be HTML data. So you can easy insert the <img> element in the grid. One more method is th use custom formatters. See here some demos. If the standard jQuery UI icons contain all the icons which you need I would recommend you to use there.

Resources