datagrid

How to bind to WPF DataGridColumn in MVVM from ContextMenu?

拥有回忆 提交于 2019-12-25 02:24:32
问题 I have a DataGrid with different Columns (TextBox, Combobox, DataPicker, etc.) displaying Data via MVVM. Now I want to have ContextMenu on each ColumnHeader to Group by the selected column, but I can't access the Binding Source (Binding Path) of the Column to tell ViewModell which column it has to Group. When I open the context menu for the first time it works fine, but when I open the context menu once again, it still passes the SortMemberPath from the first time. What am I doing wrong? XAML

Change the text color of a datagrid row on particular condition in AIR application in flex 4

こ雲淡風輕ζ 提交于 2019-12-25 02:14:10
问题 I want to change the text color of the datagrid row on particular condition ie. i am checking on a condition.If that satisfies then I have to change the text color of each cell ie the whole row. Here is the code, private function resultHandlerGrid(event:ResultEvent):void{ arrc1 = ArrayCollection(event.result); adg1.addEventListener( ListEvent.ITEM_CLICK,getValue); } private function getValue(e:ListEvent):void{ if(e.itemRenderer.data.priority == "High") { e.itemRenderer.data.client_name

How to Bind DataGrid to dynamically changeable data and User Inputs in WPF and MVVM

老子叫甜甜 提交于 2019-12-25 02:09:05
问题 I´m quite new to WPF and I want to show in my UserControl something like this: Sample Image I get data from different sources: Columns: ID: always present Problem 1 ...n: I have an XML-file like this one from which I want to get the Columns for the Problems. There can be a variable number of Problems. Grade: always present Rows: Each Row should only contain Textboxes (some are read-only for the user). The Data in the ID Column comes from a file. The Values for the Problems are input by the

Datagrid Multiselection of same object

妖精的绣舞 提交于 2019-12-25 01:48:36
问题 wpf datagrid in which will bind to an observable collection of employee details. Grid will loaded from another screen upon selection of employees by user.If user selecting employee A multiple times same record will loaded in to this grid. But my problem is when i select employee A and then selecting the same employee A of another row my row selection style is applicable to both records. I set selection mode property of grid to Single. then also same multiple selection of same record is

Validating a value for a DataColumn

社会主义新天地 提交于 2019-12-25 01:45:54
问题 I'm using a DataGrid with edit functionalities in my project. It's handy, compared to having to edit its source data manually, but sadly, that means that I'll have to deal with validating user input a bit more. And my problem is basically just that. When I set my DataGrid to EDIT mode, modify the values and then set it to UPDATE, what is the best way to check if a value that I've entered is, in fact, compatible with the corresponding column's data type? i.e. (simple example) // assuming

How to add checkbox to datagrid in vb.net

烂漫一生 提交于 2019-12-25 01:35:26
问题 I have a datagrid with a set of columns showing data from a database. I create the datatable and add it to the datagrid and then bind the source. this works great and now I would like to add a column to the front of the grid that has checkbox in it. Do I add the checkbox when I am adding the new row to the datatable that is shown in the datagrid or after I databind the datatable to the datagrid? Using: VB.Net, Visual Studio 2012 回答1: you can add checkbox using template field Set

Datagrid selected row at a certain column as3

自古美人都是妖i 提交于 2019-12-25 01:29:42
问题 I need to get the value of a certain column in the selected row via AS3, how can I do this? It keeps returning null when I try grid.SelectedItem.text ... Thanks for the help! I need to be able to reference the column by name, in this case "ID". EDIT: Does this require an event or something? Shouldn't there be a method for this built in? You'd think so... 回答1: Can you be a bit more specific ? You can get get all the data you need from the DataGrid using the selectedItem.yourProperty. Can you

WPF Datagrid - Column Binding related to other columns

六眼飞鱼酱① 提交于 2019-12-25 01:09:28
问题 I have a DataGrid with several Columns. Some of these columns are something like state|Color1|Color2|Color3|... I want to do this: If state==1 => RowForeground = Color1 If state==2 => RowForeground = Color2 If state==3 => RowForeground = Color3 ... The very first solution I can think is to use several Data Triggers: <DataTrigger Binding="{Binding Path=state}" Value="0"> <Setter Property="Foreground" Value="{Binding Path=color0, Converter={StaticResource str2clrConverter}}"/> </DataTrigger>

Setting WPF datagrid source to a group of string arrays

拟墨画扇 提交于 2019-12-25 01:04:37
问题 I have number of string arrays. For example an array of 13 usernames then a seperate array of 13 passwords. Could someone please tell me what the most efficient way of getting these into a WFP datagrid is? The simple option I can think of is to loop through the arrays, pick out the values and add them as a row into the datagrid but I was wondering if I can pass the arrays in as columns or something? Please let me know if you need anymore information. 回答1: DataGrid works on attributes (columns

Get column index in onresizecolumn of declarative dojox.grid.datagrid

我与影子孤独终老i 提交于 2019-12-25 00:36:16
问题 In a declarative dojox.grid.datagrid, am using onresizecolumn in table tag. onresizecolumn="columnResize(this.id,this.cellIdx)" onresizecolumn calls a function. on resizing particular column i want to get the cellIdx. <div class="claro" id="eterte" name="dataGrid" onclick="getConnect('inner__eterte');setWidgetproperty(this.id,'xy','inner__eterte');" ondblclick="editCustomGrid(this.id)" onmouseup="setDocStyle(this.id)" style="height:200px; left:39px; position:absolute; top:251px; width:950px;"