certain special characters (ie '<>' or '=>') the data gets converted to & format when pasted into cell in telerik grid view - database

When I paste a value into a cell that has a special character ( > or <= ) it looks fine, but when they close and reopen the grid it shows up with the &
This is happening in telerik grid view control for winforms.And the cell in inserted into database which column is nvarchar().
Like I paste <10 and it converted to <10

Related

Google sheets copying adjacent cells so they're stacked

I'm trying to create a cell in Google Sheets such that it is the value of one cell, a carriage return, and then the value of another cell. I want to be able to copy the resulting cell such that it can be pasted into a proprietary program that is expecting two cells vertically.
I'm able to create the cell using
=B3 & char(10) & B4
Which displays the values one on top of the other in the resulting cell.
The problem I have is that when I copy the contents of the new cell and paste it into my proprietary application, the carriage return doesn't copy, which was the whole point of making the cell to begin with.
Any ideas what I might do or perhaps there's a workaround I haven't thought of? It looks like there used to a web clipboard feature in Sheets but it's been discontinued.
instead of your
=B3&CHAR(10)&B4
try:
={B3; B4}

How to create little colored shape in a cell that would indicate colors on a chart? SSRS 2012

I have a bar chart with different bar colors. Below in a table I just want to indicate what each color means.
Can I do something like that in SSRS?
Im sure I can create another column on a left and assign each color to a cell. But is any way I can display it the way its on a picture above?
I tried to use indicators for that but I guess it needs conditions.
You can do this with custom code.
Loose steps to follow are:
Create a list to hold the graph
Add the graph
Inside the list and below the graph, add a tablix
The tablix will row group on the same thing as the graph (so you can get a row per coloured item in the graph)
Add a column to the start of the tablix for the colour
Add the following custom code:
Private colourPalette As String() = {"#418CF0", "#FCB441", "#DF3A02", "#056492", "#BFBFBF", "#1A3B69", "#FFE382", "#129CDD", "#CA6B4B", "#005CDB", "#F3D288", "#506381", "#F1B9A8", "#E0830A", "#7893BE"}
Private count As Integer = 0
Private mapping As New System.Collections.Hashtable()
Public Function GetColour(ByVal groupingValue As String) As String
If mapping.ContainsKey(groupingValue) Then
Return mapping(groupingValue)
End If
Dim c As String = colourPalette(count Mod colourPalette.Length)
count = count + 1
mapping.Add(groupingValue, c)
Return c
End Function
For the series fill on the graph, use the follow expression:
Use the same expression for the fill on the initial column in the tablix
You can use any list of codes for colour - this is the list for the default palette in SSRS.
This code ensures the same colour is picked each time the same item is used - so in the image the same colour is returned each time the same Category is returned.
The solution I use is pretty simple.
I use Windows Character Map to find a character I like. For example: ■
Copy that character and add an expression where you want to show the color icon. Your expression text will be
="■"
Then go to the Font tab and Color. Select the color you want from the menu. You can use expression logic in here to change the color dynamically. (You can refer to other answer for details there)

WPF DataGrid - Adding Rectangles to DataGrid cells in codebehind

I have a DataGrid that is populated in Codebehind using its DataContext. So the columns are auto generated and the actual number of columns generated do change.
Ultimately I need to be able to display a barchart in the Cells (col) depending on the value of a cell in another field (Col + 1).
My initial thoughts are to add a rectangle and change its width to the percentage of the cell width based on the value in col + 1 - but I am failing to find where to start doing this entirely in code behind.
Has anyone done this or have any advice that might help me get to what I am looking for please?
I can give more information if required.
EDIT:
As Requested, I thought I would try and visualize what I am after better. So, my Datagrid is populated with data similar to the following:
where there are 3 sets of 2 columns (a Perc & Result column for 1, 2 & 3... This number could be up to anything!). Now, the value in the Perc column is referenced to conditionally control the style of rectangles that sit in the respective Result columns (in this example I am using colours to represent the percent. In reality I am looking to use the perc value to set the width of the coloured rectangle in the Datagrid cell to give a barchart appearance).
Finally, I will hide all the Perc columns so the results will look like:
Does that mke any more sense... I hope I havent confused things further??

Grid index out of range on scrolling

i have this problem:
I needed to hide a row in a string grid so i simply did something like:
StringGrid.RowHeights[StringGrid.Row] := 0;
So this basicly sets the row height to 0 and it looks hidden. But after i do this and if i try to scroll i got a "Grid index out of range". If i click on another cell the error doesn't show up after i scroll. So it only shows when i hide it and then scroll directly after hiding a row.
Why does this happen and how can i fix it please?
You are not quite supposed to do that. Instead of making the heights 0 you can simply 'skip' putting the data in the rows you want to hide.
For example, your table is like this:
a b c
d e f
and you want to hide the second row, then you say: RowCount:= RowCount-1 and simply don't display the data in that row.
For this you need a procedure (let's call it RefreshData) which will show the data in the grid, will decide which data rows to show or not and will calculate how many rows the grid should have.
I had a problem where I'd get the grid index out of range error when attempting to modify colcount or rowcount on a stringgrid. I debugged the grid.pas and figured out the error was because I was accidentally setting the ColWidth property of the negative first column to -1 like ColWidth[-1] = -1. That had the effect of modifying some memory of an array that stores the list of widths of each column and the control would act as if the columns and rows did not exist when attempting to add more. Only putting this here because I searched all over the internet to find the answer and there was nothing so maybe someone else will make the same mistake.

syncfusion GridControl column width not set properly

I am using the synfusion GridControl in my application.The user can select a text file and data from the file is displayed in the grid. Each and every time the grid is populated the column width is set using the code.
_gridPDD.ColWidths.SetSize(i, columnWidth);
where columnWidth will hold some fixed value based on the type of data displayed in the column.
Now the below test case works differently-
The user changes the width of the columns in the grid by dragging the edge of columns. When a new file is opened in the application and the grid is populated the columns are not shown with the default width (width set with the above line of code) instead they are set with the width of the columns in the previous section ( The width of column after the user perform a drag ).
Any help in this... Is there any property in the syncfusion GridControl that makes this behaviour? How to avoid this behaviour?
Thank you for your interest in Syncfusion products.
Your problem is the size(the width of column after the user perform a drag ) getting modified. In order to resolve this please restrict the resizing option using ResizeColsBehaviour. You may be resizing(by dragging the columns) to view the data. For that you can use AllowPropotionalColumnSizing. This allows you to resize the columns proportionately as per the data size.
Code Snippet:
//to restrict the resizing option using drag
this.grid.Model.Options.ResizeColsBehavior = GridResizeCellsBehavior.None;
//to resize the columnpropotionatelt according to the column data
this.grid.AllowProportionalColumnSizing = true;
Reference :
http://www.syncfusion.com/kb/695/how-to-prevent-column-resizing-for-child-tables-in-gridgroupingcontrol
http://www.syncfusion.com/kb/4853/how-to-optimize-the-resizetofit-method-for-large-number-of-records
Please let us know if your requirement is different from this.
Thanks & Regards,
AL.Solai.

Resources