grid

Drag and Drop custom controls between cells in a grid in WPF

﹥>﹥吖頭↗ 提交于 2019-12-01 05:42:14
问题 I've got some custom controls which are dynamically added to a custom grid. These controls can span over several columns and rows(which are all the same size). I'd like to drag and drop between the rows and columns. I can drag the individual controls, but they can move anywhere without limit. Even off the grid. I'd like to do it so it can only be dragged inside the grid AND snaps to the column/row it's dragged to. Is there any easy-ish way to do this? Honestly, if I could get the current row

Replace a node at (row,col) in a JavaFX GridPane

a 夏天 提交于 2019-12-01 05:38:41
I am making a grid-style game/simulation based on bugs "sensing" and eating food. I am using a gridPane (called worldGrid ) of labels to show the grid of bugs and food. This is obviously going to be constantly updated when a bug moves cells towards food etc. I currently have a function updateGrid(int col, int row, String cellContent) which I want to replace the label at [row,col] with a label that has the new text in cellContent. I have the follow which works worldGrid.add(new Label(cellContent), row,col); however im worried that that is just adding a label on top of the current label and

Looking for explanation for WPF Grid ColumnSpan behavior

做~自己de王妃 提交于 2019-12-01 04:14:38
I asked a question at http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/5c7f5cdf-4351-4969-990f-29ce9ec84b87/ , but still lack a good explanation for a strange behavior. Running the following XAML shows that the TextBlock in column 0 is width greater than 100 even though the column is set to width 100. I think that the strangeness may have something to do with it being wrapped in a ScrollViewer, but I don't know why. If I set a MaxWidth on the columns, it works fine, but setting Width does not. Why is the width of column 0 not being honored? Why does the column sizing behave differently

WPF Binding to Grid Column Width

爷,独闯天下 提交于 2019-12-01 04:06:19
I'm attempting to bind a DependancyProperty in one of my usercontrols to the Width property of a Column in a Grid . I have code similar to this: <Grid x:Name="MyGridName"> <Grid.ColumnDefinitions> <ColumnDefinition x:Name="TitleSection" Width="100" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions>...</Grid.RowDefinitions> <GridSplitter x:Name="MyGridSplitter" Grid.Row="0" Grid.Column="0" ... /> </Grid> In a separate Usercontrol I have the following DependancyProperty defined. public static readonly DependencyProperty TitleWidthProperty = DependencyProperty

Responsive equal height columns in rows with CSS3/HTML5 Only

不问归期 提交于 2019-12-01 03:57:18
问题 I would like to create a responsive table-layout with the use of the div , to be displayed for mobile devices only , where the elements has equal height for each rows using only CSS/CSS3 and not JavaScript, nor jQuery or plugin . I found a working example, that uses JS : here is the CODEPEN live example. I've made a research, but i did not find any working example that make use only of pure CSS/CSS3/HTML5 (flexbox for example) . The best is to have only floating div s, and no hack CSS code:

Buttons have their own coordinate system according to the “grid_location” method?

旧街凉风 提交于 2019-12-01 03:51:28
问题 I'm trying to use the grid_location method, from the Grid Geometry Manager , in Tkinter, but it seems that I'm doing something wrong. Here's my code: from tkinter import * root = Tk() b=Button(root, text="00") b.grid(row=0, column=0) b2=Button(root, text="11") b2.grid(row=1, column=1) b3=Button(root, text="22") b3.grid(row=2, column=2) b4=Button(root, text="33") b4.grid(row=3, column=3) b5=Button(root, text="44") b5.grid(row=4, column=4) def mouse(event): print(event.x, event.y) print(root

ExtJS 4 - Grid - Disable rowselection for specific column

坚强是说给别人听的谎言 提交于 2019-12-01 03:47:08
问题 I have created a grid with extjs 4. The selection.CheckboxModel is implemented to. This means that the row is selected/deselected wherever you click on the particular row. Now i want to disable this selection on the last column since it contains custom buttons. (I don't want to select the row if a button is clicked). Any idea's how to do this? Many thanks in advance! 回答1: This is actually a tricky little problem, if only because Sencha documentation is lacking. The CheckboxModel does indeed

ExtJs4 - What is the equivalent to the grid ColumnModel?

放肆的年华 提交于 2019-12-01 03:29:11
What is the equivalent to the ExtJs3 Ext.grid.ColumnModel in ExtJs4? What I want to do is hide a column, I did something like below in ExtJs3: grid.colModel.setHidden(1, true); You can hide/show column using setVisible method of Ext.grid.column.Column: grid.columns[1].setVisible(false); The other answers can be problematic if your column indexes change. Here is another solution: Set itemId on the column definition: { itemId: 'myActionColumn', xtype: 'actioncolumn', width: 50, items: [ ... } Then to hide: grid.down('#myActionColumn').hide(); Ext.grid.header.Container code of Ext.panel.Table:

Inline markup blocks cannot be nested. Only one level of inline markup is allowed. MVC RAZOR

自作多情 提交于 2019-12-01 03:22:21
I one one modal window with telerik grid inside. But i need to render images in my grid so as i understand i cant use @ twice. Here is blog post about this issue Link Can someone assist me please. My Code @{ Html.Telerik().Window() .Name("images") .Title("Select an Image") .Content(@<text> @(Html.Telerik().ComboBox() .Name("AjaxComboBox66") .AutoFill(true) .SelectedIndex(0) .BindTo(new SelectList(Model.PhotoFolders, "ID", "Name")) .Filterable(filtering => filtering.FilterMode(AutoCompleteFilterMode.StartsWith)) .HighlightFirstMatch(true) .ClientEvents(events => events .OnChange("onChange") ) )

Displaying Matplotlib Navigation Toolbar in Tkinter via grid

爱⌒轻易说出口 提交于 2019-12-01 02:28:11
I'm developing a small Tkinter GUI to draw matplotlib-plots. (It contains a few Entries and assembles the plot according to their content.) I have designed my plotting widget according to http://matplotlib.org/examples/user_interfaces/embedding_in_tk.html , only I use grid instead of pack: canvas = FigureCanvasTkAgg(fig, master=root) canvas.get_tk_widget().grid(row=1,column=4,columnspan=3,rowspan=20) That part works. But embedding the NavigationToolbar in the same fashion does not. Tkinter breaks down without error when I include the lines: toolbar = NavigationToolbar2TkAgg( canvas, root )