datagrid

Grid with dataGrid resizing in WPF

北战南征 提交于 2021-01-28 03:08:51
问题 I have an issue when resizing window of my application. I have two DataGrids each placed in its own Column of Grid with another Column in the middle of the Grid containing GridSplitter to adjust the size of DataGrids. By reducing the window width from this state I need to get this: This way the each column and window would hit the MinWidth. But instead of that I get this (the left Column is not at its MinWidth): I noticed that it is the Columns in the DataGrid that stop/slow the shrinking of

primefaces datagrid filter by inputtext

北战南征 提交于 2021-01-28 01:54:48
问题 I want to use inputtext to filter datagrid. Some code like this: <p:inputText value="#{bean.searchString}"> <p:ajax event="keyup" update="grid" /> </p:inputText> <p:dataGrid var="item" value="#{bean.findItemsByName}" columns="9" layout="grid" rows="130" paginator="false" id="grid"> 回答1: There us no built in feature that allows datagrid filtering, but you can code your own. Something like this (using google library): Bean: import com.google.common.base.Predicates; import com.google.common

WPF/DataGrid: Binding to different properties for displaying and editing

蓝咒 提交于 2021-01-28 00:51:51
问题 I have an object that contains eg a string property like "10; 20; 30". I have also a get property that splits the string, converts each part to a double and sums them up. Thus I have "10; 20; 30" and 60.0 (as double). Now the question is. Is there a way to display the 60.0 (as double) in a TextColumn, but when going to edit mode editing the string "10; 20; 30"? So that I can bind to one property for displaying and to bind to another property for editing? 回答1: You can achieve this with your

Missing border lines in WPF DataGrid on Medium (125%) display

烂漫一生 提交于 2021-01-28 00:13:24
问题 I have a strange rendering issue with my wpf DataGrid on Win7 when the the display is set to Medium - 125%.The expected black vertical border line between the 2nd and 3rd column is not visible. <DataGrid ItemsSource="{Binding Rows}" AutoGenerateColumns="False"> <DataGrid.Resources> <Style TargetType="DataGridCell" > <Setter Property="Background" Value="Orange"></Setter> <Setter Property="BorderThickness" Value="0"></Setter> </Style> </DataGrid.Resources> <DataGrid.Columns> <DataGridTextColumn

Populate a DataGrid using ViewModel via a database

被刻印的时光 ゝ 提交于 2021-01-27 12:51:01
问题 Basically, I have a 4 files that I'm dealing with: DBDisplay.xaml DBDisplay.xaml.cs DBDisplayViewModel.cs DBConn.cs In my ViewModel I am trying to populate the following DataGrid from my .xaml file: <DataGrid ItemsSource="{Binding Path=Users}"/> With the following code: public class DBDisplayViewModel { public ICollectionView Users { get; set; } DBConn dbCon; // the connection object DataSet dataSet; DataRow dataRow; private void Load() { string connectionString = Properties.Settings.Default

How to delete row datagrid and update SQL database C#

你说的曾经没有我的故事 提交于 2021-01-27 11:52:40
问题 I am really stuck and non of the books or tread here are user-friendly enough to explain how to delete data from data grid object using C# from varies of books and fourm threads I have managed to get this coded but it fails to executes the sql command , I have One table call 'SpellingList' and two columns one is ID and the other is Words, all I want to do is delete a row from the datagrid. Can someone point me to the correct direction , once I solved this , I shall upload some basic easy to

Manually add rows in WPF DataGrid

折月煮酒 提交于 2021-01-27 04:06:52
问题 I have the following XAML Code: <sdk:DataGrid Margin="58,8,52,18" Name="dataGridTickets"> <sdk:DataGrid.Columns> <sdk:DataGridTextColumn x:Name="ticketNoColumn" Header="Ticket No." IsReadOnly="True" Width="SizeToHeader"/> <sdk:DataGridTextColumn x:Name="seatRowColumn" Header="Seat Row" IsReadOnly="True" Width="SizeToHeader"/> <sdk:DataGridTextColumn x:Name="seatNumberColumn" Header="Seat Number" IsReadOnly="True" Width="SizeToHeader"/> </sdk:DataGrid.Columns> </sdk:DataGrid> I would like to

Manually add rows in WPF DataGrid

倖福魔咒の 提交于 2021-01-27 04:06:37
问题 I have the following XAML Code: <sdk:DataGrid Margin="58,8,52,18" Name="dataGridTickets"> <sdk:DataGrid.Columns> <sdk:DataGridTextColumn x:Name="ticketNoColumn" Header="Ticket No." IsReadOnly="True" Width="SizeToHeader"/> <sdk:DataGridTextColumn x:Name="seatRowColumn" Header="Seat Row" IsReadOnly="True" Width="SizeToHeader"/> <sdk:DataGridTextColumn x:Name="seatNumberColumn" Header="Seat Number" IsReadOnly="True" Width="SizeToHeader"/> </sdk:DataGrid.Columns> </sdk:DataGrid> I would like to

Manually add rows in WPF DataGrid

早过忘川 提交于 2021-01-27 04:06:35
问题 I have the following XAML Code: <sdk:DataGrid Margin="58,8,52,18" Name="dataGridTickets"> <sdk:DataGrid.Columns> <sdk:DataGridTextColumn x:Name="ticketNoColumn" Header="Ticket No." IsReadOnly="True" Width="SizeToHeader"/> <sdk:DataGridTextColumn x:Name="seatRowColumn" Header="Seat Row" IsReadOnly="True" Width="SizeToHeader"/> <sdk:DataGridTextColumn x:Name="seatNumberColumn" Header="Seat Number" IsReadOnly="True" Width="SizeToHeader"/> </sdk:DataGrid.Columns> </sdk:DataGrid> I would like to

WPF: Filtering a dataGrid on the fly

无人久伴 提交于 2021-01-24 18:09:45
问题 In my WPF Window I have a DataGrid control, with its ItemsSource bound to an ObservableCollection of items (let's say a simple object with a couple properties): XAML: (Removed some xmlns stuff for brevity) <Window> <Window.Resources> <CollectionViewSource x:Key="MyViewSource" Source="{Binding MyItemList}" Filter="MyItemList_Filter"/> </Window.Resources> <Window.DataContext> <!-- Some Ioc stuff --> </Window.DataContext> <StackPanel> <TextBox Text="{Binding TextFilter}" /> <DataGrid Grid.Row="1