w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Change in content of one cell changes other cells as well in UITableView
(From my above comments:) You cannot use the cell to store the state of a row, because cells are reused. The table view allocates only a finite number of cells. If you scroll down, dequeueReusableCellWithIdentifier returns one of the existing cells that have become invisible. Therefore, you have to store the row's state in a data source and update the complete state of the cell (including the button's state) in cellForRowAtIndexPath.

Categories : Iphone

Change Cell Editor for specific Cells with AbstractTableModel
The JTable’s default implementation is column-based. The only way to change that behavior, if you want to have row or single-cell based choices, is to create a subclass of JTable and override the method public TableCellEditor getCellEditor(int row, int column). Inside your implementation you can use the provided row and column indices to make a different choice. The JTable will always use this method to get the cell editor.

Categories : Java

Mimic the table cell behaviour with divs: middle vertically alligned text, and the content in one cell that enlarges the height of both cells
Try something like this: HTML: <div id="container"> <div id="left-col"> <p>column 1</p> <p>some other random text</p> </div> <div id="right-col"> <p>column 2</p> </div> </div> CSS: #container { overflow: hidden; width: 100%; } #left-col { float: left; width: 50%; background-color: green; padding-bottom: 500em; margin-bottom: -500em; } #right-col { float: left; width: 50%; margin-right: -1px; /* Thank you IE */ border-left: 1px solid black; background-color: yellow; padding-bottom: 500em; margin-bottom: -500em; } http://jsfiddle.net/R7Y49/1/ it has already been answered h

Categories : CSS

How to push without the default --mirror option in a mirror repo
Just edit your .git/config and unset remote.<remote>.mirror, as is explained in git help push: --mirror Instead of naming each ref to push, specifies that all refs under refs/ (which includes but is not limited to refs/heads/, refs/remotes/, and refs/tags/) be mirrored to the remote repository. Newly created local refs will be pushed to the remote end, locally updated refs will be force updated on the remote end, and deleted refs will be removed from the remote end. This is the default if the configuration option remote..mirror is set.

Categories : GIT

Is there any way to get a macro or module to change the copy destination cell from one cell to another cell in the next row with each run?
In order to do that, you can do it a couple of different ways: Method 1 In your macro, you will need code that counts how many sheets exist in the workbook. Then use that number to determine what cell on Sheet1 should be copied to cell B10 on the new sheet. This method has some pitfalls if you have other sheets in your workbook. Method 2 Store the row number of the cell you want to copy in a cell somewhere on Sheet1. Every time your macro runs, retrieve that value to determine which cell to copy to the new sheet, then increment that value, so the next time the macro runs, it will get the next cell. This method is probably the most straight-forward, but you need to make sure that you don't accidentally erase or alter the cell containing your current row number.

Categories : Excel

How to change default options for "Set CRAN Mirror" or "chooseCRANmirror()" in R?
Looks like in utils/R/packages.R source code, chooseCRANmirros() calls the function getCRANmirrors(all = FALSE, local.only = FALSE) and it does the following: getCRANmirrors <- function(all = FALSE, local.only = FALSE) { m <- NULL if(!local.only) { ## try to handle explicitly failure to connect to CRAN. con <- url("http://cran.r-project.org/CRAN_mirrors.csv") m <- try(open(con, "r"), silent = TRUE) if(!inherits(m, "try-error")) m <- try(read.csv(con, as.is = TRUE)) close(con) } if(is.null(m) || inherits(m, "try-error")) m <- read.csv(file.path(R.home("doc"), "CRAN_mirrors.csv"), as.is = TRUE) if(!all) m <- m[as.logical(m$OK), ] m } So, it has a hard-coded value for the CRAN

Categories : R

How does cell updates get propagated to its corresponding replicas?
You are correct, only the one new column will be set to replicas. Cassandra is designed to do writes with no disk seeks, so cannot do reads to propagate writes. (The exception is for counters and some operations on collections, when reads are made on the coordinator for the update. But still, the column propagated is only the column being updated.)

Categories : Cassandra

how to let JTable listens to user's selection and updates a cell value
You may be able to use one of the approaches suggested here. If the dependent column is not editable, simply return the desired result from your TableModel based on the combo selection. If the dependent column is editable, use either approach shown here.

Categories : Java

Extjs : Change grid cell value on every change of another cell in the same row
You can use a edit event listener and play with the record as you want. Here it is : listeners: { edit: function (editor, e, eOpts) { var text = e.record.data.name; console.log(text); if (text.length <= 26 && !text.match(/[.:-]/)) { if (text.length == 26) { text = text[25] == ' ' ? text : text.substring(0, text.lastIndexOf(' ')); } //code to set short name cell value. var record = e.record; record.set("email", text); //Here you can set the value } } } Their are many ways you can achieve the desired task.This is one way!! For reference,here is the fiddle

Categories : Javascript

Copy cell value to all cells below it
Sub Example() Dim MasterValue As String Dim StopRow As Long Dim i As Long 'Get the master value MasterValue = Range("C5").Value 'Get the first blank cell in column A StopRow = Range("A1").End(xlDown).Row 'Start at row 6 and continue to the "Stop Row" For i = 6 To StopRow 'Set every cell from row 6 in column 3 to the "Master Value" Cells(i, 3).Value = MasterValue Next End Sub

Categories : Excel

R: How to separate string in a cell into several cells in a row?
strsplit is not required here. read.table should work fine. Try: read.table(text = as.character(Data$X), header=FALSE, fill=TRUE) You will have to rename the resulting variable names though.

Categories : R

MS Excel - Sum of multiple cells if the cell contains "X"
The easiest way might be using a hidden column to compute the sums, and then pull the sum from this column into the visible column. In column C here, I have entered the formula =IF(B2="X",VLOOKUP($A2,$G$2:$H$4,2,FALSE),"") into C2 Then C6 is the SUM of C2:C4, and B6 is just =C6. Column C can be hidden, just leaving the sum visible without the intermediate computations.

Categories : Excel

Multiple cells within a cell in a DataGridView
at least 1 way is create a usercontrol with a textbox with other control like another textbox and then add it,take a look at this article in msdn - http://social.msdn.microsoft.com/Forums/windows/en-US/c28399bb-9d50-4a1e-b671-3dbaebb5cc69/multiple-controls-in-a-single-datagridview-cell Here you go glimpse,glad i could help.

Categories : C#

Matlab, Create one cell of some cells
C = {'one','two','three'}; str = strjoin(C) --> see: TMW: join cell

Categories : String

How do I make what my cell looks like update each time there is a change to the object in NSFetchedResultsController that corresponds to the cell?
It doesn't go inside that if because article object is the same. However its properties might be updated. You might want to change the if or introduce some other method like -[ArticleCell update] that checks if any of the properties that affect the appearance of the cell are changed.

Categories : IOS

Loop through all cells and delete any zero cell (shift up)
Select the range to delete blanks within. Home > Editing – Find & Select, Go To Special, Blanks, OK, select within array, Delete…, Shift cells up, OK. To apply the same process to cells containing 0 select range to delete 0s within and start (ie before above) by replacing these with nothing: Home > Editing, Find & Select, enter 0 in Find what:, check Match entire cell contents and ensure Replace with: is empty, Replace All.

Categories : Vb.Net

VBA Macro If cell found in multiple cells then
I'm not ENTIRELY sure what you're looking for, but you need to write a For Each...Next loop to loop through each cell and check it's value. Excel doesn't know you want to look at each cell in those ranges, therefore you need to tell it to using a loop. Trying working with this. For Each c In Worksheets("Sheet1").Range("O1:O100").Cells If c.Value = Range("E21").Value Then Range("E23").Value = "3" Next http://msdn.microsoft.com/en-us/library/office/aa221353(v=office.11).aspx

Categories : Excel

Evaluate cells of strings in a cell array
Here's a sweet one: out = cellfun(@(y) cellfun(@(x) [ y{1} '.' x],y{2},'UniformOutput',false),theCellArray,'UniformOutput',false) out{:} ans = 'aa1.bb' 'aa1.cc' ans = 'aa2.dd' 'aa2.ee' Super One liner! (but not very efficient) And only works with original pose of question with 2 levels of cell strings.

Categories : Arrays

Colspan in table cell (td) shifts cells
Colspan does not make the adjacent cell magically dissappear. You need to leave it out. Proper code: <TABLE border="1"> <TBODY> <TR style="height: 10px;"> <TD BGCOLOR="#CDB599">&nbsp;</TD> <TD COLSPAN="2" BGCOLOR="#9CC5C9">&nbsp;</TD> </TR> <TR style="height: 10px;"> <TD BGCOLOR="#D5544F">&nbsp;</TD> <TD BGCOLOR="#CDB599">&nbsp;</TD> <TD BGCOLOR="#CDB599">&nbsp;</TD> </TR> </TBODY> </TABLE>

Categories : HTML

JTable colors all cells and not only the specific cell
You will need to create your own cell renderer and have it return the proper background color depending on the text contained in the cell. public class MyTableCellRenderer extends DefaultTableCellRenderer { @Override public Color getBackground() { String steak = getText(); if (steak.startsWith("+")) { return Color.GREEN; } else if (steak.startsWith("-")) { return Color.RED; } else if (steak.startsWith("~")) { return Color.YELLOW; } else if (steak.equals("")) { return Color.WHITE; } return super.getBackground(); } } } And make sure your table use it. table.setDefaultRenderer(String.class, new MyTableCellRenderer()); Assuming here that type of all your cells

Categories : Java

Auto Copy a Value from a Cell and Paste it in Another Cells in another row
=OFFSET($B$1,ROUNDDOWN((ROW($A1)-1)/7,0)*7,0) Paste this into A1 and drag it down. Explanation: ROW returns the current row. ROUNDDOWN with the division and multiplication by 7 just rounds the current row down to the nearest multiple of 7. When you drag the formula down, it will output 0s for the first 7 rows, then 7s for the next seven rows, etc. OFFSET gives you the value of the cell at B#, where # is the row given by ROUNDDOWN.

Categories : Excel

Protect everything but the value of a cell or range of cells in a spreadsheet
You could theoretically write a script update the formatting back to your style during the onEdit() trigger. Something like - some pseudo code: function onEdit(event){ var ss = event.source.getActiveSheet(); var range = event.source.getActiveRange(); if(range.getBackgrounds()){ //or whatever you want to stay the same range.setBackgrounds(blue)// } SpreadsheetApp.flush(); return; } Edit: I don't know how you could protect your data validation though.

Categories : Google Apps Script

iOS: Find cell.tag value after user reorders cells
Actually add one NSMutableArray in .h file. Now in viewDidLoad method intialize it arrayTag = [NSMutableArray array]; While adding cell's tag add it in array - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ......... ......... ......... cell.tag = indexPath.row; NSString *strCellTag = [NSString stringWithFormat:@"%d",cell.tag]; if(![arrayTag containsObject:strCellTag]) { [arrayTag addObject:strCellTag]; } return cell; } Now in these delegate method replace tag - (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath *)proposedDestinationIndexPath { [arrayTag replaceObjectAtIndex:sourceIn

Categories : IOS

make uipickerview appear between cells when touched cell
You can insert a new cell which contains a UIPickerView when user tap on a cell by using this method - - (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation Also for this you need to handle your data structure carefully by which you are populating your UITableView. You can checkout this repo, it might help you - https://github.com/saadnib/InsertPickerInTableView

Categories : IOS

how datagridview cell color change on gridview cell click
This Is For Default Cell Value Set On Gridview Cell private void dataGridView1_DefaultValuesNeeded(object sender, DataGridViewRowEventArgs e) { e.Row.Cells["ship_qty"].Value = (decimal)0; e.Row.Cells["packs"].Value = (decimal)1; } This Is For Color Change private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { DataGridViewCellStyle CellStyle = new DataGridViewCellStyle(); CellStyle.BackColor = Color.Red; dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style = CellStyle; } Hope This is helpful for you thanks

Categories : C#

Creating an excel macro to map elements in cells to another cell
Try below code : Sub sample() Dim lastRow As Long, i As Long, j As Long lastRow = Range("A" & Rows.Count).End(xlUp).Row For i = 1 To lastRow temp = Split(Cells(i, 2), ",") For j = LBound(temp) To UBound(temp) Cells(Cells(Rows.Count, 3).End(xlUp).Row + 1, 3).Value = Cells(i, 1) Cells(Cells(Rows.Count, 4).End(xlUp).Row + 1, 4).Value = temp(j) Next Next End Sub

Categories : Excel

Excel Split Data from 1 cell into multiple cells
As a new column appears for each 2000 in G10, one can say: columns_number = ceil(G10 / 2000) Now, let's say the user enters the value in G9 instead of G10. Let's say we use H9 as a placeholder for "columns_number": In H9 you write = CEILING(G9/2000;1) Then, contents of G10 is trivial: = $H$9 And contents of H10: = IF($H$9>=2;$H$9;0) And contents of I10: = IF($H$9>=3;$H$9;0) ... and so on until P10. Summary: G H I 9 2200 =CEILING(G9/2000;1) 10 =$H$9 = IF($H$9>=2;$H$9;0) = IF($H$9>=3;$H$9;0)

Categories : Excel

How to style Asp.net GridView cells with colour based on cell value
If you only want to styling depend on value , i must recommend you to do it client side, by using Jquery or javaScript. Also it wont effect on performance as its on client side rather then doing it on RowDataBound Code: Using Client Side - (which i recommend more) Here you can set as many condition depend on your class values, no need to write extra server side code $(document).ready(function () { $(".myGvClass").find("td").each(function () { if ($(this).text() == "Class B") { $(this).css("color", "Red"); } if ($(this).text() == "Class A") { $(this).css("color", "Blue"); } if ($(this).text() == "Class C") { $(this).css("color", "green"); } // .....

Categories : C#

Split a cell's formulaic elements into seperate cells
Your formula is already accessing those values in order to sum them in the open workbook. You do NOT need to re-open the workbook in order to evaluate the reference values, nor to parse the formula in the active workbook. Assuming your formula references a closed workbook, with a simple sum function like: ='C:Usersdavid_zemensDesktop[test.xlsx]Sheet1'!$A$1 + ='C:Usersdavid_zemensDesktop[test.xlsx]Sheet1'!$B$1 You can parse the formula either in VBA or using string functions on the worksheet. As you note, for this example, parsing by the + operator will suffice. Since I think you understand how to do this, my example does not demonstrate how to parse the formula. As long as you know or can obtain the references from the formula, you should be able to access those cells' values via form

Categories : Excel

Multiply two cells in DataGridView - if cell empty issue
Try this : private void calculateProductTwoColumns2(int castkaIndex2, int pocetIndex2, int tot_rows2) { try { double outVal = 0; foreach (DataGridViewRow row in dtg_ksluzby.Rows) { double cell1; double cell2; if(Double.TryParse(row.Cells[castkaIndex2].Value, out cell1) && Double.TryParse(row.Cells[pocetIndex2].Value, out cell2 )) { outVal = outVal + cell1 * cell2; } } kpriplac.Text = outVal.ToString(); } catch (Exception ex) { MessageBox.Show("Chybové hlášení K3 " + ex.Message.ToString());

Categories : C#

Excel formula to the value of a cell based on two cells' values
In case this helps, the following formulae seem to display the values at the corners, assuming Measure is a named range starting in A1 and value1 and value2 are named ranges: =INDEX(Measure,IFERROR(MATCH(value1,A:A,0),MATCH(value1,A:A,1)),IFERROR(MATCH(value2,1:1,0),MATCH(value2,1:1,1))) =INDEX(Measure,IFERROR(MATCH(value1,A:A,0),MATCH(value1,A:A,1)),IFERROR(MATCH(value2,1:1,0),MATCH(value2,1:1,1)+1)) =INDEX(Measure,IFERROR(MATCH(value1,A:A,0),MATCH(value1,A:A,1)+1),IFERROR(MATCH(value2,1:1,0),MATCH(value2,1:1,1))) =INDEX(Measure,IFERROR(MATCH(value1,A:A,0),MATCH(value1,A:A,1)+1),IFERROR(MATCH(value2,1:1,0),MATCH(value2,1:1,1)+1))

Categories : Excel

Excel: get cell collection of cells that contain certain text or formula
Paste this macro in your macro editor in your workbook (ALT+F11) Sub test() Dim w As Worksheet, r As Range For Each w In ThisWorkbook.Worksheets For Each r In w.UsedRange If r.Value = "Certain text" Or r.Formula = "Certain Formula" Then 'Do what you want to do here End If Next Next End Sub Hope this helps

Categories : C#

How to iterate Telerik Asp.net RadGrid Cells and modify the cell value
Figured it out - In ItemDataBound: if (e.Item is GridDataItem) { GridDataItem dataItem = e.Item as GridDataItem; int columnCount = ((DataRowView)dataItem.DataItem).Row.Table.Columns.Count; string cellValue = string.Empty; string uniqueColumnname = string.Empty; for (int x = 0; x < columnCount; x++) { uniqueColumnname = ((DataRowView)dataItem.DataItem).Row.Table.Columns[x].ToString(); cellValue = ((DataRowView)dataItem.DataItem)[uniqueColumnname].ToString(); if (string.IsNullOrEmpty(cellValue.ToString())) { TableCell cell = dataItem[uniqueColumnname]; cell.Text = "n/a";

Categories : Misc

List cells without spaces, based on another qualifying cell
With layout as shown: this formula works: {=IF(IFERROR(INDEX(B:B,SMALL(IFERROR(1/SIGN((C:C=A$1))*ROW($1:$5),6),ROWS(B$1:B1)),1),"")=0,"",IFERROR(INDEX(B:B,SMALL(IFERROR(1/SIGN((C:C=A$1))*ROW($1:$5),6),ROWS(B$1:B1)),1),""))} (where 6 is the total rows to apply to) but it is slow and not what I would recommend. My preference would be to accept the blanks in the first instance, copy that column to a spare sheet, filter to remove blanks and copy back. I have added Yes in A1 in case you really wish to change this to no.

Categories : Excel

How to prevent UITableViewCell from appearing behind other cells, when animating the deletion of the cell?
The documentation indeed says: ... the deleted row or rows slides out toward the top. I've recently used UITableViewRowAnimationFade because of 'weird' shifting of rows with UITableViewRowAnimationTop/Bottom.

Categories : Objective C

Button pressed in Table View Cell with reusable cells
Yes, this is due to cell reuse. In cellForRowAtIndexPath, in addition to setting the labels, you've got to set the selected state by doing something like this: cellOpt.selected = [accessoriSelezionati containsObject:cellOpt.label1.text];

Categories : Xcode

cell.accessoryView image appearing when it shouldn't for reusable cells only
You use [self setSelected:NO animated:NO]; in method (void)swipeCell and in method - (void)unswipeCell. But in (void)swipeCell it should be [self setSelected:YES animated:NO];. Hope it helps

Categories : IOS

How to automatically update cells range in Excel depends on value of given cell?
You want the Indirect function. Pass it a string containing a cell reference, and it'll work as if you referenced the cell directly. To have a range, put the call to Indirect before or after the : that defines the range: For example: A1:INDIRECT(...). Here's my test spreadsheet: | A | B -+----+----------------------------- 1| 11 | Sum this many cells 2| 22 | 2 3| 33 | Here's the sum: 4| 44 | =SUM(A1:INDIRECT(("A"&B2))) 5| 55 | In cell B4, I create a range by specifying the beginning of the range (A1) and use Indirect for the end of the range. I use a hard-coded "A", and concatenate that with the integer value from another cell, and pass the result of the concatenation ("A2") to Indirect.

Categories : Excel

Why does nil-checking a table view cell property cause one of my cells to copy another?
It's very likely the issue is with the image package you are using. If you are making repeated URL requests to grab images, it is probably best practice to implement NSURLCache, which is a fairly simple and handles caching perfectly so it is not an issue. This is the NSHipster guide on how to use it. Other solutions tend towards these sorts of issues. Since it is a category on UIImageView, it could be any number of things causing issues with UIImageView's implementation when getting used in the cell.

Categories : Objective C

Prevent More than 1 cell From Being Changed While Ignoring if the Cells' Contents Were Deleted
Try this Private Sub Worksheet_Change(ByVal Target As Range) Dim cl As Variant Dim dat As Variant Application.EnableEvents = False If Target.Cells.Count > 1 Then dat = Target.Formula For Each cl In dat If cl <> "" Then MsgBox "Change only one cell at a time", , "Too Many Changes!" Application.Undo Exit For End If Next End If Application.EnableEvents = True End Sub Explanation: dat = Target.Formula copies the Formula's from a range into a 2D variant array. The .Formula is to avoid treating formulas that happen to return an empty string as blanks For Each cl in dat iterates each element of the array If cl is non blank then the user cannot have deleted the r

Categories : Excel



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.