Dynamic resize gridview edit template based on size of Item template - templates

I have a GridView that displays data in up to 30 columns. Sometimes this has the effect that the gridview expand to a width that requre a horizontal scrollbar but not always. The length of the data in the columns also vary and I don't want to set a specific width, it's nice that the grid is small if half of the columns are empty.
The problem is when I enter edit mode, labels gets replaced by textboxes and those take up more width and the whole table resizes itself.
Is there any way I can keep the item template and it's labels without a fixed size but at the same time always make sure the edit template will have the same size.
I was thinking about something like this:
On "enter edit mode event"
EditTemplateTextBox.Width = CurrentItemTemplate.Width;

I was able to keep my GridView from resizing when switched to edit mode (except for the new "Update" and "Cancel" columns that get added) using this CSS:
table input
{
width: 95%;
}
You can use 100% if you want, but 95% gave a little bit of spacing between the cells.
Also, if you have other tables on the page that you don't want to be affected by this, give your GridView a CssClass and replace 'table' with the name of your css class like so:
<asp:GridView ... CssClass="myGridView">
.myGridView input
{
width: 95%;
}

Related

Chart.js custom legend inside of chart

fiddle of where I'm at so far
I'm using chart.js, and I'm trying to create a legend that is inside the chart, and not a separate piece of html. I see a lot of posts about legendCallback, but that seems like it only works if you want the legend to be in an html block, and not a part of your canvas that chart.js renders on.
I need this to be all on the canvas, underneath the "Title" that I've place on the chart myself. The dates are my chart labels, the "Title" is a dataset where only the middle piece of data is set to visible, and the dashed line is my fifth dataset.
I'm preventing the title and dashed line datasets from showing up in the legend with this
legend: {
labels: {
filter: function(item, chart) {
return !item.text.includes('hide');
}
}
}
Further, I'd like my legends to look more like their lines:
If it's not possible to make custom shapes like that, is there any way to fill the rectangles in the legends, without changing the fill of my data points?
Edit: Sorry for the wonky variable declaration at the top, it's because this script get's transformed into a scirban template.

C++ CListCtrl How get cell border in View List

I have a CListBox with a View of type List. It has only one column that the View of type List splits.
I need to draw a border around each Item .
The column contains a blank icon with size 1 and the text.
How can I draw the box ?
Thanks.
Try adding style LVS_EX_GRIDLINES.

Qt : How to get QComboBox item text at an arbitrary index (not the currently selected item)

Extracting text of the selected QComboBox item is well known, but how do I get the text in a QComboBox for an arbitrary index item (not necessarily the one selected)?
Use itemText() method to do this. Just set needed index.
As Marek R pointed, you can get model and get data from this model, but it will be helpful for you when you want to get something more than text( for example get image with Qt::DecorationRole or font with Qt::FontRole)
http://qt-project.org/doc/qt-4.8/qcombobox.html#itemText
http://qt-project.org/doc/qt-4.8/qcombobox.html#model

Extjs dynamic filter

I have created a filter that contains unik values of column:
{
header : 'Вопрос А',
dataIndex: 'answerA',
itemId: 'answerA',
width : 100,
filter: {
type: 'list',
options: this.getStore().collect('answerA'),
},
editor: 'textfield'
}
When the user inputs new value in the cell of the column this value must appear in the filter. How can I do this?
I have looked at Extjs Grid Filter - Dynamic ListFilter but it doesn't help me much.
You should carefully look at StringFilter.js file which is at ux/grid/filter. I did this myself by adding a combobox to each filter. On combo expand I update its store by parsing the corresponding column data. Besides I advise you to collect unique values, for this task use Ext.Array.unique function. Otherwise, if two cells contain the same data both values will go to the store, which is not good, because any of them will produce the same filtration. I do not attach my code, because it is heavily dependent on my custom data types, but the idea is quite easy, I think.

Expression to set cell spacing with SQL Report Builder 3.0

I want an expression tho show the square box around every entry inside a column.
I am getting a normal table view right now. I just want to seperate each row borders.
.i.e. Cell spacing.
Please help me in using cell spacing with report builder 3.0
In addition to resolve this issue do the following steps:
Add one more row above & below to the Data Row & adjust the height for row as 0.2 in(Approximately - Can you add it more as your wishlist).
Then set the background Color using the expression where you want to display a square box as follows,
If you want to match any conditions,
=Switch(Condition = Value_1, "Red",Condition = Value_2, "#D2D2D2",True, "No Color")
otherwise specify color names or code, red, etc.